Contract 4a3572f0356a0a498972feebb05ddf58afead367ad4b82468d220f7aa9d5b2a6

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.96.0

Instances

  • CB27QUFCHNKHBNDK7GCV5OSB7SNDZMEUIHFB2HBZKF46JNJNNJDVNV7Z

Interface

One-time, immutable configuration. No admin/owner is stored — there is deliberately no upgrade or withdrawal path.

fn init(
    env: soroban_sdk::Env,
    usdc: soroban_sdk::Address,
    fee_recipient: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

The USDC asset this splitter settles (immutable).

fn usdc(env: soroban_sdk::Env) -> Result

Settle one payment: transfer the provider share + protocol fee directly from the buyer under their authorization, atomically, in one transaction.

payer.require_auth() binds every routing arg into the buyer's signed authorization, so the buyer's signature authorizes exactly this split. A wrong route/total recomputes a different authorization payload and the host rejects it; a reused authorization fails on the consumed nonce.

fn settle(
    env: soroban_sdk::Env,
    payer: soroban_sdk::Address,
    provider: soroban_sdk::Address,
    provider_amount: i128,
    fee_amount: i128,
    total: i128,
    resource_id: soroban_sdk::BytesN<32>,
    payment_config_version: u32,
    valid_before: u64,
    payer_salt: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>

The protocol-fee recipient (immutable).

fn fee_recipient(
    env: soroban_sdk::Env,
) -> Result

Imports

WebAssembly Text (WAT) ▶