Contract f60d33ec57eecee04b52d048c1c079983ff1b3834c8195fea811b025fb889361

← Back to Index 📥 Download WASM

Meta

home_domain reflector.network
rssdkver 22.0.2#31b2892ef4d20538004e52713cb81e4895a8de9a
rsver 1.83.0
source_repo github:reflector-network/reflector-dao-contract

Instances

  • CAB734H7KALIWGKGPAGW5AB3QET6NJJNPCSNGLYNP2PUE5QUGH3NUDUO
  • CBQSUF57OYX4RIMCZV62DKN6JFOTEKPHIZASMJYOUOCNHGNG2P3XQLSE

Interface

Initializes and funds the DAO contract Requires admin permissions

Arguments

  • config - Initial contract configuration

Panics

Panics 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

Arguments

  • deposit_params - Map of deposit amounts for each ballot category

Panics

Panics 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

Arguments

  • developer - Developer organization account address
  • operators - Operators' account addresses

Panics

Panics 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

Arguments

  • claimant - Claimant's account address

Returns

  • available - Amount of DAO tokens available for claiming

Panics

Panics 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

Arguments

  • claimant - Claimant's account address
  • to - Destination address that will receive claimed tokens
  • amount - Amount of tokens to claim

Panics

Panics 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

Arguments

  • params - Ballot initialization parameters

Returns

  • ballot_id - Unique ID of a newly created ballot

Panics

Panics 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

Arguments

  • ballot_id - Unique ballot ID

Returns

  • ballot - Ballot object

Panics

Panics 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

Arguments

  • ballot_id - Unique ballot ID

Panics

Panics 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

Arguments

  • ballot_id - Unique ballot ID
  • accepted - Whether the proposal has been accepted or rejected by the majority of operators

Panics

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

Imports

WebAssembly Text (WAT) ▶