toMultichainNexusAccount
, .getQuote
and .execute
steps to work with EIP-7702. Follow the EIP-7702 guide hereSetup
Create an Orchestrator
Connect to the Modular Execution Environment (MEE)
Declare Constants
Build Instructions
ERC-20
approve
function which approves the Uniswap contract to spend USDC.type: "default"
and erc20Abi
if needed..buildComposable
helper, we are encoding a call to the exactInputSingle
function on the Uniswap contract. This will swap USDC for WETH.Note the use of runtimeERC20BalanceOf
in the amountIn
field of the call. This means that we’re not predetermining the amount being swapped - we’ll use whatever is available on the orchestrator account.runtimeERC20BalanceOf
function. Since we don’t know how much exactly we’ll get from a swap on Uniswap due to slippage - we’re working with runtime values.Another thing to note is the constraints
field. It defines the minimum amount of WETH on the account before the orchestration will proceed with the approve instruction.balanceNotZeroConstraint
defines that the instruction can’t be executed until the swap has happenedQuote & Execute (Fusion)
trigger
param. It tells the orchestrator which token on which chain and which amount to approve.Read more about triggersConfirm Atomic Completion
amountOutMinimum: 0n
with real slippage.gasLimit
s to optimize quotes.transfer
if leftover tokens aren’t desired.