Opty-Fi/defi-legos

Wrong signature for calc_token_amount function in ICurveSwap.sol

Closed this issue · 0 comments

In ICurveSwap.sol, this is one of the functions:
function calc_token_amount(uint256[] calldata amountsIn, bool deposit) external view returns (uint256);
However, that signature is not valid for any swap pool. Instead, the first argument should be a fixed-length array, so we should have multiple functions:
function calc_token_amount(uint256[2] calldata amountsIn, bool deposit) external view returns (uint256);
function calc_token_amount(uint256[3] calldata amountsIn, bool deposit) external view returns (uint256);
function calc_token_amount(uint256[4] calldata amountsIn, bool deposit) external view returns (uint256);