Contract acf5bdebcfee8ceb1b9cf9580af3e6cb717d05cd6773b5a50926fbca0ac82031

← Back to Index 📥 Download WASM

Meta

cliver 27.1.0#8e402ea28202950b272fbabc34caad4d2f64fe87
rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.95.0

Instances

  • CB7LV3FBQ7US26GVC7SM7RMX22IEEHAEUL7V3TDDWM32DHA5TDFDDEP4

Interface

Vote on a proposal by escrowing sXLM for the length of the vote.

Weight is the amount escrowed, so the same shares cannot vote twice or be sold in the same ledger they voted in. Returned by unlock_vote once voting closes.

fn vote(
    env: soroban_sdk::Env,
    voter: soroban_sdk::Address,
    proposal_id: u64,
    support: bool,
    amount: i128,
)

Upgrade the contract WASM. Only callable by admin.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Read the last approved value for a parameter.

This is a record, not the source of truth — execution applies the value to the target contract, and that contract is what to read for the live setting.

fn get_param(env: soroban_sdk::Env, key: soroban_sdk::Symbol) -> i128

Initialize the governance contract.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    sxlm_token: soroban_sdk::Address,
    voting_period_ledgers: u32,
    quorum_bps: u32,
    execution_delay_ledgers: u32,
)

Reclaim escrowed sXLM once voting on a proposal has closed.

fn unlock_vote(env: soroban_sdk::Env, voter: soroban_sdk::Address, proposal_id: u64)
fn get_proposal(env: soroban_sdk::Env, id: u64) -> Proposal

Earliest ledger at which a proposal may execute.

fn proposal_eta(env: soroban_sdk::Env, id: u64) -> u32

Bump instance TTL — can be called by anyone to keep contract alive.

fn bump_instance(env: soroban_sdk::Env)
fn get_vote_count(env: soroban_sdk::Env, id: u64) -> (i128, i128)
fn proposal_count(env: soroban_sdk::Env) -> u64

Create a new governance proposal. Proposer must hold minimum sXLM balance.

fn create_proposal(
    env: soroban_sdk::Env,
    proposer: soroban_sdk::Address,
    target: soroban_sdk::Address,
    param_key: soroban_sdk::Symbol,
    new_value: i128,
) -> u64

Ledgers between voting closing and execution becoming possible.

fn execution_delay(env: soroban_sdk::Env) -> u32

sXLM a voter has escrowed on a proposal.

fn get_vote_weight(
    env: soroban_sdk::Env,
    proposal_id: u64,
    voter: soroban_sdk::Address,
) -> i128

Execute a proposal if quorum met and passed. Stores the new parameter value on-chain for the admin/backend to read and propagate.

fn execute_proposal(env: soroban_sdk::Env, proposal_id: u64)

Imports

WebAssembly Text (WAT) ▶