Documentation Menu
Smart Contract
The WagerEscrow contract handles all funds, settlement, and collateral logic on-chain. It is verified and open-source.
Addresses
WagerEscrow Contract
0xe2fface6275e68dbed1e0340af2adfc036314559WF Token (ERC-20)
0x03affAE7E23fd11c85d0C90cc40510994d49E175Burn Address
0x000000000000000000000000000000000000dEaDChain ID
2020 (Ronin Mainnet)Verification
Core Functions
| Function | Description |
|---|---|
| createWager(lobbyCode, betAmount) | Create a new wager with a lobby code and bet amount. Deposits 3x bet from caller. |
| joinWager(wagerId) | Join an existing wager by depositing the same 3x amount. Activates the wager. |
| reportResult(wagerId, backendSig) | Report your loss (loser only). Requires a backend-signed REPORT_LOSS message. Settles the wager immediately. |
| claimVictory(wagerId, backendSig) | Claim victory after 48h if opponent hasn't reported. Burns their collateral. |
| cancelWager(wagerId) | Cancel a wager before an opponent joins. Returns full deposit to creator. |
| withdraw() | Withdraw any pending balance (winnings, refunds) to your wallet. |
View Functions
| Function | Description |
|---|---|
| getWager(wagerId) | Returns full wager state: players, amounts, status, results. |
| calculateDeposit(betAmount) | Returns the total deposit and collateral amounts for a given bet. |
| checkApproval(user, betAmount) | Checks if a user has approved enough tokens for the given bet. |
| canClaimVictory(wagerId) | Returns true if the caller can claim victory (48h timeout passed). |
Security
Backend Signature Verification
Loss reports require a backend-signed message. The backend verifies the reporter is a wager participant and the wager is in the correct state before signing. This prevents unauthorized or fake result submissions.
Admin-Gated AFK Claims
Victory claims (when opponent is AFK after 48h) are not auto-signed. They go through an admin review process. Admins examine screenshot evidence before approving and generating the claim signature. This prevents abuse of the AFK claim system.
On-Chain State Machine
The contract enforces a strict state machine: Created → Active → Settled/Cancelled. Each transition has preconditions that prevent invalid operations. Funds can only move according to the rules.
