Rounds
To facilitate pairwise voting & funding distribution on Stellar
Rounds contract, is designed to facilitate pairwise voting and funding distribution on the Stellar blockchain. This contract enables users to create funding rounds, manage applications, conduct voting, and distribute funds based on community preferences.
Storage Structure
The contract uses a structured storage approach defined by the ContractKey
enum, which organizes various keys for managing the contract's state:
ContractKey Enum: Defines various keys for storing essential data:
ProtocolFeeRecipient: Address for receiving protocol fees.
ProtocolFee: The fee percentage charged for transactions.
FactoryOwner: Owner of the contract.
NextRoundId: Incremental integer to determine the next round ID.
NextPayoutId: Incremental integer for payout identification.
NextDepositId: Incremental integer for deposit identification.
ProjectPayoutIds: Stores payout IDs associated with projects.
TokenContract: Address of the XLM token contract.
ProjectContract: Reference to the project registry.
RoundInfo(u128): Stores detailed information about each round.
PayoutInfo: Key for storing payout details by ID.
DepositInfo: Key for storing deposit details by ID.
WhiteList(u128): Stores whitelisted voters for each round.
BlackList(u128): Stores blacklisted voters for each round.
ProjectApplicants(u128): Tracks project applicants for each round.
ApprovedProjects(u128): Stores IDs of approved projects.
Payouts(u128): Stores payout IDs for each round.
PayoutChallenges(u128): Tracks challenges related to payouts.
VotingState(u128): Stores the voting state of participants in each round.
Votes(u128): Records voting results for each round.
ProjectVotingCount(u128): Counts votes received by each project.
Admin(u128): Lists administrators for each round.
Deposit(u128): Tracks deposit IDs for rounds.
Contract Error Codes
The contract defines several error codes to handle common issues that may arise during operation:
General Error Codes:
OwnerOrAdminOnly: Action restricted to the owner or admin only.
ContractNotInitialized: Indicates that the contract has not been initialized properly.
InsufficientBalance: Raised when there are insufficient funds for a transaction.
Round-Specific Error Codes:
VotingStartGreaterThanVotingEnd: Voting start time must be before end time.
ApplicationStartGreaterThanApplicationEnd: Application start time must be before end time.
Voting Error Codes:
VotingPeriodNotStarted: Voting has not yet begun.
AlreadyVoted: User has already cast their vote.
Application Error Codes:
ApplicationPeriodNotStarted: The application period has not started yet.
Data Types
The contract includes various data structures to represent key elements within the GrantPicks ecosystem:
ApplicationStatus Enum: Represents the status of project applications (Pending, Approved, Rejected, Blacklisted).
Config Struct: Contains configuration settings such as owner address and protocol fee details.
RoundDetail Struct: Contains detailed information about each funding round.
id
: Unique identifier for the round.name
: Title of the round.description
: Description of what the round entails.voting_start_ms
: Start time of voting in milliseconds since epoch.
CreateRoundParams Struct: Parameters required to create a new funding round.
For user faicing high level overview on rounds check out Stages of A Round
Last updated
Was this helpful?