Contract d237fa83840c068f576d8c51a424a645a8ae3b8b18dc888a95cac65d139c8c58

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.0.3#6aa930b08eabfd578b7824a0d5de473cbd958282
rsver 1.90.0

Instances

  • CAPWKVMTS73YVIWPHXQR25CKZHYVDSCOIWCBEDHNW7Y5HMH5WPNDVS4M

Interface

Check if the threshold policy can be enforced.

Verifies that the number of authenticated signers meets or exceeds the configured threshold for this context rule.

Returns

  • true if the threshold is met
  • false otherwise
fn can_enforce(
    env: soroban_sdk::Env,
    context: Context,
    authenticated_signers: soroban_sdk::Vec,
    context_rule: ContextRule,
    smart_account: soroban_sdk::Address,
) -> bool

Enforce the threshold policy.

Records that authorization occurred and emits an event. This is called after can_enforce returns true.

fn enforce(
    env: soroban_sdk::Env,
    context: Context,
    authenticated_signers: soroban_sdk::Vec,
    context_rule: ContextRule,
    smart_account: soroban_sdk::Address,
)

Install the threshold policy for a smart account.

Stores the threshold configuration for the given context rule.

fn install(
    env: soroban_sdk::Env,
    install_params: WeightedThresholdAccountParams,
    context_rule: ContextRule,
    smart_account: soroban_sdk::Address,
)

Uninstall the threshold policy for a smart account.

Removes the threshold configuration for the given context rule.

fn uninstall(
    env: soroban_sdk::Env,
    context_rule: ContextRule,
    smart_account: soroban_sdk::Address,
)

Get the current threshold for a smart account

fn get_threshold(
    env: soroban_sdk::Env,
    context_rule_id: u32,
    smart_account: soroban_sdk::Address,
) -> u32

Get the current signer weights

fn get_signer_weights(
    env: soroban_sdk::Env,
    context_rule: ContextRule,
    smart_account: soroban_sdk::Address,
) -> soroban_sdk::Map
fn set_signer_weight(
    env: soroban_sdk::Env,
    signer: Signer,
    weight: u32,
    context_rule: ContextRule,
    smart_account: soroban_sdk::Address,
)

Set a new threshold for a smart account

fn set_threshold(
    env: soroban_sdk::Env,
    threshold: u32,
    context_rule: ContextRule,
    smart_account: soroban_sdk::Address,
)

Imports

WebAssembly Text (WAT) ▶