20,000 USDC
View results
Submission Details
Severity: gas

[G-02] Use amout variable in transfer WETH

Vulnerability Details

The result for swapRouter.exactInputSingle(params) is the amountOut. So, since we are always going to transfer the amountOut, it is not necessary to use IERC20(WETH).balanceOf(address(this)) since we would get the same value that is available.

Impact

Optimization

Tools Used

Manual code review

Recommendations

Update the code for:

- IERC20(WETH).transfer(staking, IERC20(WETH).balanceOf(address(this)));
+ IERC20(WETH).transfer(staking, amount));

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.