The AaveDIVAWrapper contract incorrectly initializes its parent contract (AaveDIVAWrapperCore) by reversing the order of the Aave and DIVA protocol addresses. This inversion causes all interactions with Aave V3 to be directed to the DIVA contract (and vice versa), rendering core protocol functionality irreparably broken.
The AaveDIVAWrapperCore constructor expects the following parameter order:
However, the AaveDIVAWrapper::constructor() provides the Aave and DIVA addresses in reverse order when calling the AaveDIVAWrapperCore::constructor():
By passing _aaveV3Pool as the first argument and _diva as the second, the AaveDIVAWrapper contract ends up assigning:
diva_ = _aaveV3Pool
aaveV3Pool_ = _diva
Please place the provided file in the project's test directory and ensure that foundry is properly configured before execution.
Aave Interactions Directed to DIVA: All calls to Aave V3 functions (e.g., supply, withdraw, getReserveData) will be sent to the DIVA contract, which lacks these functions. This will revert all protocol operations involving Aave (collateral deposits, withdrawals, yield claims).
DIVA Interactions Directed to Aave: Calls to DIVA Protocol (e.g., createContingentPool, addLiquidity) will be routed to the Aave contract, leading to unintended asset movements or permanent loss of funds.
Protocol Unusable: The wrapper becomes non-functional, as core features (pool creation, liquidity management) will fail catastrophically.
Foundry/Forge: Identified via test failures showing 0x5416eb98 selector errors (mismatched function calls to DIVA).
Manual Code Review: Detected parameter inversion in constructor inheritance
Correct Parameter Order in Constructor:
Swap the _aaveV3Pool and _diva parameters in the AaveDIVAWrapper constructor:
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.