Spark
Disassembling
Swap sDAI
- Label: Exit_Swap-sDAI-USDC-CoW
- Description: Swap sDAI for USDC in CoW
- Actions in execution process:
- Swap sDAI for USDC in CowSwap
 
Note: When using the Pilot Extension and the Agile Execution App, all swaps will be routed through a delegate call to the OrderSigner(opens in a new tab) (opens in a new tab) in order to facilitate parameter scoping and minimize risks.
SELL_TOKEN · approve
Approve GPv2VaultRelayer to spend sDAI tokens on behalf of the avatar.
- 
Contract: SELL_TOKEN
- 
Function: approve(address,uint256)Parameter Constraint spenderequal to GPv2VaultRelayeramountequal to the sDAIamount to swap
OrderSigner · signOrder
Sign order to swap sDAI to USDC.
- 
Contract: OrderSigner
- 
Function: signOrder((address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32),uint32,uint256)→ delegatecallParameter Constraint order.sellTokenequal to sDAIorder.buyTokenequal to USDCorder.receiverequal to AVATARorder.sellAmountequal to the sDAIamount to swaporder.buyAmountequal to the sDAIamount to swap minus themaximum slippageorder.validToequal to time_now + validDuration order.appData- order.feeAmountequal to 0 order.kindequal to sellorder.partiallyFillableFalseorder.sellTokenBalance- order.buyTokenBalance- validDurationequal to 10 mins feeAmountBplower or equal to FEE_AMOUNT_BP
Redeem sDAI for DAI
- Label: Exit_Spark-sDAI
- Description: Redeem sDAI and withdraw DAI
- Actions in execution process:
- Redeem
 
sDAI · redeem
Redeem sDAI and withdraw DAI.
- 
Contract: sDAI
- 
Function: redeem(uint256,address,address)Parameter Constraint sharesamount of sDAItokens to redeemreceiverequal to AVATARownerequal to AVATAR