Climb is an on-chain Elo engine with fast convergence, anti-smurf heuristics, and an optional Pro Mode staking layer—designed for environments where you can record every match, not just summaries.
- Foundry: https://book.getfoundry.sh/
- Node (for front-end signing), optional
# install foundry
curl -L https://foundry.paradigm.xyz | bash
foundryupforge build
forge test -vv
forge test --gas-reportYou’ll see unit + edge-case + signature path tests in test/EloLeague.t.sol and additional fuzz/invariant suites if you add the optional files suggested below.
forge fmtYep—you don’t need a client lib if you’re happy with the oracle path.
-
Allowlist your game + oracle:
league.setGame(gameAddress, true); league.setOracle(myOracle, true);
-
From the oracle (or an allowlisted game contract), call:
ClimbEloLeague.Match memory m = ClimbEloLeague.Match({ game: gameAddress, playerA: A, playerB: B, scoreA: 2, scoreB: 0, playedAt: uint64(block.timestamp), nonceA: league.nonces(A), nonceB: league.nonces(B) }); league.submitMatch(m, "", ""); // no sigs needed
Only if you want P2P signatures (EOA/1271) or a tiny utility to build the digest client-side. For pure oracle flows, skip it.
Trade-off: Oracle = simplest integration but trusted submitter; P2P = trust-minimized but you’ll collect two EIP-712 sigs.
Create a env
echo "DEPLOYER_PK=0xabc123..." > .env
echo "RPC_URL=https://your-rpc" >> .env
echo "OWNER=0xYourOwnerSafe" >> .env
echo "ORACLE=0xYourOracle" >> .env
echo "MIN_PRO_STAKE=100000000000000000" >> .env
echo "WITHDRAW_DELAY=86400" >> .envforge script script/Deploy.s.sol:Deploy \
--rpc-url $RPC_URL \
--broadcast \
--slow \
--via-ir
forge test -vv
forge test --ffi --gas-reportforge snapshot # produces .gas-snapshotMIT. See LICENSE.