HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

wToken approve out of allowance

Summary

In registerCollateralToken where msg.sender gives approve for wTokenContract and also for collateralTokenContract

_collateralTokenContract has a special function for increasing the allowance but wTokenContract doesnt have that.

_wTokenContract.approve(_diva, type(uint256).max); //@audit doesnt have increase allowance
_collateralTokenContract.approve(_aaveV3Pool, type(uint256).max)

Vulnerability Details

When registerCollateralToken is registered. and people start calling _addLiquidity it does transfer collateralAmount to Diva which means diva uses the allowance. If too many people call addliquidity increasing the sent amount to Diva which means the allowance decreases. It can result in allowance dropping to 0 and not being able to addliquidity until somone calls removeLiquidity or redeemPositionToken

Impact

Medium

Tools Used

Manual Review

Recommendations

Add increase allowance for the wTokenContract

Updates

Lead Judging Commences

bube Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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