Contract 2c2daf0532b24fd00a03222701c7a22b45958f378b807391dab0852e098e18c6

← Back to Index 📥 Download WASM

Meta

binver 2.0.0
cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.93.1

Instances

  • CBWY75BGXII7KOCWWRHKCJ5LXOZZGKIBS6SVYJODYOIMWQ5WPRFR3GGV

Interface

Forwards amount of token from from directly to receiver and emits a Deposited event. Native XLM is deposited by passing the XLM Stellar Asset Contract as token.

from must authorize this call and the nested token.transfer (one signed auth tree). The token itself rejects negative amounts and insufficient balances; no other validation is performed — receiver legitimacy is enforced off-chain by the Layerswap backend.

fn deposit(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    id: soroban_sdk::BytesN<32>,
    token: soroban_sdk::Address,
    receiver: soroban_sdk::Address,
    amount: i128,
)

Forwards from's entire allowance granted to this contract to receiver and emits a Deposited event. Companion to deposit for flows where the amount was fixed in an earlier token.approve(from, depository, amount, live_until_ledger) transaction.

from must authorize this call — the allowance alone must not let a third party spend it with their own id/receiver. Do NOT use with "infinite" approvals: transferring the full allowance fails on insufficient balance. Use deposit instead.

fn deposit_allowance(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    id: soroban_sdk::BytesN<32>,
    token: soroban_sdk::Address,
    receiver: soroban_sdk::Address,
)

Imports

WebAssembly Text (WAT) ▶