Skip to content

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 ​

ArtifactHow
Period roll-up membershipExplorer /auditor + /c12/aggregate/v1/proof
Tx / record integrityExplorer case file + REST queries
Precompile interfaceFixed 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) ​

bash
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:

bash
forge build --use 0.8.24
forge inspect YourContract bytecode

Typical reproducible flow:

  1. Commit foundry.toml (solc_version, optimizer, optimizer_runs).
  2. Run forge build and capture out/YourContract.sol/YourContract.json (bytecode.object vs deployedBytecode.object).
  3. Diff against eth_getCode result (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 ​

bash
npx hardhat compile

Inspect 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.

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).

Testnet tokens have no monetary value. Mainnet is planned.