DexAggregatorUManager

Git Source

Inherits: UManager

Required Merkle Root Leaves

  • ERC20 approves with router spender.

  • AggregationRouterV5.swap, with all desired addresses.

State Variables

MAX_SLIPPAGE

uint256 internal constant MAX_SLIPPAGE = 0.1e4;

allowedSlippage

Slippage check enforced after swaps.

uint16 public allowedSlippage = 0.0005e4;

router

The 1Inch Router.

AggregationRouterV5 internal immutable router;

priceRouter

The PriceRouter contract used to check slippage.

Functions

constructor

setAllowedSlippage

Sets the maximum allowed slippage during a swap.

Callable by MULTISIG_ROLE.

swapWith1Inch

Performs a swap using the 1inch Router, and enforces a slippage check.

Callable by STRATEGIST_ROLE.

Parameters

Name
Type
Description

manageProofs

bytes32[][]

2 manage proofs, the first one for the ERC20 approval, and the second for the router swap call

decodersAndSanitizers

address[]

2 DecodersAndSanitizers one that implements ERC20 approve, and one that implements AggregationRouterV5.swap

tokenIn

ERC20

amountIn

uint256

tokenOut

ERC20

data

bytes

Events

SlippageUpdated

Errors

DexAggregatorUManager__Slippage

DexAggregatorUManager__NewSlippageTooLarge

Was this helpful?