Verifying your contract on Etherscan
Including how to find the ABI parameters…
Let’s create a contract that has a constructor that requires parameters
Deploying this to Rinkeby from remix
Normally when we deploy a contract we want to verify it so that people can understand and trust the contract. If we look at the code tab on the contract, we can see code (in hex) and the ABI encoded constructor arguments.
Following the link to verify the contract…
Paste your contract in the code box, select the compiler version and optimisation flag…
You get those from remix when you deployed the contract…
You can then click the “I am not a robot button” and verify the contract.
As you have seen, Etherscan usually figures out the ABI encoded parameters for you, but occasionally it doesn’t happen and you need to figure them out.
You could have a look at the documentation or retain your sanity by doing it the easy way…
Going back to the contract deployment transaction Input data.
If you scroll down to the bottom, you will see (in this case at the end of the second row) the numbers 0029. The ABI encoded parameters are in the input data after the 0029.
Simply paste this into the constructor field on the code verification page and you are set to go.