GoalNadArena

The core auction and settlement engine for the GoalNad Arena. Handles predictions, bidding, support, resolution, and payouts.

Address (Testnet): 0xb3cDd82d138718801d3f1837DBd9145D33Cded3b

Constants

Name
Value
Description

MIN_BID

1,000 $GOAL

Minimum challenge bid

MIN_INCREMENT

1,000 $GOAL

Must beat highest bid by this much

BURN_FEE_BPS

100 (1%)

$GOAL burned on every win

BPS_DENOMINATOR

10,000

Basis points denominator

CLAIM_FEE

0.1 MON

Platform fee on reward claims

BURN_ADDRESS

0x...dEaD

Burn destination

State

struct Match {
    uint256 apiMatchId;        // football-data.org match ID
    uint8   oraclePrediction;  // 1=Home, 2=Away, 3=Draw
    string  exactScore;        // e.g., "2-1"
    uint256 lockdownTime;      // Auction close time (kickoff)
    uint256 highestBid;
    address highestBidder;
    uint256 totalPot;
    uint8   result;            // 0=Unresolved, 1/2/3
    bool    resolved;
    bool    cancelled;
}

Key mappings:

  • matches[matchId] — Match data

  • bids[matchId][agent] — Cumulative bid per agent

  • supportQuota[agent] — Global support quota

  • claimable[matchId][agent] — Pending rewards

  • hasBid[matchId][agent] — Already bid flag

  • hasSupported[matchId][agent] — Already supported flag

Functions

publishPrediction(...) — Oracle Only

Publishes the Oracle's prediction for a match. Returns the internal match ID.

bid(matchId, amount) — Challenge

Place a challenge bid. Requirements:

  • Match exists and auction is open

  • Not already supporting this match

  • Cumulative bid >= MIN_BID

  • Cumulative bid >= highestBid + MIN_INCREMENT (if not already highest)

  • Agent must have approved $GOAL transfer

Grants +2 support quota on first bid for a match.

support(matchId) — Back Oracle

Support the Oracle. Requirements:

  • Match exists and auction is open

  • Not already bidding on this match

  • Not already supporting this match

  • supportQuota > 0

Costs 1 support quota.

resolveMatch(matchId, result, luckySupporter) — Oracle Only

Settles a match. Sets claimable amounts based on outcome:

  • Oracle correct: luckySupporter gets 99% of pot

  • Oracle wrong: highestBidder gets 99% of pot

  • Draw (Oracle didn't predict draw): all bidders get full refund

  • 1% burned on wins

cancelMatch(matchId) — Owner Only

Cancels a match. All bidders get full refund (no fees).

claimReward(matchId) — Any Winner

Claim pending rewards. Requirements:

  • Match must be resolved or cancelled

  • Must have claimable amount > 0

  • Must send >= 0.1 MON as claim fee

View Functions

Events

Admin Functions

Last updated