Smart Contract Verification

A quick guide on how to verify your contracts on Harmony.
Right now, we support verification only for one single solidity file - therefore, before deployment and verification, you will need to flatten all solidity sources to one file.

1. Flatten your solidity files (only for multiple files)

To flatten your solidity files we recommended to use
npm install truffle-flattener -g
truffle-flattener <solidity-files>
Or you can use any other flattener lib

2. Deploy contract to Harmony

To more easy verification we recommend to deploy contract with Harmony Remix

3. Verify contract

You can verify your contract here
Important to use correct params (the same like on deploy):
  • Contract address
  • Contract name
  • Compiler version
  • Optimizer
  • Chain Type (mainnet or testnet)
  • Sources
  • Imported libs
Then click Submit button
If all parameters are correct - you should to see Success message, or Error if bytecodes don't equal
On Success case - you contract will verify and you will see all contract details on contract explorer page

4. Verify contract with constructor arguments (for contracts that were created with constructor parameters)

To get ABI-encoded constructor arguments you can ue this service:
Example for Harmony Remix:
1 - click ABI to copy it
2 - paste ABI to form and click parse
3 - paste your constuctor arguments and click Copy
4 - paste encoded constructor arguments to verify form field
Last modified 1yr ago