UniV2LiquidityAmo
- Incorrect use of safeApprove
#659
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-1782
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV2LiquidityAmo.sol#L200-L207
Vulnerability details
Impact
safeApprove
will revert when there's residual approved amount from past liquidity addition, thusaddLiquidity
will not work.Proof of Concept
SafeERC20
'ssafeApprove
function checkes if there's already approved amount and if it does, it does revert.Tools Used
Manual Review
Recommended Mitigation Steps
Reset approved amount before using
safeApprove
.Assessed type
ERC20
The text was updated successfully, but these errors were encountered: