feat(contracts): Build On-Chain Governance Contract with Timelock Executor, Snapshot Voting, and Cross-Contract Execution - #42
Merged
GoSTEAN merged 1 commit intoJun 20, 2026
Conversation
…imelock, and cross-contract execution Adds Governance contract with create_proposal, vote, finalize, execute, and veto. Implements 7-day voting (120,960 ledgers), 48h timelock (34,560 ledgers), 5% quorum check, and cross-contract MarketFactory / Treasury calls on execution. Security: - CEI in execute(): status → Executed BEFORE cross-contract call - require_auth() first in create_proposal, vote, veto - extend_ttl() on every persistent write (TTL_EXTEND_TO = 604,800 ledgers) - Veto cooldown (7 days) per proposal-type discriminant Closes GruftNet#18 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Implements the full on-chain governance stack for BOXMEOUT as described in issue #18.
vote()call time and stored immutably — subsequent balance changes have no effect(votes_for + votes_against) * 20 >= quorum_supply— ≥ 5% of total platform XLM must participatevotes_for > votes_against AND quorum reachedMarketFactory.set_fee_bps,MarketFactory.update_token_list, orTreasury.set_max_discountFiles Changed
contracts/governance/Cargo.tomlcontracts/governance/src/lib.rscontracts/governance/src/tests.rscontracts/Cargo.tomlgovernanceto workspace memberscontracts/SECURITY_AUDIT.mdSecurity (CEI / Reentrancy)
All state changes in
execute()happen before the cross-contract call:Test Coverage (24 tests, all passing)
Interface Notes
MarketFactoryandTreasuryneed to implement the governance callable functions:Testnet Deployment
Closes #18
🤖 Generated with Claude Code