A decentralized governance smart contract built on Clarity for the Stacks blockchain. This protocol enables transparent, tamper-proof decision-making processes for DAOs, organizations, and communities.
The Consortium Resolution Protocol provides a complete voting system where stakeholders can propose resolutions, participate in time-bound balloting, and automatically conclude decisions based on collective consensus.
- Initiate Resolutions: Any stakeholder can propose a new resolution with a title (proposition) and detailed description (elaboration)
- Time-Bound Voting: Each resolution has defined ballot opening and closing blocks
- Automatic Status Tracking: Resolutions progress through states: PENDING → RATIFIED/DECLINED/NULLIFIED
- One Vote Per Stakeholder: Built-in duplicate vote prevention ensures each address can only vote once per resolution
- Binary Voting: Stakeholders cast affirmative (yes) or negative (no) ballots
- Real-Time Tallying: Vote counts update immediately and are permanently recorded on-chain
- Automated Results: Resolutions are concluded after the ballot period ends
- Simple Majority: Resolutions pass when affirmative votes exceed negative votes
- Transparent Outcomes: All voting results are publicly verifiable
(initiate-resolution
(proposition (string-utf8 100))
(elaboration (string-utf8 500))
(ballot-opens uint)
(ballot-closes uint)
)Creates a new resolution for stakeholder voting.
Parameters:
proposition: Short title (max 100 characters)elaboration: Detailed description (max 500 characters)ballot-opens: Block height when voting beginsballot-closes: Block height when voting ends
Returns: Resolution index (uint)
(submit-ballot
(resolution-index uint)
(affirmative bool)
)Cast a vote on an active resolution.
Parameters:
resolution-index: ID of the resolutionaffirmative: true for yes, false for no
Returns: Success boolean
Requirements:
- Ballot period must be active
- Stakeholder cannot have already voted
- Current block must be within ballot window
(conclude-resolution (resolution-index uint))Finalizes a resolution after the ballot period ends.
Parameters:
resolution-index: ID of the resolution to conclude
Returns: true if ratified, false if declined
Requirements:
- Ballot period must have ended
- Resolution must not already be concluded
(nullify-resolution (resolution-index uint))Administrative function to cancel a resolution (Protocol Overseer only).
Parameters:
resolution-index: ID of the resolution to nullify
Returns: Success boolean
(retrieve-resolution-details (resolution-index uint))Retrieves complete details of a resolution.
Returns: Resolution object containing:
proposition: Resolution titleelaboration: Full descriptionproposer: Address that created the resolutiongenesis-block: Block when resolution was createdballot-opens/closes: Voting period boundariesaffirmative-tally: Number of yes votesnegative-tally: Number of no votesstatus: Current state (PENDING/RATIFIED/DECLINED/NULLIFIED)concluded: Whether voting has been finalized
(retrieve-total-resolutions)Returns the total number of resolutions created.
| State | Description |
|---|---|
| PENDING | Resolution created, awaiting or during ballot period |
| RATIFIED | Resolution passed (affirmative > negative) |
| DECLINED | Resolution failed (negative ≥ affirmative) |
| NULLIFIED | Resolution canceled by Protocol Overseer |
| Code | Constant | Description |
|---|---|---|
| u1 | ERR-UNAUTHORIZED | Caller lacks permission for this action |
| u2 | ERR-RESOLUTION-NOT-FOUND | Resolution index does not exist |
| u3 | ERR-BALLOT-NOT-ACTIVE | Voting period not active or has ended |
| u4 | ERR-ALREADY-ENGAGED | Stakeholder has already voted |
| u5 | ERR-BALLOT-CONCLUDED | Voting period has ended |
| u6 | ERR-RESOLUTION-ALREADY-CONCLUDED | Resolution already finalized |
| u7 | ERR-INVALID-BALLOT-PERIOD | Closing block must be after opening block |
| u8 | ERR-INVALID-PROPOSITION | Proposition text invalid or empty |
| u9 | ERR-INVALID-ELABORATION | Elaboration text invalid or empty |
| u10 | ERR-INVALID-RESOLUTION-INDEX | Resolution index out of bounds |
;; 1. Create a resolution (voting opens at block 1000, closes at block 2000)
(contract-call? .consortium-resolution initiate-resolution
u"Increase Treasury Allocation"
u"Proposal to allocate 10% more funds to development treasury for Q1 2025 initiatives"
u1000
u2000
)
;; Returns: (ok u0)
;; 2. Cast affirmative vote
(contract-call? .consortium-resolution submit-ballot u0 true)
;; Returns: (ok true)
;; 3. After block 2000, conclude the resolution
(contract-call? .consortium-resolution conclude-resolution u0)
;; Returns: (ok true) if ratified, (ok false) if declined
;; 4. Check resolution details
(contract-call? .consortium-resolution retrieve-resolution-details u0)- Single Vote Enforcement: Cryptographic prevention of duplicate voting
- Immutable Records: All votes permanently recorded on blockchain
- Time-Lock Voting: Votes only accepted during defined ballot periods
- Administrative Oversight: Protocol Overseer can nullify resolutions if needed
- Input Validation: Comprehensive checks prevent invalid data entry
- Protocol Overseer: The deploying address becomes the Protocol Overseer with administrative privileges
- Block Timing: Plan ballot periods carefully based on average block times
- Gas Costs: Consider transaction costs when setting voting periods
- Quorum: This contract doesn't enforce minimum participation - consider adding if needed