chore: cleanup
This commit is contained in:
committed by
Diana Carvalho
parent
c3d36ae25f
commit
05ea2c7734
@@ -1,28 +1,29 @@
|
||||
// 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 {
|
||||
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);
|
||||
|
||||
// slither-disable-next-line naming-convention
|
||||
function get_dy(
|
||||
address[] memory route,
|
||||
uint256[] memory swapParams,
|
||||
uint256 amountIn,
|
||||
address[] memory pools
|
||||
) external view returns (uint256);
|
||||
|
||||
|
||||
}
|
||||
|
||||
struct CurveRouterParams {
|
||||
/**
|
||||
* @notice Parameters for executing a swap through the Curve router
|
||||
* @dev This struct encapsulates all necessary parameters for a Curve swap
|
||||
* @param route Array of addresses representing the swap path (tokens and pools)
|
||||
* @param swapParams 2D array containing swap parameters for each hop:
|
||||
* [0]: tokenIn index in the pool
|
||||
* [1]: tokenOut index in the pool
|
||||
* [2]: swap type (1 for regular swap)
|
||||
* [3]: pool type (1-4 depending on the Curve pool implementation)
|
||||
* [4]: number of coins in the pool
|
||||
* @param amountIn Amount of input token to swap
|
||||
* @param minAmountOut Minimum amount of output token to receive
|
||||
* @param pools Array of pool addresses involved in the swap
|
||||
* @param receiver Address to receive the output tokens
|
||||
*/
|
||||
struct CurveRouterParams {
|
||||
address[11] route;
|
||||
uint256[5][5] swapParams;
|
||||
uint256 amountIn;
|
||||
@@ -31,3 +32,21 @@ interface ICurveRouter {
|
||||
address receiver;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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