Deploying smart contracts
C12 testnet EVM uses chain id 12121. Gas is paid in the mapped native denom (uc12 / ac12 extended representation in genesis). The IC12 precompile is not deployed — it is a static native address for read-only calls.
Foundry
precompiles/c12/foundry/foundry.toml (chain repo):
[profile.default]
solc_version = "0.8.24"
optimizer = false
[rpc_endpoints]
devnet = "http://127.0.0.1:8545"Add testnet endpoint:
[rpc_endpoints]
c12_testnet = "https://evm.testnet.carbon12.network"Deploy:
forge create src/MyContract.sol:MyContract \
--rpc-url https://evm.testnet.carbon12.network \
--private-key $DEPLOYER_KEY \
--chain-id 12121Hardhat
hardhat.config.ts (minimal):
import { HardhatUserConfig } from "hardhat/config";
const config: HardhatUserConfig = {
solidity: "0.8.24",
networks: {
c12_testnet: {
url: "https://evm.testnet.carbon12.network",
chainId: 12121,
accounts: process.env.DEPLOYER_KEY ? [process.env.DEPLOYER_KEY] : [],
},
},
};
export default config;Interact with deployed contracts
Use ethers/viem with the testnet RPC. For native record reads, call the precompile interface — no constructor deployment.
import "./IC12.sol";
contract Reader {
IC12 constant C12 = IC12(0x0000000000000000000000000000000000000C12);
function head(string calldata eventId) external view returns (string memory, uint8, uint32) {
return C12.head(eventId);
}
}Interface source: precompiles/c12/IC12.sol.
Precompile gas (fixed)
From precompiles/c12/precompile.go / ADR-0015:
| Method | Gas |
|---|---|
head | 3000 |
record, aggregate | 10000 |
claimState, checkingState | 3000 |
reputation | 2000 |
Reading native records from EVM
Supported via IC12 only:
record(recordId)→ protobuf-encoded bytesaggregate(domain, subject, periodType, periodStart)→ protobuf-encoded roll-upcheckingState(recordId),claimState(eventId, purposeId),reputation(participantId, role)
There is no generic write precompile — writes remain Cosmos Msg* transactions.
Fees & gas
- Comet
minimum-gas-prices:0.001uc12on new nodes - EVM module uses cosmos-evm + feemarket — effective gas price follows node
app.toml/ feemarket params
Fund deployer keys via faucet (testnet only, no monetary value).
Verification
Explorer bytecode verification is not yet available — see Verifying contracts.