Contract c7bb4fea87e25db9fa7cf68b3c01a54c2644ab9c7102d2e5a08fae653639fccb

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.92.0

Instances

  • CCX4B62X7LDIVWQQEYINWRP7SAER5K2I4NSLYRHUUTAL3MGPWDYWC3VX

Interface

Called when the signer is added to a smart account. Records the expiry ledger for this wallet.

fn on_add(env: soroban_sdk::Env, source: soroban_sdk::Address)

Called when the signer is revoked from a smart account. Cleans up the expiry data.

fn on_revoke(env: soroban_sdk::Env, source: soroban_sdk::Address)

Get the expiry data for a wallet. Returns None if wallet has no registered session.

fn get_expiry(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
) -> Option

Initialize the policy contract with a custom duration. Can only be called once (by deployer).

Arguments

  • duration_ledgers - Number of ledgers until expiry (e.g., 120960 for 7 days)
fn initialize(env: soroban_sdk::Env, duration_ledgers: u32)

Check if a wallet's session signer has expired. This is a view function for frontend use.

Returns

  • true if expired or never registered
  • false if still valid
fn is_expired(env: soroban_sdk::Env, wallet: soroban_sdk::Address) -> bool

Get the configured duration in ledgers.

fn get_duration(env: soroban_sdk::Env) -> u32

Called during every signature verification. Returns false if the session has expired.

fn is_authorized(
    env: soroban_sdk::Env,
    source: soroban_sdk::Address,
    _contexts: soroban_sdk::Vec,
) -> bool

Get remaining ledgers until expiry. Returns 0 if already expired or not registered.

fn remaining_ledgers(env: soroban_sdk::Env, wallet: soroban_sdk::Address) -> u32

Imports

WebAssembly Text (WAT) ▶