EVM Development
Verifying Contracts
Verify your smart contracts on MANTRA Chain block explorers
After deploying your contract, verify it on the block explorer to make the source code publicly available and enable users to interact with it.
Block Explorers
Testnet (DuKong)
- EVM Explorer: explorer.dukong.io
Mainnet
- EVM Explorer: blockscout.mantrascan.io
Using Hardhat
Hardhat Verify Plugin
Install the verification plugin:
npm install --save-dev @nomicfoundation/hardhat-verifyAdd to hardhat.config.js:
require("@nomicfoundation/hardhat-verify");
module.exports = {
// ... other config
etherscan: {
apiKey: {
mantra_testnet: "your-api-key", // Not always required
},
customChains: [
{
network: "mantra_testnet",
chainId: 5887,
urls: {
apiURL: "https://explorer.dukong.io/api",
browserURL: "https://explorer.dukong.io"
}
}
]
}
};Verify your contract:
npx hardhat verify --network mantra_testnet <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS>Using Foundry
Forge Verify
forge verify-contract <CONTRACT_ADDRESS> \
src/MyContract.sol:MyContract \
--chain-id 5887 \
--etherscan-api-key <API_KEY> \
--constructor-args <CONSTRUCTOR_ARGS>Manual Verification
- Go to the block explorer
- Navigate to your contract address
- Click "Verify and Publish"
- Fill in the verification form:
- Compiler version
- Optimization settings
- Source code
- Constructor arguments (if any)
Verification Requirements
- Contract source code
- Compiler version used
- Optimization settings
- Constructor arguments (if applicable)
- Contract address
Next Steps
- Learn about deploying contracts
- Explore EVM development
- Understand using precompiles