Contract 30bf11dd3dc7a5f07ad15076583a5b5d9c8e9103687ab0e8e400e471fc37d00a

← Back to Index 📥 Download WASM

Meta

cliver 27.1.0#8e402ea28202950b272fbabc34caad4d2f64fe87
rssdk_spec_shaking 2
rssdkver 26.1.1#8ac18efb681a1c0b4b85a38c5a380300344e3f39
rsver 1.98.1
source_commit 26b0f4577a17dfa365e463577f312a5ede34adc3

Instances

  • CBVILCOZNZAIZU6VURAPBOATKSZNP3POVX3MJOMDMHAPJEK446JF3QRM

Interface

Executes calls in order and returns each call's raw return value, in call order.

Any failing call traps the whole invocation, so either every call lands or none does.

Arguments

  • e - Access to the Soroban environment.
  • calls - The Call sequence, executed front to back.
fn multicall(
    env: soroban_sdk::Env,
    calls: soroban_sdk::Vec,
) -> soroban_sdk::Vec

Executes calls in order, isolates each call's failure, and returns one raw outcome per call, in call order. An outcome is the call's raw return value when it lands, or the failure as a host Error value when it does not.

A call that fails with a recoverable error rolls back its own effects, and the batch continues with the next call. A budget or storage-footprint limit aborts the whole transaction. The two outcome kinds cannot collide, because the host turns an error-tagged return into a failure.

Arguments

  • e - Access to the Soroban environment.
  • calls - The Call sequence, executed front to back.
fn multicall_try(
    env: soroban_sdk::Env,
    calls: soroban_sdk::Vec,
) -> soroban_sdk::Vec

Runs a create-and-fill batch strictly, fills calls[0], and returns the N batch results with the fill payout appended (length N + 1). The payout is an i128 (token-dec).

By convention, calls[0] is the order to fill, and it targets the market contract (calls[0].contract). Its u32 return value is the order id handed to the fill. A failing fill unwinds the whole batch, so nothing rests.

Arguments

  • e - Access to the Soroban environment.
  • calls - The batch, executed like multicall. The router does not check the shape of calls[0], and later calls are never filled.
  • user - The trader who owns the order, passed to execute_order. It is an explicit argument, not decoded from calls[0].
  • keeper - The fill-reward recipient. With keeper = user the fill reward returns to the trader.
  • price - The serialized price update for the fill.

Notes

  • Traps on empty calls: there is no first call to fill.
  • Traps when calls[0] returns anything but a u32 order id.
fn create_and_fill(
    env: soroban_sdk::Env,
    calls: soroban_sdk::Vec,
    user: soroban_sdk::Address,
    keeper: soroban_sdk::Address,
    price: soroban_sdk::Bytes,
) -> soroban_sdk::Vec

Collects a relayer fee from user, then acts as multicall, returning its results. A failing call also reverts the fee. With empty calls, the fee is still collected.

Arguments

  • e - Access to the Soroban environment.
  • calls - The batch.
  • user - The fee payer.
  • fee_token - The fee token.
  • max_fee_amount - The fee cap (token-dec).
  • fee_expiration - The allowance's live-until ledger, at or after execution.
  • fee_amount - The fee (token-dec). 0 skips it.
  • fee_recipient - The fee payee.

Errors

  • FeeAbstractionError::InvalidFeeBounds - If fee_amount is negative or above max_fee_amount.
  • FeeAbstractionError::InvalidUser - If user is the router.

Events

  • topics - ["fee_collected", user: Address, recipient: Address]
  • data - [token: Address, amount: i128]

Notes

  • Authorization for user is required over (calls, fee_token, max_fee_amount, fee_expiration). Inner call auths nest under it. The submitter sets fee_amount and fee_recipient.
fn multicall_with_fee(
    env: soroban_sdk::Env,
    calls: soroban_sdk::Vec,
    user: soroban_sdk::Address,
    fee_token: soroban_sdk::Address,
    max_fee_amount: i128,
    fee_expiration: u32,
    fee_amount: i128,
    fee_recipient: soroban_sdk::Address,
) -> soroban_sdk::Vec

Runs a create-and-fill batch strictly, then attempts an immediate fill, and returns the N batch results with the isolated fill outcome appended (length N + 1). The outcome is encoded like multicall_try: the payout (i128, token-dec) on a landed fill, or the failure as a host Error value when it rests.

The batch follows the first-call convention of create_and_fill. A fill that fails with a recoverable error leaves the orders still standing after the batch available for a later keeper fill. A budget or storage-footprint limit in the fill aborts the whole transaction.

Arguments

  • e - Access to the Soroban environment.
  • calls - The create-and-fill batch. calls[0] is the order to fill.
  • user - The trader who owns the order, passed to the fill.
  • keeper - The fill-reward recipient.
  • price - The serialized price update for the fill.

Notes

  • Traps on empty calls: there is no first call to fill.
  • Traps when calls[0] returns anything but a u32 order id.
fn create_and_try_fill(
    env: soroban_sdk::Env,
    calls: soroban_sdk::Vec,
    user: soroban_sdk::Address,
    keeper: soroban_sdk::Address,
    price: soroban_sdk::Bytes,
) -> soroban_sdk::Vec

Collects a relayer fee from user, then acts as create_and_fill, returning its results. A failing fill also unwinds the fee.

Arguments

  • e - Access to the Soroban environment.
  • calls - The batch.
  • user - The trader and fee payer.
  • fee_token - The fee token.
  • max_fee_amount - The fee cap (token-dec).
  • fee_expiration - The allowance's live-until ledger.
  • fee_amount - The fee (token-dec). 0 skips it.
  • fee_recipient - The fee payee.
  • keeper - The fill-reward recipient.
  • price - The price update.

Errors

  • FeeAbstractionError::InvalidFeeBounds - If fee_amount is negative or above max_fee_amount.
  • FeeAbstractionError::InvalidUser - If user is the router.

Events

  • topics - ["fee_collected", user: Address, recipient: Address]
  • data - [token: Address, amount: i128]

Notes

  • Authorization for user is required over (calls, fee_token, max_fee_amount, fee_expiration). Inner call auths nest under it.
  • Traps on empty calls or a non-u32 first result.
fn create_and_fill_with_fee(
    env: soroban_sdk::Env,
    calls: soroban_sdk::Vec,
    user: soroban_sdk::Address,
    fee_token: soroban_sdk::Address,
    max_fee_amount: i128,
    fee_expiration: u32,
    fee_amount: i128,
    fee_recipient: soroban_sdk::Address,
    keeper: soroban_sdk::Address,
    price: soroban_sdk::Bytes,
) -> soroban_sdk::Vec

Collects a relayer fee from user, then acts as create_and_try_fill, returning its results. A resting fill keeps the fee.

Arguments

  • e - Access to the Soroban environment.
  • calls - The batch.
  • user - The trader and fee payer.
  • fee_token - The fee token.
  • max_fee_amount - The fee cap (token-dec).
  • fee_expiration - The allowance's live-until ledger.
  • fee_amount - The fee (token-dec). 0 skips it.
  • fee_recipient - The fee payee.
  • keeper - The fill-reward recipient.
  • price - The price update.

Errors

  • FeeAbstractionError::InvalidFeeBounds - If fee_amount is negative or above max_fee_amount.
  • FeeAbstractionError::InvalidUser - If user is the router.

Events

  • topics - ["fee_collected", user: Address, recipient: Address]
  • data - [token: Address, amount: i128]

Notes

  • Authorization for user is required over (calls, fee_token, max_fee_amount, fee_expiration). Inner call auths nest under it.
  • Traps on empty calls or a non-u32 first result.
fn create_and_try_fill_with_fee(
    env: soroban_sdk::Env,
    calls: soroban_sdk::Vec,
    user: soroban_sdk::Address,
    fee_token: soroban_sdk::Address,
    max_fee_amount: i128,
    fee_expiration: u32,
    fee_amount: i128,
    fee_recipient: soroban_sdk::Address,
    keeper: soroban_sdk::Address,
    price: soroban_sdk::Bytes,
) -> soroban_sdk::Vec

Imports

WebAssembly Text (WAT) ▶