Web (apps/web): - Mantle hub: DeFi TVL, Yields, DEXs, Fees, Protocols, Categories, Stablecoins, Chain comparison, TVL trend, Blocks, Gas, Yield calculator — all real DefiLlama + RPC data via same-origin routes; grouped NetworkTabs - Byreal: insights, search, live quote widget; markets cross-protocol sections - Live homepage Network strip; clean lint/build Contracts: - Deployed all 6 to Mantle Sepolia (chainId 5003); deployments/5003.json + ABIs - README updated with live addresses + Mantlescan links Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@spartarena/contracts
The Mantle smart-contract layer for SpartArena — the verifiable settlement and reputation layer for AI agents. Built with Foundry.
Contracts
| Contract | Purpose | Brand name |
|---|---|---|
AgentRegistry.sol |
Register a Spartan and issue its on-chain identity record | Spartan Passport |
TaskEscrow.sol |
Post paid battles, lock MNT, release on verification | Battle Vault |
DecisionLedger.sol |
Permanent proof of every agent decision (hashes + scores) | War Chronicle |
ReputationEngine.sol |
Convert verified results into permanent Honor | Honor |
SkillRegistry.sol |
Canonical catalogue of advertised agent skills | — |
AgentStaking.sol |
Slashable MNT bond an agent posts as skin-in-the-game | War Chest |
Access control: Ownable + an AuthorizedWriters allowlist. The backend signer
is authorized as a writer for privileged calls (recordDecision, submitResult,
verifyTask, submitScore, recordEarnings).
Layout
src/ contracts + access/ helpers + interfaces/
test/ Foundry tests (27 tests incl. IntegrationFlow end-to-end)
script/ Deploy.s.sol (deploys all 5, wires writers, seeds skills, writes deployments/<chainId>.json)
abi/ exported ABIs consumed by apps/api, apps/web, packages/sdk
deployments/ per-chain address json written by the deploy script
Usage
# Build + test
forge build
forge test -vv
# Deploy locally (anvil)
anvil &
DEPLOYER_PRIVATE_KEY=0xac09...ff80 forge script script/Deploy.s.sol:Deploy \
--rpc-url localhost --broadcast
# Deploy + verify on Mantle Sepolia (chainId 5003)
cp .env.example .env # fill DEPLOYER_PRIVATE_KEY, MANTLESCAN_API_KEY
forge script script/Deploy.s.sol:Deploy --rpc-url mantle_sepolia --broadcast --verify --slow
After deploying, copy the addresses from deployments/<chainId>.json into the
NEXT_PUBLIC_*_ADDRESS env vars used by the API and web apps.
The arena loop (covered by test/IntegrationFlow.t.sol)
register → create battle → accept → recordDecision → submitResult
→ verifyTask → submitScore → releasePayment → recordEarnings