Contract fd467fae9029ada13c4d3c1fd55117494c19c4a119917ce8f06ecc176228acdd

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.81.0

Instances

  • CA3Q5TEHGZTEM3VE7UFQ4HASPPIZYX5ELEAU33PPVZKLN5O2LC7OFHGR
  • CADFIJXEOJ4FXYOKEZDFXD2W4GS4YQ76JO7KCLIFYRAY7IY2BTF6RZZA
  • CBQPFXE7TLM6KU3GXU43II7B5WK2OU4NOROS7NGXNBVQCSPGO5Z6KEBP
  • CC2SOSC6WXLPEZKVZ2QWO3SOJJAYON4VEJGWOJPCBSUQ7Y5PP67G5MZ4

Interface

Initialize the contract with fee wallet, token address, and platform fee rate

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    fee_wallet: soroban_sdk::Address,
    token_address: soroban_sdk::Address,
    platform_fee_rate: u32,
) -> Result<(), soroban_sdk::Error>

Split payment between platform and merchant with percentage-based fee

fn split_payment(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    payment_id: soroban_sdk::String,
    merchant: soroban_sdk::Address,
    total_amount: i128,
) -> Result<(), soroban_sdk::Error>

Split payment with fixed fee amounts (no percentage calculation)

fn split_payment_fixed(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    payment_id: soroban_sdk::String,
    merchant: soroban_sdk::Address,
    merchant_amount: i128,
    platform_fee_amount: i128,
) -> Result<(), soroban_sdk::Error>

Get payment details by ID

fn get_payment(
    env: soroban_sdk::Env,
    payment_id: soroban_sdk::String,
) -> Option

Get total number of payments processed

fn get_payment_count(env: soroban_sdk::Env) -> u64

Update fee wallet (admin only)

fn update_fee_wallet(
    env: soroban_sdk::Env,
    new_fee_wallet: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Update platform fee rate (admin only)

fn update_platform_fee_rate(
    env: soroban_sdk::Env,
    new_rate: u32,
) -> Result<(), soroban_sdk::Error>

Get current fee wallet

fn get_fee_wallet(env: soroban_sdk::Env) -> soroban_sdk::Address

Get current platform fee rate

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

Get current token address

fn get_token_address(env: soroban_sdk::Env) -> soroban_sdk::Address

Imports

WebAssembly Text (WAT) ▶