Verifying contracts
Explorer support today
The Carbon12 explorer does not implement EVM contract verification (no Sourcify, Hardhat verify, or Etherscan-style upload flows in source). Repository-wide search shows “verify” UX refers to attestation checking (packages/flows/src/verify.tsx) and Merkle membership for roll-ups — not Solidity bytecode publishing.
Status: explorer-based contract verification is not yet supported.
Planned: bytecode verification in the explorer UI (similar to other Cosmos EVM explorers). Track Carbon12-Chain/explorer releases.
What you can verify today
| Artifact | How |
|---|---|
| Period roll-up membership | Explorer /auditor + /c12/aggregate/v1/proof |
| Tx / record integrity | Explorer case file + REST queries |
| Precompile interface | Fixed address 0x…0C12 — compare ABI to precompiles/c12/IC12.sol |
Manual / reproducible verification (bytecode)
Until explorer verification ships, compare on-chain runtime bytecode to a reproducible local build using standard compiler JSON input.
1. Read deployed code (eth_getCode)
cast code 0xYourContract --rpc-url https://evm.testnet.carbon12.network
# or
curl -s https://evm.testnet.carbon12.network \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xYourContract","latest"],"id":1}' \
| jq -r '.result'Strip the 0x prefix and compare runtime bytecode (not necessarily identical metadata hashes unless you pin metadata settings).
2. Foundry — standard JSON input
Build with pinned solc and export standard JSON:
forge build --use 0.8.24
forge inspect YourContract bytecodeTypical reproducible flow:
- Commit
foundry.toml(solc_version,optimizer,optimizer_runs). - Run
forge buildand captureout/YourContract.sol/YourContract.json(bytecode.objectvsdeployedBytecode.object). - Diff against
eth_getCoderesult (normalize lowercase; account for immutables/constructor args if using a proxy).
Reproduce with Solidity standard JSON input via solc --standard-json using the same sources + settings as your build (Foundry stores inputs under out/ / cache/; Hardhat stores them in artifacts/build-info/*.json).
3. Hardhat — standard JSON input
npx hardhat compileInspect artifacts/build-info/*.json for input (sources + settings) and output deployedBytecode. Re-run the same solc version/settings locally and compare to eth_getCode.
Publish in your repo: compiler version, optimizer runs, contract path, and git commit hash.
4. CI artifact (recommended)
Store { address, chainId, bytecodeHash, buildInfoHash, commit } from deployment CI so third parties can replay the build.
Foundry tests for the IC12 precompile pattern live in precompiles/c12/foundry/ (chain repo).