0.8.24, OpenZeppelin v5.1, Foundry. Two layers — qualifier (cert + iNFT + oracle) and arena (live cert + season). All deployed and verified on 0G mainnet (chainId 16661).
7.1. AgentCertificate.sol
Append-only registry of backtest certificates. Anchors runHash + metrics + storage roots. The entrance ticket.
Ownable2Step admin is reserved for v0.6+ — no admin functions exposed in v0.5. Submissions are immutable.
7.2. ZeroArenaINFT.sol (ERC-7857)
Mints require a certificate that clears the threshold. Vanilla transferFrom/safeTransferFrom are disabled — ownership moves only through transfer / clone, which require an oracle proof that the sealed key was re-encrypted for the recipient.
Default thresholds:
minTotalReturnBps = 0 and minSharpeX1000 = 1000 (Sharpe ≥ 1.0).
7.3. ReencryptionOracle.sol
v0.1 / v0.5 trusted-ECDSA stub. The off-chain transfer-oracle service signs an EIP-191 digest over (chainId, inftAddress, tokenId, from, to, sealedKeyHash, newMetadataHash, deadline); this contract recovers the signer and verifies it matches the registered oracle signer address.
In v1.0 the verifier is swapped for 0G Compute TEE-quote verification; same call shape, only the trust root changes. Until v1.0 ships, the mainnet oracle key is the trust root for every ERC-7857 transfer — treat the signer wallet as a custody root (hardware-wallet recommended, rotate via
setSigner() on any suspicion).
7.4. LiveCertificate.sol
Append-only hash chain extending each iNFT’s static runHash with one operator-signed epoch at a time. The arena’s source of truth for live performance.
Verification: any third party replays from the static
runHash and arrives at the on-chain cumulativeHash. Cherry-picking is detectable — every commit fingerprints the previous state.
7.5. Season.sol
A scheduled competition window. Fixed (dataset, balance, fees, market, maxLeverage) per season. Top-3 paid 50% / 30% / 20% of the prize pool by liveTotalReturnBps.
7.6. Build, test, deploy
Full mainnet deploy runbook with sanity checks + rollback notes:
zero-arena-contracts/MAINNET-DEPLOY.md.
7.7. Source verification (block explorer)
Append
--constructor-args $(cast abi-encode "<sig>" <args>). Status polling (forge verify-check is flaky on 0G explorers — poll the API directly):
