20,000 USDC
View results
Submission Details
Severity: high
Valid

Missing approval before calling swap router

Summary

No approval before calling uniswap swap router

Vulnerability Details

ERC20 approval needs to be called before calling the uniswap swap router to allow uniswap receive the said tokens.

Impact

All fees are stuck in the fee contract

Tools Used

Recommendations

Add IERC20(_profits).approve(address(swapRouter), amount); here (https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Fees.sol#L29)

Support

FAQs

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