Contract Verification
🏁 Prerequisites
Hemi RPC URL and deployed contract address.
Contract source code available (flattened only if verifying manually via the Hemi Blockscout UI).
🖥️ Blockscout UI Verification
Manual verification is performed directly through the Blockscout UI. This method requires flattening the contract source code and uploading it manually.
1. Flatten the contract
Flattening a contract is necessary when verifying through the UI.
For Hardhat:
For Foundry:
2. Access Hemi Blockscout
Go to Hemi Blockscout Explorer and navigate to the Verify & Publish Contract page.
3. Input contract information
Smart contract / Address
: Paste the address that your smart contract was deployed to.Contract license
: Select 'No License' unless otherwise specified.Verification method
: Choose Solidity (Flattened source code).Is Yul contract
: Leave unchecked unless your contract is written in Yul.Include nightly builds
: Select only if required.Compiler
: Choose the exact version specified inpragma solidity X.X.X
in your code.EVM Version
: Set to default unless you used a specific EVM version.Optimization enabled
: Deselect optimization.
Copy and paste the entire flattened contract code into the Contract code field and click 'Verify & publish'.
4. Submit for verification 🎉
Once all required details are entered, submit the form. BlockScout will compare the uploaded source code with the deployed bytecode. If they match, your contract will be verified.
To confirm verification, search for your contract address on BlockScout. A green check mark next to your contract indicates successful verification.
🚧 Hardhat Verification
1. Install dependencies
If you haven't already installed Hardhat and the verification plugin (adapted for Blockscout), run the following:
2. Configure Hardhat for Hemi
In your `hardhat.config.js
`, set up the Hemi network and include Blockscout API information for contract verification:
3. Verify the contract
Once deployed, you can verify the contract using Hardhat’s `verify
` command. Make sure to include any constructor arguments if necessary:
4. Verification successful! 🎉
If you encounter the following error, visit the Hemi Block Explorer and search your contract address to confirm verification:
Last updated