contracts
Verify and publish
Upload the source of a contract on Elysium. We compile it with the official solc build and compare the result with the code on chain. A match publishes the source, the ABI and the read and write tabs for everyone.
from forge
forge verify-contract 0x3ae18cb2e65367cde237a6188bddf10beed77d1a src/Token.sol:Token \ --chain 99901 \ --verifier etherscan \ --verifier-url https://elysiumexplore.com/api \ --etherscan-api-key opsis \ --watch
Any API key works. Use the compiler version and optimizer runs from your foundry.toml.
from hardhat
// hardhat.config: etherscan and the Elysium network
etherscan: {
apiKey: { elysium: "opsis" },
customChains: [{
network: "elysium",
chainId: 99901,
urls: { apiURL: "https://elysiumexplore.com/api", browserURL: "https://elysiumexplore.com" },
}],
},Then npx hardhat verify --network elysium with the address.
how matching works
- Only the runtime code is compared. Immutable values and linked library addresses are read from the chain first.
- Full match: the metadata hash at the end is equal too. Partial match: same code, but comments or file paths differ.
- Contracts with the same code (every pool of a factory, every token of a launchpad) show the verified source automatically.
- Proxies get read and write tabs through their implementation once that is verified.
- Each job compiles alone with a time limit of two minutes. The source stays public on this site and through module=contract&action=getsourcecode.