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

Incorrect Address Usage in `AaveDIVAWrapperCore` Constructor

Summary

The constructor of AaveDIVAWrapper passes the address of the Aave V3 pool as the first parameter to the constructor of AaveDIVAWrapperCore. However, the first parameter of AaveDIVAWrapperCore's constructor should be the address of DIVA, not the Aave V3 pool.

Vulnerability Details

The constructor of the AaveDIVAWrapper contract mistakenly passes the address of the Aave V3 pool as the first parameter to the AaveDIVAWrapperCore constructor.

contract AaveDIVAWrapper is AaveDIVAWrapperCore, ReentrancyGuard {
...
constructor(address _aaveV3Pool, address _diva, address _owner) AaveDIVAWrapperCore(_aaveV3Pool, _diva, _owner) {}
...
}

However, the first parameter of the AaveDIVAWrapperCore constructor should be the address of DIVA, not the Aave V3 pool. This interchange of addresses renders the core contract ineffective.

abstract contract AaveDIVAWrapperCore is IAaveDIVAWrapper, Ownable2Step {
...
@> constructor(address diva_, address aaveV3Pool_, address owner_) Ownable(owner_) {
if (diva_ == address(0) || aaveV3Pool_ == address(0)) {
revert ZeroAddress();
}
_diva = diva_;
_aaveV3Pool = aaveV3Pool_;
}

Impact

The protocol becomes non-functional.

Tools Used

Manual Review

Recommendations

Correct the constructor as follows:

contract AaveDIVAWrapper is AaveDIVAWrapperCore, ReentrancyGuard {
...
- 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 6 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.