HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: low
Valid

Constructor Parameter Mismatch in AaveDIVAWrapper and AaveDIVAWrapperCore Contracts Leading to Failing Function Calls

Description

The order of parameters in AaveDIVAWrapper does not match the expected order in AaveDIVAWrapperCore, leading to incorrect assignment of contract addresses and potential malfunction of the deployed contract.

The constructor in AaveDIVAWrapper is structured as:

constructor(address _aaveV3Pool, address _diva, address _owner) AaveDIVAWrapperCore(_aaveV3Pool, _diva, _owner) {}

But the 'AaveDIVAWrapperCore` has its constructor structured as:

constructor(address diva_, address aaveV3Pool_, address owner_) Ownable(owner_) {}

This leads to improper initialization of DIVA and Aave V3 Pool addresses in the core contract.
DIVA is initialized to Aave V3 Pool address and vice versa.

Impact

  • Misconfiguration of contract dependencies, leading to function calls failing due to incorrect addresses.

  • Unexpected behavior during contract execution, requiring redeployment to fix.

Tools Used

Manual Review
Foundry

Recommendations

In AaveDIVAWrapper change the order of the variables passed to the constructor of AaveDIVAWrapperCore

- constructor(address _aaveV3Pool, address _diva, address _owner) AaveDIVAWrapperCore(_aaveV3Pool, _diva, _owner) {}
+ constructor(address _aaveV3Pool, address _diva, address _owner) AaveDIVAWrapperCore(_diva, _aaveV3Pool, _owner) {}
Updates

Lead Judging Commences

bube Lead Judge 5 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Constructor arguments mismatch

Support

FAQs

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