feat: Refactor Curve Executor not to use the router
We don't need to use all the functionalities of the Curve Router, only the swap type 1 (exchange). By bypassing the router we can save gas on 2 token transfers and with smaller calldata A nice side effect is that the executor is much more readable and understandable now --- don't change below this line --- ENG-4305 Took 2 hours 25 minutes Took 12 seconds
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
pragma solidity ^0.8.26;
|
||||
|
||||
/**
|
||||
* @title Curve Router Interface
|
||||
* @notice Interface for interacting with Curve's router contract for token swaps across various Curve pools
|
||||
* @dev This interface allows for executing swaps through Curve's router, which can handle different pool types
|
||||
*/
|
||||
interface ICurveRouter {
|
||||
/**
|
||||
* @notice Executes a token swap through Curve pools
|
||||
* @dev This function handles the routing of tokens through one or more Curve pools
|
||||
* @dev The parameters are encoded in the `CurveRouterParams` struct
|
||||
* @return Amount of output tokens received from the swap
|
||||
*/
|
||||
function exchange(
|
||||
address[11] memory route,
|
||||
uint256[5][5] memory swapParams,
|
||||
uint256 amountIn,
|
||||
uint256 minAmountOut,
|
||||
address[5] memory pools,
|
||||
address receiver
|
||||
) external payable returns (uint256);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user