Skip to content

feat: DAO treasury, seasonal leaderboard, DEX swap routing, circuit breaker rollback (#981, #985, #988, #989) - #1092

Merged
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
zainabbaba31-source:feature/zainabbaba31-source-defi
Aug 26, 2026
Merged

feat: DAO treasury, seasonal leaderboard, DEX swap routing, circuit breaker rollback (#981, #985, #988, #989)#1092
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
zainabbaba31-source:feature/zainabbaba31-source-defi

Conversation

@zainabbaba31-source

@zainabbaba31-source zainabbaba31-source commented Aug 26, 2026

Copy link
Copy Markdown

zainabbaba31-source - Governance & Trading Features

Issues Addressed

Closes #981 - DAO Treasury

  • Treasury deposit and withdrawal system
  • Proposal creation with amount and recipient
  • Voting mechanism (for/against)
  • Time-locked execution after deadline

Closes #985 - Seasonal Leaderboard

  • Season creation with start/end ledgers
  • Prize pool allocation
  • Win/loss/draw tracking
  • Points system (3 points per win)

Closes #988 - DEX Swap Routing

  • Route creation between token pairs
  • Fee calculation in basis points
  • Minimum output protection
  • Optimal route marking

Closes #989 - Circuit Breaker Rollback Vote

  • Community voting on pause/unpause
  • Configurable vote threshold
  • Automatic execution when threshold met
  • Prevents double-voting

Changes Made

Contracts

  • contracts/game_contract/src/lib.rs - Added all 4 features

Technical Details

DAO Proposal Flow

create_dao_proposal()vote_on_dao_proposal()execute_dao_proposal()

Season Points

points += 3; // Win
points += 0; // Loss
points += 1; // Draw

DEX Fee Calculation

fee = amount_in * fee_bips / 10000;
amount_out = amount_in - fee;

Circuit Breaker Execution

if votes_for >= threshold {
    if target_pause {
        env.storage().instance().set(&PAUSED, &true);
    } else {
        env.storage().instance().set(&PAUSED, &false);
    }
}

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@zainabbaba31-source Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chinweobtagaz
chinweobtagaz merged commit 1441c53 into OpenKnight-Foundation:main Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants