Contract dff7bb41cd554e2fa134dd0b345e3dc995336a6248134a334fc9a74542bdb6e4

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.88.0

Instances

  • CBPL4TVZUM4TAHSRISO4CNNPWAIGMQLUN5MB4MDVZ5ZL3SRRTN56CVNG
  • CBPN4552YNJWKJ652GGILUPWN56KLYE7RP2SANPMPAJDJR7Z45T5UVEB
  • CBX3ET3JMZQCQF74YN2PR35ALF3EI73VMYWUX33WKTQMY62I2YR2YWFU
  • CBYL7F64WVJIUKKUOTUJ4UDVCKQMGOWDKPTYAB4ZR5IFXUF7EO2V5SKX

Interface

Initialize a new escrow with deterministic address calculation This function should be called by a factory contract that deploys this escrow with a deterministic address based on the immutables hash

fn deploy(
    env: soroban_sdk::Env,
    order_hash: soroban_sdk::BytesN<32>,
    hashlock: soroban_sdk::BytesN<32>,
    maker: soroban_sdk::Address,
    taker: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
    safety_deposit: i128,
    timelocks: u64,
) -> soroban_sdk::Address

Get the hash of the current escrow's immutables This can be used by external contracts to verify the escrow address

fn get_immutables_hash(env: soroban_sdk::Env) -> soroban_sdk::BytesN<32>

Withdraw funds by revealing the secret

fn withdraw(
    env: soroban_sdk::Env,
    secret: soroban_sdk::BytesN<32>,
    _unwrap_native: bool,
)

Cancel escrow and return funds

fn cancel(env: soroban_sdk::Env, caller: soroban_sdk::Address)

Public withdrawal after timelock expiry

fn public_withdraw(
    env: soroban_sdk::Env,
    secret: soroban_sdk::BytesN<32>,
    caller: soroban_sdk::Address,
)

Get current escrow state

fn get_state(env: soroban_sdk::Env) -> State

Get escrow immutables

fn get_immutables(env: soroban_sdk::Env) -> Immutables

Imports

WebAssembly Text (WAT) ▶