Contract 011ee0c72be16018cfbcdd6b16642eb29c4c85209efab3cf5013daf5fb4caae0

← Back to Index 📥 Download WASM

Meta

rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.91.0

Instances

  • CA4SSBXIOUNDCT3VF34T3PUNFJB7NSBVEA5XCMQYMY4VJJAWXYTVGIOT
  • CA4Y6RXXJLPC6LBHX6JZMRV6AIG5LPO6THD6JXZ5OBVIVUAP7EKQAVSY
  • CA6ZJDH3YJ77SOVVDYGTO4KI53ZJTK7EPGP5PDBINOZBBBSV2WFTODLJ
  • CAAOXV4L3OTIKTLN5ZOTANHBIR5JPYPP23ULZDYUNDK4HSR545RHXSMR
  • CABKYLXFBICUCN6J6TUMEPJEYEPOP3MZOIP2XN4R23KIZVQJPIQB7UZI
  • CABLHA7QAVJ6AKJ6VCZYLVIACR23AEFNFUP34N7GHQGHYBTR7JHAZWE6
  • CAETNC3MSF35SXGI7KFS7A4UDOB6QT62RPG4JVULZPZQDDTEXXILKJN7
  • CAK6LEHN2IXCMRBWDVRL3P65A2Z72JH6WF5QYBI3FI54QL7SKY6UNKJE
  • CATLCQERDRXUBNWQLPUB5PSC7C6CUCDORIT3SCUNEATIF64L4SAHIU6D
  • CAY5B35E3YKEEPTNBOHYHC7A5FNVS2W7WWF7DI6UBK3UM67HMYFIQ5GZ
  • CAZ4G5E5BOYMLRSLIJVDH3OFZAX2VSW3VU6KBW5KV7B5CDSBYG57KF7U
  • CAZQFX47PHQLOOKEJMIICEPLONYBUDJWTT53I7NYPJKBBCFMTXN7CQAO
  • CB336WC3SPGVGU5NM42CENMC5ATGOOXVLNSKOTD6D266ZENG5SGCD7S3
  • CB6B7JDSEOZSYNKVXWZPRO4JXRODFMJPU2FRS25WW3COHNDWQUX6VKMT
  • CBJKXPTW4UMPV2IWJ7SP62AFJ37AN2W3HECL76XVT6R6LP5LR3MPTGXC
  • CBLILQSLGBAFQ3RLNJSW57KJGVE3XQKXM3CMVFGWKFM2OREPH3FUYKI6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VG2VHC7ONXWLM6OQFRPXJDRRX43
  • CDSCEL6Q37WSJTV6H4PA4OD3TAZB2YGUYNJBOANMV2BJSCRFEVON3YRE
  • CDTMBQ6LJC5LOPGHIDBJFLCYRLSSUULN55H77WHRII3AS42OFGFX5UP6
  • CDV4SBPHAPP5PJO6XLWHBUTRS7PEZN2WX4PYMDNVLPUIHBLMOOMTUVMO
  • CDWD5GMUUDRTAE3FBJNRW3PDE5IWCM2TW2KVV5HRK3WF2Z6KDPTT7S7C
  • CDWXPYYJQFJTQXDONPI4C5E6OV3A72HSZE4ARBIOJKEIMQQ5AEYZ5RH4
  • CDY5IREHG23AQKJPMKPF2XQKCOX7XJXUTIKNVGA37ZPLTLE4YZCPWQOB

Interface

Spend wallet-held asset using spender authorization and stored allowance.

Auth:

  • Requires direct authorization from the spender address.

Effects:

  • Consumes allowance and transfers asset to the recipient.

Notes:

  • Rejects non-positive amounts. -spend_asset validates allowance, reduces it correctly, and transfers from wallet-controlled balance.
fn spend(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    spender: soroban_sdk::Address,
    amount: i128,
    to: soroban_sdk::Address,
) -> Result<(), WalletError>

Approve a spender to use wallet-held asset up to a given amount.

Auth:

  • Requires owner authorization through the wallet auth flow.

Effects:

  • Writes or updates spender allowance for the specified asset.

Notes:

  • Rejects negative amounts.
  • Enforces the configured asset spend limit.
fn approve(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    spender: soroban_sdk::Address,
    amount: i128,
    fee_pref: Option,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Deposit asset into the wallet.

Auth:

  • Requires authorization from the source address.

Effects:

  • Pulls asset from the source address into wallet-controlled balance.

Notes:

  • Rejects non-positive amounts. -take_asset transfers funds into the current contract context.
fn deposit(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    amount: i128,
) -> Result<(), WalletError>

Upgrade the current contract to the latest factory-approved wasm.

Auth:

  • Requires owner authorization through the wallet auth flow.

Effects:

  • Retrieves the approved wallet wasm hash from the factory.
  • Replaces the currently deployed contract code with that version.

Notes:

  • Authorization payload is bound to the target wasm hash.
  • Replay protection is enforced through the wallet authorization flow.
fn upgrade(
    env: soroban_sdk::Env,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Withdraw asset from the wallet to a recipient.

Auth:

  • Requires owner authorization through the wallet auth flow.

Effects:

  • Quotes and handles protocol transaction fees before withdrawal.
  • Transfers the requested asset amount from the wallet to the recipient.

Notes:

  • Rejects non-positive amounts.
  • Enforces the configured asset spend limit before withdrawal.
fn withdraw(
    env: soroban_sdk::Env,
    to: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    amount: i128,
    fee_pref: Option,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Returns the configured spend limit for an asset.

Audit note: Returning Option<i128> avoids overloading sentinel values (e.g. 0) and makes the semantics explicit:

  • Some(limit) → enforce the configured limit
  • None → no asset-specific limit configured
fn get_limit(env: soroban_sdk::Env, asset: soroban_sdk::Address) -> Option

Return the linked external owner wallet, if set.

Effects:

  • Reads owner state from storage.

Notes:

  • Read-only helper.
fn get_owner(env: soroban_sdk::Env) -> Option

Return wallet balance for the specified asset.

Effects:

  • Reads asset balance associated with the wallet.

Notes:

  • Read-only helper.
fn get_balance(env: soroban_sdk::Env, asset: soroban_sdk::Address) -> i128

Return the configured factory contract address, if set.

Effects:

  • Reads factory reference from storage.

Notes:

  • Read-only helper.
fn get_factory(env: soroban_sdk::Env) -> Option

Return the stored passkey, if configured.

Effects:

  • Reads passkey state from storage.

Notes:

  • Read-only helper.
fn get_passkey(env: soroban_sdk::Env) -> Option>

Invoke an external contract/dapp through the wallet.

Auth:

  • Requires owner authorization through the wallet auth flow.

Effects:

  • Validates top-level token operations against configured spend limits.
  • Optionally validates and registers deep auth entries.
  • Performs an external contract call with the provided function and args.

Notes:

  • Payload binds owner authorization to the target contract, function, args, and optional deep auth payload.
  • Deep auth entries are authorized only after owner auth succeeds.
fn dapp_invoker(
    env: soroban_sdk::Env,
    contract_id: soroban_sdk::Address,
    func: soroban_sdk::Symbol,
    args: Option>,
    auth_vec: Option<
        soroban_sdk::Vec>,
    >,
    fee_pref: Option,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result

Return the configured registry contract address, if set.

Effects:

  • Reads registry reference from storage.

Notes:

  • Read-only helper.
fn get_registry(env: soroban_sdk::Env) -> Option

Initialize wallet state and linked contract addresses.

Auth:

  • Intended to run once during wallet deployment/creation.

Effects:

  • Stores access keys and linked contract references.
  • Marks the wallet as initialized.

Notes:

  • Reverts if initialization was already completed.
fn __constructor(
    env: soroban_sdk::Env,
    challenge: soroban_sdk::BytesN<32>,
    passkey: soroban_sdk::BytesN<65>,
    passkey_sig: PasskeySignature,
    rpid_hash: soroban_sdk::BytesN<32>,
    bls_keys_pop: soroban_sdk::Vec,
    registry: soroban_sdk::Address,
    social_router: soroban_sdk::Address,
    fee_manager: soroban_sdk::Address,
    factory: soroban_sdk::Address,
    external_wallet: Option,
) -> Result<(), WalletError>

Return current allowance for a spender on a asset.

Effects:

  • Reads allowance state from storage.

Notes:

  • Read-only helper.
fn get_allowance(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    spender: soroban_sdk::Address,
) -> i128

Compute the authorization payload hash for a function call.

Effects:

  • Returns the payload derived from function name, args, and nonce.

Notes:

  • Read-only helper for off-chain signing flows.
  • Reviewers should confirm payload construction matches verification logic.
fn get_tx_payload(
    env: soroban_sdk::Env,
    func: soroban_sdk::String,
    args: soroban_sdk::Vec,
    valid_until_ledger: u32,
) -> Result, WalletError>

Rotate the wallet passkey.

Auth:

  • Requires authorization from the currently registered wallet passkey or g account.

Effects:

  • Replaces the existing wallet passkey with a newly provided passkey.
  • Increments wallet nonce after successful rotation.

Notes:

  • The new passkey must prove ownership by signing the rotation challenge.
  • Rotation challenge is derived from wallet-specific transaction nonce data.
  • Prevents replay through nonce-based challenge construction.
  • Rejects rotation if RP ID hash configuration is missing.
  • valid_until_ledger limits how long the authorization remains valid.
  • The new passkey is not activated unless both:
  • current owner authorization succeeds, and
  • proof-of-possession for the new passkey succeeds.
fn rotate_passkey(
    env: soroban_sdk::Env,
    new_passkey: soroban_sdk::BytesN<65>,
    new_passkey_pop_sig: PasskeySignature,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Return the configured fee manager contract address, if set.

Effects:

  • Reads fee manager reference from storage.

Notes:

  • Read-only helper.
fn get_fee_manager(env: soroban_sdk::Env) -> Option

Recover wallet access using the configured recovery mechanism.

Auth:

  • Requires valid recovery authorization from the registered recovery signer set through aggregated BLS signature verification.

Effects:

  • Replaces the current wallet passkey with a newly provided passkey.
  • Increments wallet nonce after successful recovery.

Notes:

  • Intended for account recovery after successful off-chain ownership verification and recovery approval flow.
  • The new passkey must prove ownership by signing the recovery challenge.
  • Recovery authorization is validated against the wallet recovery policy.
  • Recovery challenge is derived from wallet-specific transaction nonce data.
  • Prevents replay through nonce-based challenge construction.
  • Rejects recovery if RP ID hash configuration is missing.
  • valid_until_ledger limits how long the recovery authorization remains valid.
  • The new passkey is not activated unless both:
  • recovery authorization succeeds, and
  • proof-of-possession for the new passkey succeeds.
fn recover_account(
    env: soroban_sdk::Env,
    new_passkey: soroban_sdk::BytesN<65>,
    new_passkey_pop_sig: PasskeySignature,
    agg_bls_sig: soroban_sdk::BytesN<192>,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Set a asset-specific spend limit. Auth:

  • Requires owner authorization through the wallet auth flow.

Effects:

  • Stores a per-asset limit override.

Notes:

  • Rejects negative values.
  • Payload includes asset, limit, and nonce to prevent replay.
fn set_asset_limit(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    limit: i128,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Links a (platform, user_id) identity to this wallet in the registry.

Requires wallet authorization before forwarding the request to the registry. The mapping is used to associate an external identity (e.g. X, Discord, Telegram) with the current wallet address.

Validation of platform support, signature threshold, and identity ownership is enforced by the registry contract.

fn add_id_wallet_map(
    env: soroban_sdk::Env,
    user_id: soroban_sdk::String,
    platform_str: soroban_sdk::String,
    signatures: soroban_sdk::Vec,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Return the configured social router contract address, if set.

Effects:

  • Reads social router reference from storage.

Notes:

  • Read-only helper.
fn get_social_router(env: soroban_sdk::Env) -> Option

Set or replace the linked external owner wallet.

Auth:

  • Requires owner authorization through the wallet bls auth flow.

Effects:

  • Updates the stored external owner address.

Notes:

  • Payload includes the new address and nonce to prevent replay.
fn set_external_wallet(
    env: soroban_sdk::Env,
    external_wallet: soroban_sdk::Address,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Removes an existing (platform, user_id) identity mapping from the registry.

Requires wallet authorization before forwarding the request to the registry. This operation detaches the external identity from the current wallet address.

Registry-level validation ensures only valid and authorized removals occur.

fn remove_id_wallet_map(
    env: soroban_sdk::Env,
    user_id: soroban_sdk::String,
    platform_str: soroban_sdk::String,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Synchronizes wallet protocol dependencies from the currently configured factory.

SECURITY:

  • Dependencies are not accepted from caller input.
  • Reads approved protocol addresses directly from the trusted factory.
  • Keeps existing wallets aligned with current protocol configuration.
  • Synchronization is authenticated and nonce protected.
  • Updates only local dependency references and does not modify factory state.
fn sync_protocol_dependencies(
    env: soroban_sdk::Env,
    passkey_sig: Option,
    valid_until_ledger: u32,
) -> Result<(), WalletError>

Imports

WebAssembly Text (WAT) ▶