Labels: contracts, prize, priority: high
New Contract Location: contracts/prize-distribution/src/lib.rs
Description: Implements prize pool creation, escrow locking, and distribution for single or multiple winners. Integrates with Match contract and enforces atomic payouts.
Key Tasks:
- Define
PrizePoolwithpool_id,asset,amount_locked,match_id,weights. - Implement
create_pool(match_id, asset, amount)and lock funds. - Implement
distribute(pool_id, winners[], weights[])with weights sum validation. - Add dispute-aware hold/release integration with Match contract.
- Emit events:
pool_created,pool_locked,payout_executed,payout_held,payout_released.
Acceptance Criteria:
- Funds are locked before match finalization and released atomically on payout.
- Weighted multi-winner payouts succeed or revert in full.
- Payouts are blocked when a dispute is active and resume after resolution.
Labels: contracts, match, priority: high
New Contract Location: contracts/match-lifecycle/src/lib.rs
Description: Manages creation, participation, result submission, and finalization of matches with strict state transitions and authorization.
Key Tasks:
- Define
Matchwith statesCreated,InProgress,PendingResult,Finalized,Disputed. - Implement
create_match(players[], stake_asset, stake_amount). - Implement
submit_result(match_id, reporter, score)with dual-reporting checks. - Implement
finalize_match(match_id)guarded to participants/operators. - Emit events:
match_created,result_submitted,match_finalized.
Acceptance Criteria:
- Only participants or authorized operators can mutate match state.
- Invalid transitions are rejected with clear errors.
- Finalization produces a deterministic winner set consumed by Prize Distribution.
Labels: contracts, dispute, priority: critical
New Contract Location: contracts/dispute-resolution/src/lib.rs
Description: Handles dispute open/close, evidence references, adjudication by operators, and timeouts integrated with Match lifecycle.
Key Tasks:
- Implement
open_dispute(match_id, reason, evidence_ref). - Implement adjudication
resolve_dispute(match_id, decision)with role checks. - Enforce resolution deadline and emit audit events.
- Provide
is_disputed(match_id)API used by Prize Distribution.
Acceptance Criteria:
- Disputes prevent payouts until resolution is recorded.
- Operator-only adjudication is enforced; unauthorized calls fail.
- All decisions are logged with events and timestamps.
Labels: contracts, reputation, priority: medium
New Contract Location: contracts/reputation-index/src/lib.rs
Description: Tracks player fairness and skill with decay over time and updates based on finalized match outcomes.
Key Tasks:
- Define
Reputationwithskill,fair_play,last_update_ts. - Implement
update_on_match(match_id, players[], outcome)hook. - Implement decay
apply_decay(addr, now_ts)affecting both components. - Emit
reputation_changedevents with deltas.
Acceptance Criteria:
- Reputation updates only after match finalization.
- Decay applies consistently and is time-based.
- Events provide enough data for off-chain indexing.
Labels: contracts, oracle, priority: medium
New Contract Location: contracts/anti-cheat-oracle/src/lib.rs
Description: Accepts external anti-cheat confirmations and publishes bounded penalties to the Reputation Index.
Key Tasks:
- Define
EventType::AntiCheatFlagand confirmation structure. - Implement
submit_flag(player, match_id, severity)with oracle authorization. - Expose
get_confirmation(player, match_id)for consumers. - Integrate with Reputation to apply capped penalties.
Acceptance Criteria:
- Only authorized oracle addresses can submit flags.
- Reputation penalties are bounded and cannot underflow.
- Confirmations are queryable and auditable via events.
Labels: contracts, token, priority: high
New Contract Location: contracts/ax-token/src/lib.rs
Description: Implements mint, burn, and transfer with role-based controls and Soroban token semantics.
Key Tasks:
- Implement
mint(to, amount)andburn(from, amount)restricted to Admin. - Track balances and
total_supply. - Integrate with staking/payout contracts for transfers.
- Emit
transfer,mint,burnevents.
Acceptance Criteria:
- Supply accounting is consistent across all operations.
- Unauthorized mint/burn calls revert.
- Token integrates cleanly with staking and prize distribution.
Labels: contracts, staking, priority: medium
New Contract Location: contracts/staking-manager/src/lib.rs
Description: Handles staking AX to enter tournaments, lock periods, withdrawals, and slashing linked to dispute outcomes.
Key Tasks:
- Implement
stake(addr, tournament_id, amount)locking AX. - Implement
withdraw(addr, tournament_id)post-match conditions. - Implement
slash(addr, tournament_id, amount)authorized by dispute resolution. - Emit
staked,withdrawn,slashedevents.
Acceptance Criteria:
- Stakes are locked during active participation and unlock after match completion.
- Slashing only occurs upon authorized dispute decisions.
- Balance changes are consistent and evented.
Labels: contracts, registry, priority: medium
New Contract Location: contracts/contract-registry/src/lib.rs
Description: Registers and looks up contracts by name with admin-controlled updates and emits audit events.
Key Tasks:
- Implement
register_contract(name, address)with unique names. - Implement
update_contract(name, new_address)with admin-only guard. - Implement
get_contract(name)andlist_contracts(). - Emit
register,updateevents.
Acceptance Criteria:
- Registry prevents duplicate names and enforces authorization.
- Consumers can resolve addresses deterministically.
- Updates produce a clear on-chain audit trail.
Labels: contracts, auth, priority: medium
New Contract Location: contracts/auth-gateway/src/lib.rs
Description: Centralizes role assignment and caller verification used by other contracts to enforce Admin/Operator/Player access.
Key Tasks:
- Define roles and
assign_role(addr, role)APIs. - Implement
has_role(caller, role)andrequire_role(role)helpers. - Integrate with Match/Prize/Dispute via cross-contract checks.
- Emit role assignment/revocation events.
Acceptance Criteria:
- Role checks are reusable and consistent across contracts.
- Unauthorized callers are blocked with deterministic errors.
- Role changes are fully auditable.
Labels: contracts, escrow, priority: medium
New Contract Location: contracts/escrow-manager/src/lib.rs
Description: Manages prize escrow custody independent of distribution logic, enabling holds during disputes and safe transfers.
Key Tasks:
- Implement
deposit(match_id, asset, amount)and custody tracking. - Implement
hold(match_id)andrelease(match_id)integrations with Dispute module. - Implement
transfer(to, asset, amount)used by Prize Distribution. - Emit
deposited,held,released,transferredevents.
Acceptance Criteria:
- Escrow custody is isolated and robust during disputes.
- Transfers only occur when holds are cleared.
- Event log provides full traceability of funds.