NewSwapCallback
Ask AI
NewSwapCallback returns the callback of one round's pool.Swap. It pays the pool the round input, at most maxAmountIn of tokenIn, from the escrow.
The callback is declared in this realm, so it transfers as the escrow itself: the escrow never grants an allowance for a swap. That makes the callback a payment capability, so it is guarded on creation and on use:
- only the escrow's own current realm can create one, so only code the proxy hands its realm to (the active implementation) can;
- only the pool can invoke it (cur.Previous()); the pool's swap lock admits no other swap while a round's swap runs;
- it pays only while a round is executing, once, and only an exact-input delta of the sold token: positive input, no positive output, at most maxAmountIn.
zeroForOne is the swap direction: it selects which pool delta is tokenIn.
Command
gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.NewSwapCallback(,,,,)"
Result