Contract ba085f2ca549af1f01826336f69132389e2989519148200d897aa0772f6418d8

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.3.0#a35990025247146e24cb9e1deda063f17f3e441d
rsver 1.94.0-nightly

Instances

  • CBNNIJXAFGXNGURAWRZHFZOUN2FBZFQOLUYUWS67GIQGBLASWOJKGHVA

Interface

Enforcement hook - no state changes needed for this policy

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

Installs the policy with the given allowed WASM hashes

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

Uninstalls the policy, cleaning up storage

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

Checks if the context is allowed by this policy.

Allows:

  • Stellar Asset Contracts (SAC) - native tokens
  • Contracts with WASM hash in the allowed list

Blocks:

  • All other contracts
  • Contract creation (unless WASM hash is allowed)
fn can_enforce(
    env: soroban_sdk::Env,
    context: Context,
    authenticated_signers: soroban_sdk::Vec,
    context_rule: ContextRule,
    smart_account: soroban_sdk::Address,
) -> bool

Adds a WASM hash to the allowed list for a specific account and rule. Note: This should be called through the smart wallet's policy management.

fn add_allowed_hash(
    env: soroban_sdk::Env,
    smart_account: soroban_sdk::Address,
    rule_id: u32,
    wasm_hash: soroban_sdk::BytesN<32>,
)

Gets the list of allowed WASM hashes for a specific account and rule.

fn get_allowed_hashes(
    env: soroban_sdk::Env,
    smart_account: soroban_sdk::Address,
    rule_id: u32,
) -> soroban_sdk::Vec>

Removes a WASM hash from the allowed list.

fn remove_allowed_hash(
    env: soroban_sdk::Env,
    smart_account: soroban_sdk::Address,
    rule_id: u32,
    wasm_hash: soroban_sdk::BytesN<32>,
)

Imports

WebAssembly Text (WAT) ▶