Stage the plan in temporary storage.
The two-argument shape is the deployed orchestrator's ABI: it calls
receiver.a(b, h) with the two opaque Vals it was handed. _h is
Parallax's sub-auth list, which this contract does not use — its
authorizations are derived on-chain, not supplied.
Permissionless, like Parallax v5's a. Nothing here moves money, the
entry is temporary, and exec_op deletes it before doing anything —
and both calls live inside the orchestrator's single invocation, so no
other transaction can interleave with them.
fn a(env: soroban_sdk::Env, p: Plan, h: soroban_sdk::Val)
Blend flash-loan callback: buy the bid with the borrowed asset, win the
auction, convert the non-principal side of the lot, hand everything to
caller.
caller — the from of pool.flash_loan, i.e. the orchestrator. It
owes the pool the repayment and holds the allowance to satisfy it, so
this is where the proceeds must go. It is verified against the
pinned orchestrator, not trusted: see the check at the top of the body.token_addr — the loaned asset. Used as the join asset, the lot's
principal asset and the repay asset.c / d — borrowed amount and fee. c + d is the real repayment
obligation Blend enforces a frame later; the hand-back must clear it
(and Plan.min_repay, the priced floor). The whole balance still goes
back — Blend's fee is rounding dust and any surplus is profit — but the
loan is no longer discarded: it is the structural lower bound.Panics — reverting the loan with it — on any bound violation, and propagates Comet's and Blend's panics untouched. A lost ra
fn exec_op(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
token_addr: soroban_sdk::Address,
c: i128,
d: i128,
)
Pin the orchestrator at deploy time. This is the only persistent state the contract ever holds and there is no setter, so the address is immutable for the life of the deployment — the same discipline the orchestrator itself uses for its payout address.
exec_op will hand the swept balance to exactly this address and refuse
to run for any other caller. In production it is the deployed
orchestrator CA4I5TPQ….
fn __constructor(env: soroban_sdk::Env, orchestrator: soroban_sdk::Address)