Closed code423n4 closed 2 years ago
WatchPug
https://github.com/code-423n4/2021-11-vader/blob/429970427b4dc65e37808d7116b9de27e395ce0c/contracts/dex-v2/pool/BasePoolV2.sol#L346-L349
require( nativeAmountOut > 0 && nativeAmountOut <= nativeReserve, "BasePoolV2::doubleSwap: Swap Impossible" );
Should be changed to:
require( nativeAmountOut > 0 && nativeAmountOut < nativeReserve, "BasePoolV2::doubleSwap: Swap Impossible" );
Otherwise, it will malfunction the pool.
The current code ensures nativeReserve is greater than zero, unclear of what the finding means.
Dispute accepted.
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-11-vader/blob/429970427b4dc65e37808d7116b9de27e395ce0c/contracts/dex-v2/pool/BasePoolV2.sol#L346-L349
Should be changed to:
Otherwise, it will malfunction the pool.