Contract 20cc19bb76c164bba8280713a9abaeb4d0d37b05bb81a8c6aba4e682160f6d15

← Back to Index 📥 Download WASM

Meta

cliver 23.3.0#08473ac20016c369067ce0dbca91d9595e72d6d4
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.94.0

Instances

  • CCT4GZY4SGJX76L4CIIJZ2XI3EJ5NF3G52IK73B2GJ6W3MD43WXTPYTT

Interface

Atomically pull withdraw_amount of token out of the Rain collateral (via coordinator) back into the wallet, verify it arrived exactly, then send transfer_amount from the wallet to recipient.

caller is the collateral owner (the user's wallet) and the withdrawal recipient. token is both the withdrawn asset and the transferred token; it must report [EXPECTED_DECIMALS] decimals. All amounts are token SMALLEST UNITS.

Reverts (nothing moves) if a guard fails, if the wallet's balance does not increase by exactly withdraw_amount, if the Coordinator rejects, or if the wallet cannot cover transfer_amount.

fn withdraw_and_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    coordinator: soroban_sdk::Address,
    collateral: soroban_sdk::Address,
    token: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    withdraw_amount: i128,
    transfer_amount: i128,
    auth: WithdrawAuth,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶