Contract ee43ee6e762dbd8525e9a065b3163bdad22ca527cb000327e6baa7d475dae97b

← Back to Index 📥 Download WASM

Meta

rssdkver 23.2.1#ab415a33cc1f6bdce20ac4a12f0ddbe41a648949
rsver 1.91.1

Instances

  • CCEPI23BKCJUMS5TLH35EVOTS2PAYDOF53TSNU5FPHQQFCZQIHLVLAX7

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) ▶