Created
October 12, 2021 06:00
-
-
Save bakasura980/6483eeffea0b544453d7db6986496fdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeLiquidityETHWithPermit( | |
address token, | |
uint weight, | |
uint liquidity, | |
uint amountTokenMin, | |
uint amountETHMin, | |
address to, | |
uint deadline, | |
bool approveMax, uint8 v, bytes32 r, bytes32 s | |
) external virtual override returns (uint amountToken, uint amountETH) { | |
uint value = approveMax ? uint(-1) : liquidity; | |
IPool pool = IPool(IPoolFactory(factory).getPool(PoolKey.build(token, WETH, weight))); | |
pool.permit(msg.sender, address(this), value, deadline, v, r, s); | |
(amountToken, amountETH) = removeLiquidityETH(token, weight, liquidity, amountTokenMin, amountETHMin, to, deadline); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment