Deploying an Ethereum smart contract is an easy task thanks to MyEtherWallet’s Deploy Contract interface. All you need to have is the following:

  • Byte Code
  • ABI/JSON Interface
  • Contract Name

Once you have those three ready, the first two of which you can get once your smart contract is compiled, you can head over to MEW and deploy:

MyEtherWallet Deploy Contract interface

Just for clarification, the byte code looks something like this:

Advertisement

0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610503806100606000396000f3fe60806040526004361061005c576000357c010000000000000000000000000000000000000000000000000000000090048063075461721461006157806327e235e3146100b857806340c10f191461011d578063d0679d3414610178575b600080fd5b34801561006d57600080fd5b506100766101d3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100c457600080fd5b50610107600480360360208110156100db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506101f8565b6040518082815260200191505060405180910390f35b34801561012957600080fd5b506101766004803603604081101561014057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610210565b005b34801561018457600080fd5b506101d16004803603604081101561019b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506102e3565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561026b57600080fd5b789f4f2726179a224501d762422c946590d910000000000000008110151561029257600080fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561039a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f496e73756666696369656e742062616c616e63652e000000000000000000000081525060200191505060405180910390fd5b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f3990db2d31862302a685e8086b5755072a6e2b5b780af1ee81ece35ee3cd3345338383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505056fea165627a7a72305820f43ea59fe43f23cbc5125d0529e5e284545e00ae88b06fd88e9913027b7a750d0029

And the ABI/JSON interface can look something like this:

[
{
“constant”: true,
“inputs”: [],
“name”: “minter”,
“outputs”: [
{
“name”: “”,
“type”: “address”
}
],
“payable”: false,
“stateMutability”: “view”,
“type”: “function”
},
{
“constant”: true,
“inputs”: [
{
“name”: “”,
“type”: “address”
}
],
“name”: “balances”,
“outputs”: [
{
“name”: “”,
“type”: “uint256”
}
],
“payable”: false,
“stateMutability”: “view”,
“type”: “function”
},
{
“constant”: false,
“inputs”: [
{
“name”: “receiver”,
“type”: “address”
},
{
“name”: “amount”,
“type”: “uint256”
}
],
“name”: “mint”,
“outputs”: [],
“payable”: false,
“stateMutability”: “nonpayable”,
“type”: “function”
},
{
“constant”: false,
“inputs”: [
{
“name”: “receiver”,
“type”: “address”
},
{
“name”: “amount”,
“type”: “uint256”
}
],
“name”: “send”,
“outputs”: [],
“payable”: false,
“stateMutability”: “nonpayable”,
“type”: “function”
},
{
“inputs”: [],
“payable”: false,
“stateMutability”: “nonpayable”,
“type”: “constructor”
},
{
“anonymous”: false,
“inputs”: [
{
“indexed”: false,
“name”: “from”,
“type”: “address”
},
{
“indexed”: false,
“name”: “to”,
“type”: “address”
},
{
“indexed”: false,
“name”: “amount”,
“type”: “uint256”
}
],
“name”: “Sent”,
“type”: “event”
}
]

Once you have filled in the fields, just click the Sign Transaction button and confirm. I recommend using MetaMask for the interaction with the Ethereum network as it is the safest, fastest, and easiest way to go about it.

Then you need to wait for the transaction to be mined and voilà, your contract has been deployed.

Here is what an example contract deployment transaction looks like (we have used a sample contract created by TokenGen):

At this point, you can interact with the smart contract, again via MyEtherWallet (here’s how), and modify its state as you deem fit.

Discussion

avatar