Contract 7291c46304b77d1f183efc2f546742e0063fab0e9318f3cb0fa6152762def706

← Back to Index 📥 Download WASM

Meta

rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.91.0

Instances

  • CBAHFCZTFGD2YDMTM3REWTUQWRMIBYFHPNUDGZWUGYHBVCNPEUNWIYMG

Interface

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
fn get_admin(env: soroban_sdk::Env) -> Option
fn set_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
) -> Result<(), ContractError>
fn get_base_fee(env: soroban_sdk::Env) -> Result
fn set_base_fee(env: soroban_sdk::Env, fee: i128) -> Result<(), ContractError>
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    base_fee: i128,
    max_deferred_fee: i128,
) -> Result<(), ContractError>
fn get_deferred_fee(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
) -> Result

Settles a wallet's accumulated deferred protocol fees.

Security model:

  • payer MUST authorize the payment.
  • wallet identifies the wallet whose deferred fee balance is being settled.
  • added_base_fee allows the caller to atomically include the current transaction fee into settlement instead of writing deferred state first. Notes:
  • Passing added_base_fee = 0 settles only existing deferred fees.
  • Passing added_base_fee > 0 is intended for wallet execution flows where the current transaction fee should be collected immediately.
  • Third parties are not allowed to inject additional fees.
fn settle_wallet_fee(
    env: soroban_sdk::Env,
    payer: soroban_sdk::Address,
    wallet: soroban_sdk::Address,
    fee_asset: soroban_sdk::Address,
    added_base_fee: i128,
) -> Result<(), ContractError>
fn get_fee_asset_rate(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
) -> Result
fn set_fee_asset_rate(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    rate: i128,
) -> Result<(), ContractError>
fn get_max_deferred_fee(env: soroban_sdk::Env) -> Result
fn set_max_deferred_fee(env: soroban_sdk::Env, fee: i128) -> Result<(), ContractError>
fn quote_transaction_fee(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
    tx_asset: soroban_sdk::Address,
    tx_amount: i128,
) -> Result
fn is_supported_fee_asset(env: soroban_sdk::Env, asset: soroban_sdk::Address) -> bool
fn add_supported_fee_asset(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    rate: i128,
) -> Result<(), ContractError>

Withdraw collected protocol fees from the fee manager.

  • Allows the admin to transfer accumulated fee assets out of the contract.

Validation:

  • Caller must be admin.
  • Asset must be a supported fee asset.
  • Amount must be positive.
  • Withdrawal cannot exceed the contract's asset balance.

Emits:

  • WithdrawFeeEvent(asset, amount, to)
fn withdraw_collected_fees(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    amount: i128,
    to: soroban_sdk::Address,
) -> Result<(), ContractError>
fn get_supported_fee_assets(
    env: soroban_sdk::Env,
) -> soroban_sdk::Vec
fn remove_supported_fee_asset(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
) -> Result<(), ContractError>

Increases the deferred fee balance for a wallet.

Purpose: Allows a wallet to accumulate unpaid protocol fees in base fee units for later settlement.

Security:

  • Only the wallet itself may authorize deferred fee increases.
  • The function only permits increasing the balance.
  • Negative or zero increments are rejected.
  • Overflow is rejected.

Behavior: previous_deferred_fee + added_base_fee → updated_deferred_fee

Notes:

  • This function is called when fee is deferred.
fn update_wallet_deferred_fee(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
    added_base_fee: i128,
) -> Result

Imports

WebAssembly Text (WAT) ▶