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:
Blocks:
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>,
)