Contract 1e25669bacd907ec14114b9e943312a6ec4ab265cb407646cfb567517009ba70

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdk_spec_shaking 2
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.91.1

Instances

  • CAD47UE62KHB2CPD5ZTUKXAMNNO5OHW6T3AWCGGKGRJZA2MQVGVORYB7
  • CAEDZZHIJNIHZM6N7JZGTHJHOTHXJHFFED7V4I7RUHD523R3GYK4HOND
  • CAOQ5SATX7YLIX6RRMF2OWZW3NDPNZJJTFYBIWKRGRR7WYNF4KYU5M3N
  • CAUGELQE5EDKYIT55ERM7PGF7YZVZCZTIPVW3VXXTOU3H3ZODNOOUJZR
  • CAXLVDZ3QVFPGAUDRAY5YMSI6A6IXTRBOG26DYY3JWO6QM6XJNQC3RWQ
  • CBAV5PG6YWXB3L372Y7EY5HULIOBPD5FA5XLRJ36OJUEU6HVPAGDAYD6
  • CBTSZ4UHPIKZMSOU3IVSIT4RCX6CPAGOUQ6LBVJI66NT37WUIKUZWFOM
  • CC7FQAFOUJGSF3423AQNVLP3N4PE7YQNU2QA6JID4D4CCJM7HIK6BXK6
  • CCFWAILWH5WPDY7427D5K5P3K3PRQ66JFBFD43JWRMJEKVMRULLDZ7RA
  • CCGQ6CIMGGQRNR2RZN4NFPROEM6Y5L2RDTS33LGNWMPPTDCIU2TMYP5E
  • CCLS37EAHKHYBTR57NSGZEUUPNT4VNN4ZJ2F37MBBMHSI5B42SMG35UF
  • CCQRJACUL7336SYTGJVYWHUPSA7PJQSULT6VOBHSXFQFLXGLGEZ4WCSP
  • CCSNCYCVPTYHJ4WZRQOQQDFAIJ2U64LBIO3EUIZQ3DL2W72UQPC7ELDD
  • CCTK6TJCFKY4NH6A2BAJZES7JWZFDJMHWJGQSF55KYERWSMCQE3OQZDA
  • CCYERSAF7GUKYSKQ3O5M3HONSAPMLUZMVEXSGF54YHMOHVBY56WKFDVW
  • CD4OQS5IV6CZIF472RHQNZXG2NF6AJTKK7NZAHRRVGBD6QXIWKB3SXAE
  • CD7YZWD5CLSA6OLUE333XMQPE4WTXD5C3EWV5ITKO646MOPXTQ5SFD6I
  • CDBAQEBSUH6H27E6T7MVPC2WTHXM42O6ALI6BU24ZFYWGE7UMI75IJ73
  • CDT7ZUSVLN3KROZB6J2LJSBDICXJKQ662BSVVQ5CWQWV5SKD2JC6MBFQ

Interface

Executes a function call on a target contract from within the smart account context.

Arguments

  • e - Access to the Soroban environment.
  • target - The address of the contract to call.
  • target_fn - The function name to invoke on the target contract.
  • target_args - Arguments to pass to the target function.

Notes

Defaults to requiring authorization from the smart account itself (e.current_contract_address().require_auth()) and then calling e.invoke_contract().

fn execute(
    env: soroban_sdk::Env,
    target: soroban_sdk::Address,
    target_fn: soroban_sdk::Symbol,
    target_args: soroban_sdk::Vec,
)
fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
)

Adds a new policy to an existing context rule, installs it, and returns the assigned policy ID. The policy's install method will be called during this operation.

Arguments

  • e - Access to the Soroban environment.
  • context_rule_id - The ID of the context rule to modify.
  • policy - The address of the policy contract to add.
  • install_param - The installation parameter for the policy.

Errors

  • [SmartAccountError::ContextRuleNotFound] - When no context rule exists with the given ID.
  • [SmartAccountError::DuplicatePolicy] - When the policy already exists in the rule.
  • [SmartAccountError::TooManyPolicies] - When adding would exceed MAX_POLICIES (5).

Events

  • topics - ["policy_added", context_rule_id: u32]
  • data - [policy_id: u32]

Notes

Defaults to requiring authorization from the smart account itself (e.current_contract_address().require_auth()) and then delegating to [storage::add_policy].

fn add_policy(
    env: soroban_sdk::Env,
    context_rule_id: u32,
    policy: soroban_sdk::Address,
    install_param: soroban_sdk::Val,
) -> u32

Adds a new signer to an existing context rule, returning the assigned signer ID.

Arguments

  • e - Access to the Soroban environment.
  • context_rule_id - The ID of the context rule to modify.
  • signer - The signer to add to the context rule.

Errors

  • [SmartAccountError::ContextRuleNotFound] - When no context rule exists with the given ID.
  • [SmartAccountError::DuplicateSigner] - When the signer already exists in the rule.
  • [SmartAccountError::TooManySigners] - When adding would exceed MAX_SIGNERS (15).

Events

  • topics - ["signer_added", context_rule_id: u32]
  • data - [signer_id: u32]

Notes

Defaults to requiring authorization from the smart account itself (e.current_contract_address().require_auth()) and then delegating to [storage::add_signer].

fn add_signer(env: soroban_sdk::Env, context_rule_id: u32, signer: Signer) -> u32

Verify authorization for the smart account.

This function is called by the Soroban host when authorization is required. It validates signatures against the configured context rules and policies.

Arguments

  • signature_payload - Hash of the data that was signed
  • signatures - Map of signers to their signature data
  • auth_contexts - Contexts being authorized (contract calls, deployments, etc.)

Returns

  • Ok(()) if authorization succeeds
  • Err(SmartAccountError) if authorization fails
fn __check_auth(
    env: soroban_sdk::Env,
    signature_payload: soroban_sdk::BytesN<32>,
    signatures: AuthPayload,
    auth_contexts: soroban_sdk::Vec,
) -> Result<(), SmartAccountError>

Creates a default context rule with the provided signers and policies.

Arguments

  • signers - Vector of signers (Delegated or External) that can authorize transactions
  • policies - Map of policy contract addresses to their installation parameters
fn __constructor(
    env: soroban_sdk::Env,
    signers: soroban_sdk::Vec,
    policies: soroban_sdk::Map,
)

Retrieves the global registry ID for a policy.

Arguments

  • e - Access to the Soroban environment.
  • policy - The policy address to look up.

Errors

  • [SmartAccountError::PolicyNotFound] - When the policy is not registered in the global registry.
fn get_policy_id(env: soroban_sdk::Env, policy: soroban_sdk::Address) -> u32

Retrieves the global registry ID for a signer.

Arguments

  • e - Access to the Soroban environment.
  • signer - The signer to look up.

Errors

  • [SmartAccountError::SignerNotFound] - When the signer is not registered in the global registry.
fn get_signer_id(env: soroban_sdk::Env, signer: Signer) -> u32

Removes a policy from an existing context rule and uninstalls it. The policy's uninstall method will be called during this operation. Removing the last policy is allowed only if the rule has at least one signer.

Arguments

  • e - Access to the Soroban environment.
  • context_rule_id - The ID of the context rule to modify.
  • policy_id - The ID of the policy to remove from the context rule.

Errors

  • [SmartAccountError::ContextRuleNotFound] - When no context rule exists with the given ID.
  • [SmartAccountError::PolicyNotFound] - When the policy doesn't exist in the rule.

Events

  • topics - ["policy_removed", context_rule_id: u32]
  • data - [policy_id: u32]

Notes

Defaults to requiring authorization from the smart account itself (e.current_contract_address().require_auth()) and then delegating to [storage::remove_policy].

fn remove_policy(env: soroban_sdk::Env, context_rule_id: u32, policy_id: u32)

Removes a signer from an existing context rule. Removing the last signer is allowed only if the rule has at least one policy.

Arguments

  • e - Access to the Soroban environment.
  • context_rule_id - The ID of the context rule to modify.
  • signer_id - The ID of the signer to remove from the context rule.

Errors

  • [SmartAccountError::ContextRuleNotFound] - When no context rule exists with the given ID.
  • [SmartAccountError::SignerNotFound] - When the signer doesn't exist in the rule.

Events

  • topics - ["signer_removed", context_rule_id: u32]
  • data - [signer_id: u32]

Notes

Defaults to requiring authorization from the smart account itself (e.current_contract_address().require_auth()) and then delegating to [storage::remove_signer].

fn remove_signer(env: soroban_sdk::Env, context_rule_id: u32, signer_id: u32)

Creates a new context rule with the specified configuration, returning the newly created ContextRule with a unique ID assigned. Installs all specified policies during creation.

Arguments

  • e - Access to the Soroban environment.
  • context_type - The type of context this rule applies to.
  • name - Human-readable name for the context rule.
  • valid_until - Optional expiration ledger sequence.
  • signers - List of signers authorized by this rule.
  • policies - Map of policy addresses to their installation parameters.

Errors

  • [SmartAccountError::NoSignersAndPolicies] - When both signers and policies are empty.
  • [SmartAccountError::TooManySigners] - When signers exceed MAX_SIGNERS (15).
  • [SmartAccountError::TooManyPolicies] - When policies exceed MAX_POLICIES (5).
  • [SmartAccountError::DuplicateSigner] - When the same signer appears multiple times.
  • [SmartAccountError::PastValidUntil] - When valid_until is in the past.
  • [SmartAccountError::MathOverflow] - When the context rule, si
fn add_context_rule(
    env: soroban_sdk::Env,
    context_type: ContextRuleType,
    name: soroban_sdk::String,
    valid_until: Option,
    signers: soroban_sdk::Vec,
    policies: soroban_sdk::Map,
) -> ContextRule
fn batch_add_signer(
    env: soroban_sdk::Env,
    context_rule_id: u32,
    signers: soroban_sdk::Vec,
)

Retrieves a context rule by its unique ID, returning the ContextRule containing all metadata, signers, and policies.

Arguments

  • e - Access to the Soroban environment.
  • context_rule_id - The unique identifier of the context rule to retrieve.

Errors

  • [SmartAccountError::ContextRuleNotFound] - When no context rule exists with the given ID.
fn get_context_rule(env: soroban_sdk::Env, context_rule_id: u32) -> ContextRule

Removes a context rule and cleans up all associated data. This function uninstalls all policies associated with the rule and removes all stored data including signers, policies, and metadata.

Arguments

  • e - Access to the Soroban environment.
  • context_rule_id - The ID of the context rule to remove.

Errors

  • [SmartAccountError::ContextRuleNotFound] - When no context rule exists with the given ID.

Events

  • topics - ["context_rule_removed", context_rule_id: u32]
  • data - []

Notes

Defaults to requiring authorization from the smart account itself (e.current_contract_address().require_auth()) and then delegating to [storage::remove_context_rule].

fn remove_context_rule(env: soroban_sdk::Env, context_rule_id: u32)

Retrieves the number of all context rules, including expired rules. Defaults to 0.

Arguments

  • e - Access to the Soroban environment.
fn get_context_rules_count(env: soroban_sdk::Env) -> u32

Updates the name of an existing context rule, returning the updated ContextRule with the new name.

Arguments

  • e - Access to the Soroban environment.
  • context_rule_id - The ID of the context rule to update.
  • name - The new human-readable name for the context rule.

Errors

  • [SmartAccountError::ContextRuleNotFound] - When no context rule exists with the given ID.

Events

  • topics - ["context_rule_meta_updated", context_rule_id: u32]
  • data - [name: String, context_type: ContextRuleType, valid_until: Option<u32>]

Notes

Defaults to requiring authorization from the smart account itself (e.current_contract_address().require_auth()) and then delegating to [storage::update_context_rule_name].

fn update_context_rule_name(
    env: soroban_sdk::Env,
    context_rule_id: u32,
    name: soroban_sdk::String,
) -> ContextRule

Updates the expiration time of an existing context rule, returning the updated ContextRule with the new expiration time.

Arguments

  • e - Access to the Soroban environment.
  • context_rule_id - The ID of the context rule to update.
  • valid_until - New optional expiration ledger sequence. Use None for no expiration.

Errors

  • [SmartAccountError::ContextRuleNotFound] - When no context rule exists with the given ID.
  • [SmartAccountError::PastValidUntil] - When valid_until is in the past.

Events

  • topics - ["context_rule_meta_updated", context_rule_id: u32]
  • data - [name: String, context_type: ContextRuleType, valid_until: Option<u32>]

Notes

Defaults to requiring authorization from the smart account itself (e.current_contract_address().require_auth()) and then delegating to [storage::update_context_rule_valid_until].

fn update_context_rule_valid_until(
    env: soroban_sdk::Env,
    context_rule_id: u32,
    valid_until: Option,
) -> ContextRule

Imports

WebAssembly Text (WAT) ▶