Contract a6f7ad3c30e6a08b81fe4626864da92977e3f1e34e740852e9f48018b571c3dc

← Back to Index 📥 Download WASM

Meta

cliver 23.4.0#fc6745f3d4e90d1ef68d14d0ae947404768fa5c0
home_domain voltacircuit.com
rssdkver 23.4.0#673d6c4f2368d282d25da29bda55c21b8be69ca6
rsver 1.92.0
source_repo github:VoltaHQ/smart-contract-soroban

Instances

  • CAIJXVOZWD45KG23AQEGWHHSNHJVLNEI7G2YA4ZU3KUCMOJVNKHL35YJ
  • CARC6T3PFPWYEY7IVKMNO2F4GZ5Y2ETYDMM7DZQHPQXYRULU6QPCVHBC
  • CBLYMVVMB4VJPON6JDBG4ZFZUNYUFUUHKL5A5VNSWRSO3SUMPFMUKJCU
  • CCIIAVMLOCEMBHON23ZARDYENHECNCRDMPRTCNUWPEPNMZBQBVRXINAW

Interface

Vote on a proposal. The caller must be an owner and the proposal must be pending. An error is returned if the proposal is not pending, the caller is not an owner, or the voter has already voted (votes cannot be changed once cast).

fn vote(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    proposal_id: u64,
    vote: VoteType,
) -> Result

Propose a new invoke proposal to invoke an arbitrary contract function. The caller must be an owner and the invoke must be valid (i.e. the contract exists and the function is valid). Invoke proposals require (threshold - 1) additional votes since the proposer auto-votes Yes.

fn invoke(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    contract: soroban_sdk::Address,
    fn_name: soroban_sdk::Symbol,
    args: soroban_sdk::Vec,
    auth_entries: soroban_sdk::Vec,
) -> Result<(), ContractError>

Proposes a new proposal. The owner must be the signer of the transaction, and the proposal must be valid (and not an Invoke variant since Invoke proposals are not allowed to be directly proposed).

Proposals have a short TTL (approximately 1 week) and can be implicitly prematurely revoked if the config is changed.

fn propose(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    proposal: ProposalInput,
) -> Result

Returns the version of the contract.

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

Returns the config of the contract. There's no practical way this actually returns an error due to other initialization checks, but we return a Result for consistency.

fn get_config(env: soroban_sdk::Env) -> Result

Get a proposal by id, returning an error if the proposal is not pending (which happens if the proposal expires in the ledger, is revoked/rejected, is executed, or is before the last config change).

fn get_proposal(
    env: soroban_sdk::Env,
    proposal_id: u64,
) -> Result

Initializes the contract with a config. The Option<ConfigInput> is used to work around the test harness, which is why we reject any attempt to initialize the contract without a config.

fn __constructor(
    env: soroban_sdk::Env,
    config: Option,
) -> Result<(), ContractError>

Revokes a proposal. The caller must be the original proposer and the proposal must be pending.

fn revoke_proposal(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    proposal_id: u64,
) -> Result<(), ContractError>

Imports

WebAssembly Text (WAT) ▶