This video demonstrates how to verify and publish your solidity source code on [ Ссылка ].
In this demo i will be using the Etherscan Verify Contract Code version 2.0 on the Rinkeby test network.
To verify and publish your solidity source code on Etherscan you need:
- Contract address
- Contract name
- Compiler version used. See also : [ Ссылка ]
- Optimization enabled/disabled
- Solidity contract code
- Runs (Optimizer) value
- Constructor arguments ABI-encoded
The solidity compiler has the following flags:
solc —optimize —optimize-runs 200
The meaning of these flags:
optimize: Enable bytecode optimizer.
optimize-runs: Estimated number of contract runs for optimizer tuning. If not specified defaults to 200.
Before you deploy your contract enable the bytecode optimizer.
It will optimize the bytecode thus using less gas and saving you money.
Remix IDE uses the default optimize-runs value of 200.
The constructor arguments must ABI-encoded.
ABI stands for Application Binary Interface format.
How the constructor arguments are converted into ABI format is explained in the Ethereum Contract ABI specification.
I have already deployed smart contracts demonstrated in an earlier YouTube video “Compile and deploy solidity code”:
[ Ссылка ]
In this video i will use these previously deployed smart contracts and will verify and publish these smart contacts using the Etherscan Verify Contract Code version 2.0 on the Rinkeby test network:
Demonstration 1:
Contract deployed using Remix IDE
Contract address: 0xF943c4db517A12a47e57B8A3fcDfD9FFc1bde036
Contract name: Demo
Compiler version used: v0.4.14
Optimization: enabled
Solidity contract code:
[ Ссылка ]
Constructor arguments ABI-encoded [(uint) 10, (string) Hello]:
000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000548656c6c6f000000000000000000000000000000000000000000000000000000
Demonstration 2:
Contract deployed using Truffle
Contract address: 0x6b78D667309D681D596476b70F2F20998bD3c093
Contract name: Demo
Compiler version used: v0.4.13. (Truffle version 3.4.7)
Optimization: enabled
Solidity contract code:
[ Ссылка ]
Constructor arguments ABI-encoded [(uint) 10, (string) Hello]:
000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000548656c6c6f000000000000000000000000000000000000000000000000000000
Check out all my other Ethereum related tutorial videos
[ Ссылка ]
Subscribe to my YouTube channel:
[ Ссылка ]
The presentation used in this video tutorial can be found at:
[ Ссылка ]
Etherscan Verify Contract Code version 2.0 on the Rinkeby test network:
[ Ссылка ]
The online Remix IDE:
[ Ссылка ]
Ethereum Contract ABI specification
[ Ссылка ]
The node.js script to encode constructor arguments into ABI format:
[ Ссылка ]
The deployed smart contract:
[ Ссылка ]
Other Ethereum tools:
[ Ссылка ]
Truffle home page:
[ Ссылка ]
The Truffle github:
[ Ссылка ]
Truffle has enabled its bytecode optimizer:
[ Ссылка ]
#mobilefish #howto #ethereum
Etherscan contract source code verification
Теги
etherscan contract source code verificationverify contract codehow to verify contract code on etherscantrouble verifying contract on etherscanverifying source code on etherscanverify and publish your solidity source codecontract with verified source codeconstructor arguments abi encodedarguments abi encodedconstructor into abi formatethereum contract abiencoder ethereum abiencoder constructor argumentscreate abi encoded constructorcontract verification