7

When I enter all the information about a contract, the system displays the error:

Error! Invalid constructor arguments provided. Please verify that they are in ABI-encoded format

I fill in the following fields

Contract address: 0xa4DE910F252c38fcEC811075e532d4644cB86F58
Contract name: SOCTokenSale
Compiler: 0.4.12 (2017.06.20)
Optimization: Enabled
Contract gist: https://gist.github.com/dmitry-nosov/a3c5c90ec82b518c438ab4aa4177d8a4
Constructor arguments:
0x60606040526007805460ff1990811690915568015af1d78b58c40000600855600980549091169055341561002f57fe5b60405160a0806106e683398101604090815281516020830151918301516060840151608090940151919390915b60008054600160a060020a031916600160a060020a038716179055670de0b6b3a7640000848102600155603c84024201600355829081151561009a57fe5b0460045560058054600160a060020a031916600160a060020a0383161790555b50505050505b610617806100cf6000396000f300606060405236156100a15763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301cb3b2081146101b257806329dcb0cf146101c457806338af3eed146101e65780636e66f6e91461021257806370a082311461023e5780637a3a0e841461026c5780637b3e5e7b1461028e578063835fc6ca146102b0578063a035b1fe146102c5578063fd6b7ef8146102e7575b6101b05b60095460009060ff16156100b95760006000fd5b50600160a060020a03338181166000908152600660205260409020349081905560028054820190556005546004549193169163a9059cbb91848115156100fb57fe5b046040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b151561016357fe5b6102c65a03f1151561017157fe5b505060408051600160a060020a03331681526020810184905260018183015290516000805160206105cc83398151915292509081900360600190a15b50565b005b34156101ba57fe5b6101b06102f9565b005b34156101cc57fe5b6101d4610378565b60408051918252519081900360200190f35b34156101ee57fe5b6101f661037e565b60408051600160a060020a039092168252519081900360200190f35b341561021a57fe5b6101f661038d565b60408051600160a060020a039092168252519081900360200190f35b341561024657fe5b6101d4600160a060020a036004351661039c565b60408051918252519081900360200190f35b341561027457fe5b6101d46103ae565b60408051918252519081900360200190f35b341561029657fe5b6101d46103b4565b60408051918252519081900360200190f35b34156102b857fe5b6101b06004356103ba565b005b34156102cd57fe5b6101d4610453565b60408051918252519081900360200190f35b34156102ef57fe5b6101b0610459565b005b60035442106103745760015460025410610366576007805460ff1916600117905560005460025460408051600160a060020a039093168352602083019190915280517fec3f991caf7857d61663fd1bba1739e04abd4781238508cde554bb849d790c859281900390910190a15b6009805460ff191660011790555b5b5b565b60035481565b600054600160a060020a031681565b600554600160a060020a031681565b60066020526000908152604090205481565b60015481565b60025481565b60005433600160a060020a03908116911614156101ad5760008054604051600160a060020a039091169166038d7ea4c68000840280156108fc02929091818181858888f19350505050156101ad576000805460408051600160a060020a03909216825266038d7ea4c68000840260208301528181019290925290516000805160206105cc8339815191529181900360600190a15b5b5b50565b60045481565b60035460009042106101ad57600854600254101561051a5750600160a060020a03331660009081526006602052604081208054908290559081111561051a57604051600160a060020a0333169082156108fc029083906000818181858888f19350505050156104fe5760408051600160a060020a03331681526020810183905260008183015290516000805160206105cc8339815191529181900360600190a161051a565b600160a060020a03331660009081526006602052604090208190555b5b5b60075460ff16801561053c575060005433600160a060020a039081169116145b156101ad5760008054604051600160a060020a0391821692309092163180156108fc0292909190818181858888f19350505050156105b9576000805460408051600160a060020a039283168152309092163160208301528181019290925290516000805160206105cc8339815191529181900360600190a16101ad565b6007805460ff191690555b5b5b5b5b505600e842aea7a5f1b01049d752008c53c52890b1a6daf660cf39e8eec506112bbdf6a165627a7a723058209efb7242b2d951aef3589fbbb1d9eae4dc9b51c96a7bbfab09b6c79f13a9e2e800290000000000000000000000007393ab0b22d6b9413a83928a9719f13f5129397e0000000000000000000000000000000000000000000000000000000000000dac000000000000000000000000000000000000000000000000000000000000e07800000000000000000000000000000000000000000000000000000000000008f0000000000000000000000000d57005812e98fcea06cc64bfff98ff458ff5b1eb

I used this system to compile the contract:

Etherium Wallet: 0.8.10 (win 64)

Geth: 
Version: 1.6.5-stable
Git Commit: cf87713dd42162861b7ed227f79f0638a33571df
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.8.3

Transaction which created the contract: https://etherscan.io/tx/0x45ef70a9e1b21cb54d2a1ff95379bed208ce537d5389e75344b46bfcca159efa

Can you please explain how to verify this contract? Thanks!

4

You need to correctly ABI-encode your constructor parameters. You can easily do this with online tool https://abi.hashex.org. Just paste in your abi to auto-parse constructor parameters or manually add them and enter values. ABI-encoded constructor parameters would be automatically calculated. Just copy them and paste in etherscan.io constructor parameters input.

enter image description here

  • 1
    Although this tool did not work for my ABI to parse (Or may be I was making mistake). But worked by putting constructor arguments. Very nice tool! – Yogesh - EtherAuthority.io Jan 4 at 9:45
1

You are passing in the entire bytecode, when it only wants the ABI-encoded arguments, which in your case appear to be

0000000000000000000000007393ab0b22d6b9413a83928a9719f13f5129397e0000000000000000000000000000000000000000000000000000000000000dac000000000000000000000000000000000000000000000000000000000000e07800000000000000000000000000000000000000000000000000000000000008f0000000000000000000000000d57005812e98fcea06cc64bfff98ff458ff5b1eb
  • Could you please explain how to? – NineCattoRules Sep 20 '17 at 9:24
  • I provided why explanation below. – LampShade Mar 14 '18 at 16:42
0

You can find the ABI encoded constructor arguments by simply checking the difference between the encoded unlinked binary of your contract and the encoded transaction arguments of the transaction that created the contract. This is probably what @Tjaden Hess did, without explaining.

From: https://blog.de-swaef.eu/verify-truffle-contracts-on-etherscan/

If you can't figure out your ABI-encoded constructor arguments, first look at the encoded unlinked binary of your contract, then look at the encoded transaction-arguments of the transaction that created your contract. If your contract was deployed with constructor arguments, they should have been appended to the transaction data. So the difference between the two will be the ABI-encoded constructor arguments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.