Verify a smart contract on Monad Explorer using Foundry
note
Currently, the RPC and block explorer are not public; this page will be updated as soon as they are.
We appreciate your patience.
- Foundry Monad template (Recommended)
- Default Foundry Project
If you are using foundry-monad
template, you can simply run the below command:
forge verify-contract <contract_address> <contract_name>
Example:
forge verify-contract 0x195B9401D1BF64D4D4FFbEecD10aE8c41bEBA453 src/Counter.sol:Counter
tip
If you use foundry-monad
you can skip the configuration step
1. Update foundry.toml
with Monad Configuration
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
# Monad Configuration
# TODO: Add RPC URL and Chain ID
eth-rpc-url="MONAD_RPC_URL"
chain_id = "MONAD_CHAIN_ID"
# TODO: Add Explorer URL and Chain ID
[etherscan]
monadDevnet = { key = "DUMMY_VALUE", url = "EXPLORER_URL", chain = MONAD_CHAIN_ID }
2. Verify the contract using the command below:
forge verify-contract <contract_address> <contract_name>
Example:
forge verify-contract 0x195B9401D1BF64D4D4FFbEecD10aE8c41bEBA453 src/Counter.sol:Counter
On successful verification of smart contract, you should get a similar output in your terminal:
Start verifying contract `0x1355a4f7829161a4d27BDb8970D32b89ef89A1Be`
Submitting verification for [src/Counter.sol:Counter] 0x1355a4f7829161a4d27BDb8970D32b89ef89A1Be.
Submitted contract for verification:
Response: `OK`
GUID: `1355a4f7829161a4d27bdb8970d32b89ef89a1be67448d78`