-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using wrappedToken in CompositeLiquidityRouter in ERC4626Pool operations #1201
base: main
Are you sure you want to change the base?
Changes from 11 commits
1ca2458
757545a
9dbf7fc
4b39b72
f6bcd4e
413315d
c441933
164cdae
6d7f538
c4a2662
6b1c8db
b0eeb6e
6008eca
06ab630
9fe3242
acac9ec
8a876c8
cf43702
af63d70
8ca5aa6
537f45f
7119580
7828184
853d161
af362c2
fafa55e
e54e485
21c8a88
9f07b85
2a58957
0748090
c5fc0e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,73 +24,71 @@ interface ICompositeLiquidityRouter { | |||||
***************************************************************************/ | ||||||
|
||||||
/** | ||||||
* @notice Add arbitrary amounts of underlying tokens to an ERC4626 pool through the buffer. | ||||||
* @notice Add arbitrary amounts of tokens to an ERC4626 pool through the buffer. | ||||||
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI). Ensure that any buffers associated | ||||||
* with the wrapped tokens in the ERC4626 pool have been initialized before initializing or adding liquidity to | ||||||
* the "parent" pool, and also make sure limits are set properly. | ||||||
* | ||||||
* @param pool Address of the liquidity pool | ||||||
* @param useAsStandardToken An array indicating whether to use the token as standard or wrap it, | ||||||
* sorted in token registration order of wrapped tokens in the pool | ||||||
* @param wrapUnderlying Flags indicating whether the corresponding token should be wrapped or | ||||||
* use as a standard ERC20 | ||||||
* @param exactAmountsIn Exact amounts of underlying/wrapped tokens in, sorted in token registration order | ||||||
* wrapped tokens in the pool | ||||||
* @param minBptAmountOut Minimum amount of pool tokens to be received | ||||||
* @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH | ||||||
* @param userData Additional (optional) data required for adding liquidity | ||||||
* @return bptAmountOut Actual amount of pool tokens received | ||||||
*/ | ||||||
function addLiquidityUnbalancedToERC4626Pool( | ||||||
address pool, | ||||||
bool[] memory useAsStandardToken, | ||||||
bool[] memory wrapUnderlying, | ||||||
uint256[] memory exactAmountsIn, | ||||||
uint256 minBptAmountOut, | ||||||
bool wethIsEth, | ||||||
bytes memory userData | ||||||
) external payable returns (uint256 bptAmountOut); | ||||||
|
||||||
/** | ||||||
* @notice Add proportional amounts of underlying tokens to an ERC4626 pool through the buffer. | ||||||
* @notice Add proportional amounts of tokens to an ERC4626 pool through the buffer. | ||||||
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI). Ensure that any buffers associated | ||||||
* with the wrapped tokens in the ERC4626 pool have been initialized before initializing or adding liquidity to | ||||||
* the "parent" pool, and also make sure limits are set properly. | ||||||
* | ||||||
* @param pool Address of the liquidity pool | ||||||
* @param useAsStandardToken An array indicating whether to use the token as standard or wrap it, | ||||||
* sorted in token registration order of wrapped tokens in the pool | ||||||
* @param wrapUnderlying Flags indicating whether the corresponding token should be wrapped or | ||||||
* use as a standard ERC20 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* @param maxAmountsIn Maximum amounts of underlying/wrapped tokens in, sorted in token registration order | ||||||
* wrapped tokens in the pool | ||||||
* @param exactBptAmountOut Exact amount of pool tokens to be received | ||||||
* @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH | ||||||
* @param userData Additional (optional) data required for adding liquidity | ||||||
* @return tokensIn Actual tokens added in the pool | ||||||
* @return amountsIn Actual amounts of tokens added in the pool | ||||||
* @return tokensIn Actual tokens added to the pool | ||||||
* @return amountsIn Actual amounts of tokens added to the pool | ||||||
*/ | ||||||
function addLiquidityProportionalToERC4626Pool( | ||||||
address pool, | ||||||
bool[] memory useAsStandardToken, | ||||||
bool[] memory wrapUnderlying, | ||||||
uint256[] memory maxAmountsIn, | ||||||
uint256 exactBptAmountOut, | ||||||
bool wethIsEth, | ||||||
bytes memory userData | ||||||
) external payable returns (address[] memory tokensIn, uint256[] memory amountsIn); | ||||||
|
||||||
/** | ||||||
* @notice Remove proportional amounts of underlying from an ERC4626 pool, burning an exact pool token amount. | ||||||
* @notice Remove proportional amounts of tokens from an ERC4626 pool, burning an exact pool token amount. | ||||||
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI). | ||||||
* @param pool Address of the liquidity pool | ||||||
* @param useAsStandardToken An array indicating whether to use the token as standard or unwrap it, | ||||||
* sorted in token registration order of wrapped tokens in the pool | ||||||
* @param unwrapWrapper Flags indicating whether the corresponding token should be unwrapped or | ||||||
* use as a standard ERC20 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* @param exactBptAmountIn Exact amount of pool tokens provided | ||||||
* @param minAmountsOut Minimum amounts of each token, sorted according to tokensIn array | ||||||
* wrapped tokens in the pool | ||||||
* @param minAmountsOut Minimum amounts of each token, corresponding to `tokensOut` | ||||||
* @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH | ||||||
* @param userData Additional (optional) data required for removing liquidity | ||||||
* @return tokensOut Actual tokens received | ||||||
* @return amountsOut Actual amounts of tokens received | ||||||
*/ | ||||||
function removeLiquidityProportionalFromERC4626Pool( | ||||||
address pool, | ||||||
bool[] memory useAsStandardToken, | ||||||
bool[] memory unwrapWrapper, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
If we're saying "wrapped" and "underlying," this should be |
||||||
uint256 exactBptAmountIn, | ||||||
uint256[] memory minAmountsOut, | ||||||
bool wethIsEth, | ||||||
|
@@ -101,17 +99,16 @@ interface ICompositeLiquidityRouter { | |||||
* @notice Queries an `addLiquidityUnbalancedToERC4626Pool` operation without actually executing it. | ||||||
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI). | ||||||
* @param pool Address of the liquidity pool | ||||||
* @param useAsStandardToken An array indicating whether to use the token as standard or wrap it, | ||||||
* sorted in token registration order of wrapped tokens in the pool | ||||||
* @param wrapUnderlying Flags indicating whether the corresponding token should be wrapped or | ||||||
* use as a standard ERC20 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* @param exactAmountsIn Exact amounts of underlying/wrapped tokens in, sorted in token registration order | ||||||
* wrapped tokens in the pool | ||||||
* @param sender The sender passed to the operation. It can influence results (e.g., with user-dependent hooks) | ||||||
* @param userData Additional (optional) data required for the query | ||||||
* @return bptAmountOut Expected amount of pool tokens to receive | ||||||
*/ | ||||||
function queryAddLiquidityUnbalancedToERC4626Pool( | ||||||
address pool, | ||||||
bool[] memory useAsStandardToken, | ||||||
bool[] memory wrapUnderlying, | ||||||
uint256[] memory exactAmountsIn, | ||||||
address sender, | ||||||
bytes memory userData | ||||||
|
@@ -121,17 +118,17 @@ interface ICompositeLiquidityRouter { | |||||
* @notice Queries an `addLiquidityProportionalToERC4626Pool` operation without actually executing it. | ||||||
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI). | ||||||
* @param pool Address of the liquidity pool | ||||||
* @param useAsStandardToken An array indicating whether to use the token as standard or wrap/unwrap it, | ||||||
* sorted in token registration order of wrapped tokens in the pool | ||||||
* @param wrapUnderlying Flags indicating whether the corresponding token should be wrapped or | ||||||
* use as a standard ERC20 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* @param exactBptAmountOut Exact amount of pool tokens to be received | ||||||
* @param sender The sender passed to the operation. It can influence results (e.g., with user-dependent hooks) | ||||||
* @param userData Additional (optional) data required for the query | ||||||
* @return tokensIn Expected tokens added in the pool | ||||||
* @return amountsIn Expected amounts of tokens added in the pool | ||||||
* @return tokensIn Expected tokens added to the pool | ||||||
* @return amountsIn Expected amounts of tokens added to the pool | ||||||
*/ | ||||||
function queryAddLiquidityProportionalToERC4626Pool( | ||||||
address pool, | ||||||
bool[] memory useAsStandardToken, | ||||||
bool[] memory wrapUnderlying, | ||||||
uint256 exactBptAmountOut, | ||||||
address sender, | ||||||
bytes memory userData | ||||||
|
@@ -141,8 +138,8 @@ interface ICompositeLiquidityRouter { | |||||
* @notice Queries a `removeLiquidityProportionalFromERC4626Pool` operation without actually executing it. | ||||||
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI). | ||||||
* @param pool Address of the liquidity pool | ||||||
* @param useAsStandardToken An array indicating whether to use the token as standard or unwrap it, | ||||||
* sorted in token registration order of wrapped tokens in the pool | ||||||
* @param unwrapWrapper Flags indicating whether the corresponding token should be unwrapped or | ||||||
* use as a standard ERC20 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* @param exactBptAmountIn Exact amount of pool tokens provided for the query | ||||||
* @param sender The sender passed to the operation. It can influence results (e.g., with user-dependent hooks) | ||||||
* @param userData Additional (optional) data required for the query | ||||||
|
@@ -151,7 +148,7 @@ interface ICompositeLiquidityRouter { | |||||
*/ | ||||||
function queryRemoveLiquidityProportionalFromERC4626Pool( | ||||||
address pool, | ||||||
bool[] memory useAsStandardToken, | ||||||
bool[] memory unwrapWrapper, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
uint256 exactBptAmountIn, | ||||||
address sender, | ||||||
bytes memory userData | ||||||
|
@@ -170,7 +167,7 @@ interface ICompositeLiquidityRouter { | |||||
* @param parentPool Address of the highest level pool (which contains BPTs of other pools) | ||||||
* @param tokensIn Input token addresses, sorted by user preference. `tokensIn` array must have all tokens from | ||||||
* child pools and all tokens that are not BPTs from the nested pool (parent pool). | ||||||
* @param exactAmountsIn Amount of each token in, sorted according to tokensIn array | ||||||
* @param exactAmountsIn Amount of each token in, corresponding to `tokensIn` | ||||||
* @param minBptAmountOut Expected minimum amount of parent pool tokens to receive | ||||||
* @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH | ||||||
* @param userData Additional (optional) data required for the operation | ||||||
|
@@ -190,7 +187,7 @@ interface ICompositeLiquidityRouter { | |||||
* @param parentPool Address of the highest level pool (which contains BPTs of other pools) | ||||||
* @param tokensIn Input token addresses, sorted by user preference. `tokensIn` array must have all tokens from | ||||||
* child pools and all tokens that are not BPTs from the nested pool (parent pool). | ||||||
* @param exactAmountsIn Amount of each token in, sorted according to tokensIn array | ||||||
* @param exactAmountsIn Amount of each token in, corresponding to `tokensIn` | ||||||
* @param sender The sender passed to the operation. It can influence results (e.g., with user-dependent hooks) | ||||||
* @param userData Additional (optional) data required for the operation | ||||||
* @return bptAmountOut Expected amount of parent pool tokens to receive | ||||||
|
@@ -214,7 +211,7 @@ interface ICompositeLiquidityRouter { | |||||
* @param tokensOut Output token addresses, sorted by user preference. `tokensOut` array must have all tokens from | ||||||
* child pools and all tokens that are not BPTs from the nested pool (parent pool). If not all tokens are informed, | ||||||
* balances are not settled and the operation reverts. Tokens that repeat must be informed only once. | ||||||
* @param minAmountsOut Minimum amounts of each token, sorted according to tokensIn array | ||||||
* @param minAmountsOut Minimum amounts of each outgoing token, corresponding to `tokensOut` | ||||||
* @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH | ||||||
* @param userData Additional (optional) data required for the operation | ||||||
* @return amountsOut Actual amounts of tokens received, parallel to `tokensOut` | ||||||
elshan-eth marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.