The Pool.removeLiquiditySingle function redeems liquidity tokens for underlying to the router contract in case of the token being the zero address.
This works if the underlying token is actually WBNB but if the pool token is different and the user accidentally inserted 0 as the token address, it tries to swap a zero-balance WBNB to BASE and the redeemed tokens are stuck.
If token == 0 add a check for pool.token == WBNB such that it is ensured that the pools token is actually WBNB.
verifyfirst (Spartan) disputed:
ghoul-sol (judge) commented:
