The AaveDIVAWrapper contract incorrectly passes parameters to its parent contract AaveDIVAWrapperCore in the wrong order during initialization, leading to critical address misassignments in the contract's storage variables.
File: AaveDIVAWrapper.sol (Line 12)
The child contract AaveDIVAWrapper implements its constructor as:
However, the parent contract AaveDIVAWrapperCore defines its constructor parameters in a different order:
Parameter Mismatch:
Parent contract expects parameters: (diva_, aaveV3Pool_, owner_)
Child contract passes parameters: (_aaveV3Pool, _diva, _owner)
This inversion causes:
_diva state variable will store the Aave V3 Pool address
_aaveV3Pool state variable will store the DIVA Protocol address
Critical protocol dependencies are initialized with incorrect addresses
Severity: High
The address misassignment will:
Break core protocol functionality relying on Aave/DIVA integrations
Cause failed transactions when interacting with external protocols
Potentially allow unintended contract interactions (e.g., using Aave pool as DIVA protocol)
Require contract redeployment to fix due to immutable variables
Foundry
Correct the parameter order in the child constructor:
Additional Checks:
Add parameter validation in child constructor
Implement unit tests verifying address assignments
Use NatSpec comments to explicitly document parameter order
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.