The AaveDIVAWrapper contract fails to account for potential slippage and rounding errors during collateral deposit/withdrawal operations, risking inaccurate wToken minting/burning and improper tracking of Aave positions.
Affected Functions:
1. _handleTokenOperations
(Collateral deposit)
2. _redeemWTokenPrivate
(Collateral withdrawal)
Core Issues:
1. Unchecked Aave Supply (wToken Minting)
In _handleTokenOperations
:
Problem: Aave's supply() returns the actual aToken amount minted, which may differ from _collateralAmount due to:
aToken exchange rate fluctuations
Interest accrual timing
Rounding differences in aToken decimals
Unverified Withdraw Amount (wToken Burning)
In _redeemWTokenPrivate
:
Problem: The actual collateral withdrawn from Aave may not match _wTokenAmount due to:
aToken exchange rate changes
Protocol-level rounding rules
Interest accrual since deposit
Users may receive less collateral than expected when withdrawing
Protocol could mint more wTokens than aToken reserves
Yield calculations in _getAccruedYieldPrivate could become inaccurate
Potential protocol insolvency if aToken/wToken balances diverge significantly
Manual code analysis
Aave V3 protocol documentation review
Use Actual aToken Amount for Minting
Add Slippage Protection for Withdrawals:
Implement Rebase Mechanism:
Consider making wTokens rebase tokens that track aToken balances directly, or implement periodic balance reconciliation functions.
Add Emergency Pause:
Include circuit-breaker functionality to freeze operations if aToken/wToken balance discrepancies exceed safe thresholds.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.