Initializes and funds the DAO contract Requires admin permissions
config - Initial contract configurationPanics if the contract has been already initialized Panics if the deposit amounts is invalid Panics if the deposit amount is not set for all categories
fn config(env: soroban_sdk::Env, config: ContractConfig)
Sets the deposit amount for each ballot category Requires admin permissions
deposit_params - Map of deposit amounts for each ballot categoryPanics if the caller doesn't match admin address Panics if the deposit amount is invalid Panics if the deposit amount is not set for all categories
fn set_deposit(
env: soroban_sdk::Env,
deposit_params: soroban_sdk::Map,
)
Unlocks tokens distributed to the developer organization and operators on a weekly basis Requires admin permissions
developer - Developer organization account addressoperators - Operators' account addressesPanics if the caller doesn't match admin address Panics if the unlock process has been initiated too early
fn unlock(
env: soroban_sdk::Env,
developer: soroban_sdk::Address,
operators: soroban_sdk::Vec,
)
Fetches the DAO tokens amount available for claiming
claimant - Claimant's account addressavailable - Amount of DAO tokens available for claimingPanics if the caller doesn't match the claimant address
fn available(env: soroban_sdk::Env, claimant: soroban_sdk::Address) -> i128
Claims tokens unlocked for a given account address
claimant - Claimant's account addressto - Destination address that will receive claimed tokensamount - Amount of tokens to claimPanics if the caller doesn't match the claimant address Panics if the claimed amount is larger than the available unlocked amount
fn claim(
env: soroban_sdk::Env,
claimant: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
Create a new ballot
params - Ballot initialization parametersballot_id - Unique ID of a newly created ballotPanics if the caller doesn't match the initiator address
fn create_ballot(env: soroban_sdk::Env, params: BallotInitParams) -> u64
Fetch the ballot by its unique ID
ballot_id - Unique ballot IDballot - Ballot objectPanics if the ballot is not found
fn get_ballot(env: soroban_sdk::Env, ballot_id: u64) -> Ballot
Retract the proposal and initiate the deposit refund
ballot_id - Unique ballot IDPanics if the caller doesn't match the initiator address Panics if the ballot status is in invalid state (not Draft or Rejected) Panics if the voting period is not over Panics if the ballot is not found
fn retract_ballot(env: soroban_sdk::Env, ballot_id: u64)
Set ballot decision based on the operators voting (decision requires the majority of signatures) Requires admin permissions
ballot_id - Unique ballot IDaccepted - Whether the proposal has been accepted or rejected by the majority of operatorsPanics if the caller doesn't match admin address Panics if the ballot status is not Draft Panics if the ballot is not found
fn vote(env: soroban_sdk::Env, ballot_id: u64, accepted: bool)