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>