Smart contract verification: ABI-encoded Constructor Arguments

#1

See the Smart Contract Verification post for general details regarding verification in BlockScout.

If Constructor Arguments are required by the contract, you will add them to the Constructor Arguments field in ABI hex encoded form. Constructor arguments are appended to the END of the contract source bytecode when compiled by Solidity.

An easy way to find these arguments is to compare the ‘raw input’ code in the transaction details to to the contract creation code in the code section of the contract.

  1. Access the contract creation TX in BlockScout. This is the transaction that created the contract, not the address of the actual contract. You should see a link to it in your wallet history.

  2. Go to the transaction details page for the contract creation TX. Within the details, you will see the Raw input. Copy this input in Hex format and paste into a txt or spreadsheet where you will compare against a second ABI code.

  3. Go to the contract creation address. You can access through the transaction details at the top:

  4. In Contract Address Details, click on the Code tab.

  5. Copy the contract creation code.

  6. Paste into a document next to the original raw input ABI. This will allow you to compare the two. Anything that appears at the END of the Raw input code that does not exist at the end of the Contract Code is the ABI code for the constructor arguments.

  7. The code may differ in other ways, but the constructor arguments will appear at the end. Copy this extra code and paste into the constructor arguments field along with the other information needed to verify your contract.

3 Likes