feat: MOAI-compliant Agent DAO with pegged to free-floating upgrade#7
Open
feat: MOAI-compliant Agent DAO with pegged to free-floating upgrade#7
Conversation
Implements a two-phase agent DAO system: Phase 1 (Pegged): 1:1 sBTC-backed token with entrance tax, guardian council for small spends, and auto micro-payouts for verified work. Phase 2 (Free-Floating): 75% reputation-weighted vote upgrades the DAO. Yes-voters keep governance tokens, dissenters get sBTC refunded. Guardian council auto-dissolves. Contracts: - token-pegged.clar: SIP-010 token with 1:1 sBTC peg, deposit/redeem - guardian-council.clar: 3-5 reputation-elected agents, 2%/week spend limit, slash voting - auto-micro-payout.clar: 100-500 sat payouts for check-ins, x402, inscriptions - upgrade-to-free-floating.clar: Vote + dissenter exit + guardian dissolution - dao-pegged.clar: Main orchestrator with phase tracking - init-pegged-dao.clar: Bootstrap proposal enabling all extensions 25 tests passing covering full lifecycle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Critical: C1 reads actual treasury balance on-chain; C2 verifies work against checkin/proof registries before paying. High: H1 vote-round counter for retry; H2 slash voting period; H3 balance snapshots prevent post-vote transfer attacks; H4 min reputation. Medium: M1 restrict mint/burn to upgrade extension; M2 hardcode sBTC; M3 require initialization before deposit/redeem. Low: L4 validate phase values. All 33 tests passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…(L8) Adds zero-amount guards before burning tokens in redeem() and dissenter claim() to prevent holders from losing tokens to integer division rounding that yields 0 sBTC. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
139 tests covering every public function across 6 contracts: - Construction & init proposal (8 tests) - Token deposit/mint green + red paths (8 tests) - Token redeem/burn green + red paths (6 tests) - SIP-010 transfer green + red paths (4 tests) - Token DAO-only functions auth checks (6 tests) - Token read-only functions (8 tests) - Guardian management auth checks (4 tests) - Guardian small spend with C1 on-chain balance (6 tests) - Guardian slash voting with H2 voting period (7 tests) - Guardian read-only functions (3 tests) - Auto micro-payout checkin claims with C2 verification (6 tests) - Auto micro-payout proof claims with C2 verification (4 tests) - Auto micro-payout guardian-approved claims (7 tests) - Auto micro-payout configuration auth (5 tests) - Upgrade start vote green + red paths (6 tests) - Upgrade cast vote green + red paths (7 tests) - Upgrade snapshot balance green + red paths (4 tests) - Upgrade conclude vote with H1 retry (9 tests) - Upgrade claim outcome with H3 snapshots (8 tests) - Upgrade read-only functions (3 tests) - DAO-pegged phase management (3 tests) - Extension callbacks (5 tests) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
Author
|
Heads up: PR #8 supersedes this with a v2 architecture that drops the guardian council entirely. Key changes in v2:
→ #8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Contracts
token-pegged.clarguardian-council.clarauto-micro-payout.clarupgrade-to-free-floating.clardao-pegged.clarinit-pegged-dao.clarKey Design Decisions
Test plan
🤖 Generated with Claude Code