Skip to content

How to deploy via Remix, MetaMask & MEW?

bartwr edited this page Nov 17, 2017 · 6 revisions

If you do not have MetaMask yet, install & configure it.

Then make sure you have some tokens on it. 0.25 ETH on test net could be enough.

Now we are going to deploy the contract.

2. Copy -> Paste your code into the editor

3. Click "Run" tab

4. Left from "Create" button: fill in an array with payout addresses

In example: ["0xb38dC6A1A4De7CeB0EDE9F2310dF70dDa8638e34"]

5. Click "Create". A popup appears.

popup

6. Click Submit button

7. Click the new Submit button

8. Look into your MetaMask wallet.

If you look into your MetaMask wallet, you now see the contract createion transaction in 'Sent'. Click on the transaction.

Created contract

You now see the transaction page:

img

9. Click on the address of the created contract.

10. Click the "Contract Code" tab.

Contract code tab

11. Click the "Verify and publish" link. You will see this page:

img

12. Fill in contract name

In example: MiningDAO.

13. Fill in the compiler version you used.

You can find the compiler version in the Settings of Remix:

img

First row

14. Select "Optimization" -> Disabled

This matches your Remix settings.

15. Enter the Solidity code exactly as in the Remix editor

You now have something like this:

Screenshot of half filled in form

Now we need the ABI code that represents your argument (the payout addresses).

16. In Remix, click the "Debug" button next to the contract creation code

img

17. Copy the 'Call data'

img

18. Now only copy the last part of that call data

Start from the zero's at the end. In example, you have:

0x6060604052341561000f57600080fd5b60405161050238038061050283398101604052808051820191905050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060019080519060200190610081929190610088565b5050610155565b828054828255906000526020600020908101928215610101579160200282015b828111156101005782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906100a8565b5b50905061010e9190610112565b5090565b61015291905b8082111561014e57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101610118565b5090565b90565b61039e806101646000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633feb5f2b1461013c57806341c0e1b51461019f575b6000806000803093508373ffffffffffffffffffffffffffffffffffffffff16319250662386f26fc100006001805490508481151561008757fe5b040391506702c68af0bb1400008210151561013657600090505b600180549050811015610135576001818154811015156100bd57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561012857600080fd5b80806001019150506100a1565b5b50505050005b341561014757600080fd5b61015d60048080359060200190919050506101b4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101aa57600080fd5b6101b26101f3565b005b6001818154811015156101c357fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561036c573093508373ffffffffffffffffffffffffffffffffffffffff16319250662386f26fc100006001805490508481151561028357fe5b040391506702c68af0bb1400008210151561033257600090505b600180549050811015610331576001818154811015156102b957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561032457600080fd5b808060010191505061029d565b5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b505050505600a165627a7a723058205d9ce0801b50ddf1e94d692b021f7bdfa6e57b7d780ff4c2f8c6b454359eb5ca002900000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000b38dc6a1a4de7ceb0ede9f2310df70dda8638e34

Then your ABI code (representation of constructor arguments) is:

00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000b38dc6a1a4de7ceb0ede9f2310df70dda8638e34

  1. In MEW, paste the ABI code

  2. Click the "Verify & Publish" button

img


If everything was correct you see the message: "Successfully generated ByteCode and ABI for Contract Address"

img


Hooray! Now you just deployed and verified the contract. On your contract page you now have an extra tab: "Source code". See https://ropsten.etherscan.io/address/0x1fd1476974679f30abd99b97a63c30e1137d2ddf for an example.

img

Now you can use this contract