Skip to main content

AggregationRouterV5

Derives

Functions

constructor

function constructor(
address weth,
contract IClipperExchangeInterface _clipperExchange
) public

Parameters:

NameTypeDescription
wethaddress
_clipperExchangecontract IClipperExchangeInterface

swap

function swap(
contract IAggregationExecutor caller,
struct AggregationRouterV4.SwapDescription desc,
bytes data
) external returns (uint256 returnAmount, uint256 gasLeft)

Performs a swap, delegating all calls encoded in data to caller. See tests for usage examples

Parameters:

NameTypeDescription
callercontract IAggregationExecutorAggregation executor that executes calls described in data
descstruct AggregationRouterV4.SwapDescriptionSwap description
databytesEncoded calls that caller should execute in between of swaps

Return Values:

NameTypeDescription
returnAmountuint256Resulting token amount
gasLeftuint256Gas left

rescueFunds

function rescueFunds(
contract IERC20 token,
uint256 amount
) external

Parameters:

NameTypeDescription
tokencontract IERC20
amountuint256

destroy

function destroy(
) external

Events

Swapped

event Swapped(
address sender,
contract IERC20 srcToken,
contract IERC20 dstToken,
address dstReceiver,
uint256 spentAmount,
uint256 returnAmount
)

Parameters:

NameTypeDescription
senderaddress
srcTokencontract IERC20
dstTokencontract IERC20
dstReceiveraddress
spentAmountuint256
returnAmountuint256