Skip to content

ronaldarabambi/Consortium-Resolution-Protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Consortium Resolution Protocol

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.

Overview

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.

Core Features

Resolution Management

  • 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

Voting Mechanism

  • 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

Resolution Conclusion

  • 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

Smart Contract Functions

Public Functions

initiate-resolution

(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 begins
  • ballot-closes: Block height when voting ends

Returns: Resolution index (uint)

submit-ballot

(submit-ballot 
    (resolution-index uint)
    (affirmative bool)
)

Cast a vote on an active resolution.

Parameters:

  • resolution-index: ID of the resolution
  • affirmative: 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

(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

(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

Read-Only Functions

retrieve-resolution-details

(retrieve-resolution-details (resolution-index uint))

Retrieves complete details of a resolution.

Returns: Resolution object containing:

  • proposition: Resolution title
  • elaboration: Full description
  • proposer: Address that created the resolution
  • genesis-block: Block when resolution was created
  • ballot-opens/closes: Voting period boundaries
  • affirmative-tally: Number of yes votes
  • negative-tally: Number of no votes
  • status: Current state (PENDING/RATIFIED/DECLINED/NULLIFIED)
  • concluded: Whether voting has been finalized

retrieve-total-resolutions

(retrieve-total-resolutions)

Returns the total number of resolutions created.

Resolution States

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

Error Codes

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

Usage Example

;; 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)

Security Features

  • 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

Deployment Considerations

  1. Protocol Overseer: The deploying address becomes the Protocol Overseer with administrative privileges
  2. Block Timing: Plan ballot periods carefully based on average block times
  3. Gas Costs: Consider transaction costs when setting voting periods
  4. Quorum: This contract doesn't enforce minimum participation - consider adding if needed

About

The Consortium Resolution Protocol is a decentralized governance smart contract written in Clarity for the Stacks blockchain. It provides organizations, DAOs, and communities with a transparent, immutable voting system for collective decision-making.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors