fix: [M03] HubPool should send ETH to caller of removeLiquidity if they specify so #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
should be set to true "if L1 token is WETH and user wants to receive ETH".
However, if the "user" is a smart contract, even if the L1 token is WETH and the sendEth argument is
true, WETH, not ETH, will ultimately be sent back.
checks if the intended recipient is a smart contract, and, if so, sends WETH.
If the receiving smart contract has no mechanism to handle WETH and was only expecting ETH in
return, as was explicitly specified by the sendEth argument submitted, then any WETH sent to such a
contract could become inaccessible.
contract calls removeLiquidity with the sendEth argument set to true or modifying the
_unwrapWETHTo function so that it can also be provided with and abide by an explicit sendEth
argument.
Resolution:
sendEth = Truewhich is confusing and can lead to lost funds by contracts who cannot handle WETH and don't read the contract source code closely. This PR sends ETH or WETH to caller as specified