← Back to Verify
Verify from the command line
This explorer accepts contract verifications through an Etherscan-compatible API, so
hardhat verify and forge verify-contract work against XPLA without a web form. Point your tool at the values below and verify as part of your deploy script or CI.Network settings
- API URL
<this explorer>/api/mainnet/verify/etherscan- Chain ID
37- RPC URL
https://dimension-evm-rpc.xpla.dev- API key
- Not required. Any non-empty value is accepted and ignored — Hardhat refuses to run without one, so the examples pass a placeholder.
1. Install
Verified against hardhat 3.x with @nomicfoundation/hardhat-verify 3.x.
npm i -D hardhat @nomicfoundation/hardhat-verify2. Configure
hardhat.config.ts — Hardhat 3 with @nomicfoundation/hardhat-verify@^3
import hardhatVerify from "@nomicfoundation/hardhat-verify";
export default {
plugins: [hardhatVerify],
networks: {
"xpla": {
type: "http",
url: "https://dimension-evm-rpc.xpla.dev",
chainId: 37,
accounts: [process.env.PRIVATE_KEY!],
},
},
// Hardhat 3 replaced customChains with chainDescriptors.
chainDescriptors: {
37: {
name: "XPLA",
blockExplorers: {
etherscan: {
name: "XPLA Explorer",
url: "",
apiUrl: "",
},
},
},
},
verify: {
etherscan: { apiKey: "xpla" }, // any non-empty value; it is ignored
// 'hardhat verify' runs every enabled provider in turn, and the other two
// would submit to sourcify.dev and blockscout, which do not know this chain.
sourcify: { enabled: false },
blockscout: { enabled: false },
},
};3. Verify
Run it after deploying. Verification usually finishes in under a minute; the tool polls until it does.
npx hardhat verify --network xpla <ADDRESS> "<CONSTRUCTOR_ARG>"Before you rely on this
- What "Verified" means here. This explorer compiles the source you submit and compares the runtime bytecode against what is deployed. Constructor arguments are accepted but are not part of that comparison, so a verification can succeed with arguments that differ from the ones used at deployment. Library addresses and immutable values are masked rather than checked. It is a weaker claim than an exact match of the deployment transaction.
- Hardhat and Foundry are third-party tools. They are not maintained by or affiliated with XPLA, and their names belong to their respective owners. These snippets are examples written against the versions named above; a later release may change its configuration format without notice.
- Keep your private key out of your repository. The examples read it from an environment variable for that reason. Verification itself never needs a key — only deployment does.
- Anyone can verify any contract. Publishing source is not a claim of ownership and grants no control, and this explorer does not ask you to prove you deployed it.
