Contract a19f563e764dfd52a0d229c063e7ac1a1b36f6a976f552a8e19b91ee8e4ef84a

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.97.1

Instances

  • CCQ3LI76R3EN7MKC7NQOW744BAJPGXWJNDWNORBX6BVFYZUYXUT2WAZJ

Interface

Settle an upto authorization for actual_amount, which must not exceed the signed ceiling.

The client authorizes (token, to, max_amount, expiration_ledger, nonce). actual_amount is supplied by the facilitator at settlement and is intentionally outside the signed tuple.

  • token — SEP-41 token contract, signed by the client.
  • from — the payer, whose authorization is required.
  • to — the recipient, signed by the client so it cannot be redirected.
  • max_amount — the authorized ceiling, signed by the client.
  • expiration_ledger — last ledger at which this authorization is valid, signed.
  • nonce — client-chosen unique value making the authorization single-use, signed.
  • actual_amount — metered charge. NOT signed. Must satisfy 0 <= actual <= max_amount.
fn settle(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    max_amount: i128,
    expiration_ledger: u32,
    nonce: soroban_sdk::BytesN<32>,
    actual_amount: i128,
    hook: Option,
) -> Result<(), soroban_sdk::Error>

Whether a given (payer, nonce) authorization has already been settled.

Lets a facilitator check before submitting, turning a wasted transaction into a fast coded rejection.

fn is_used(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    nonce: soroban_sdk::BytesN<32>,
) -> bool

Imports

WebAssembly Text (WAT) ▶