Contract e5e61ce5ab4adb743dc6c091e61dc9fcfa05fa32f3f4c3fec1d9aff2240ade1a

← Back to Index 📥 Download WASM

Meta

rssdkver 23.0.2#a97daf8b07cdf24e9bd45e344db51a21b9ea77d3
rsver 1.89.0

Instances

  • CAWVL7UTQUKINOYR6HVDYGX7JHHA67B2TDQZQ2HTRUUFEZYF7B3BW2GD
  • CDLENIRNJ5ARIN43WAUEROT34C2HPQHJ3KOVESU5EFZM2O2FW4ABQLHH

Interface

Execute flash loan with custom flash strategy

This is the safe entry point for all flash loans. The FlashExecutor:

  1. Validates the user authorized this transaction (user.require_auth)
  2. Calls flash_begin() as the initiator (only FlashExecutor is authorized)
  3. Invokes the user's FlashStrategy contract with borrowed tokens
  4. Always calls flash_end() to verify repayment

Arguments

  • pool - Pool address to borrow from
  • strategy - User's strategy contract address
  • user - Address of user initiating the flash loan (must sign transaction)
  • amount0 - Amount of token0 to borrow
  • amount1 - Amount of token1 to borrow
  • data - Arbitrary data passed to strategy

Strategy Access Control

Strategies receive user in FlashStrategyParams and can:

  • Ignore it for permissionless execution (default)
  • Check against allowlist for restricted access
  • Implement custom authorization logic

Returns

  • Ok(()) - Flash loan executed successfully
  • Err(Error) - Flash loan failed (insufficient repayment, strat
fn execute_flash_loan(
    env: soroban_sdk::Env,
    pool: soroban_sdk::Address,
    strategy: soroban_sdk::Address,
    user: soroban_sdk::Address,
    amount0: u128,
    amount1: u128,
    data: soroban_sdk::Bytes,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶