Open rcstanciu opened 2 years ago
0x52
medium
Deployments.sol accidentally uses the Uniswap V3 router address for UNIV2_ROUTER which causes all Uniswap V2 calls to fail
IUniV2Router2 internal constant UNIV2_ROUTER = IUniV2Router2(0xE592427A0AEce92De3Edee1F18E0157C05861564);
The constant UNIV2_ROUTER contains the address for the Uniswap V3 router, which doesn't contain the "swapExactTokensForTokens" or "swapTokensForExactTokens" methods. As a result, all calls made to Uniswap V2 will revert.
Uniswap V2 is totally unusable
Deployments.sol#L25
Manual Review
Change UNIV2_ROUTER to the address of the V2 router:
IUniV2Router2 internal constant UNIV2_ROUTER = IUniV2Router2(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
@weitianjie2000 I believe this has been fixed subsequently
Fixed, replace Uniswap v3 router address with v2 router address.
0x52
medium
Deployments.sol uses the wrong address for UNIV2 router which causes all Uniswap V2 calls to fail
Summary
Deployments.sol accidentally uses the Uniswap V3 router address for UNIV2_ROUTER which causes all Uniswap V2 calls to fail
Vulnerability Detail
The constant UNIV2_ROUTER contains the address for the Uniswap V3 router, which doesn't contain the "swapExactTokensForTokens" or "swapTokensForExactTokens" methods. As a result, all calls made to Uniswap V2 will revert.
Impact
Uniswap V2 is totally unusable
Code Snippet
Deployments.sol#L25
Tool used
Manual Review
Recommendation
Change UNIV2_ROUTER to the address of the V2 router: