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

Parameter sequence mismatch in AaveDivaWrapper's constructor and AaveDivaWrapperCore's constructor.

Summary

There's a switch in the order of parameters in the AaveDivaWrapper's constructor contract and the AaveDivaWrapperCore contracts leading to _AaveV3Pool's function being called on the Diva protocol which will result in a lot of reverts

Vulnerability Details

AaveDivaWrapperCore

/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
/**
* @dev Initializes the AaveDIVAWrapper contract with the addresses of DIVA Protocol, Aave V3's Pool
* contract and the owner of the contract.
* @param diva_ Address of the DIVA Protocol contract.
* @param aaveV3Pool_ Address of the Aave V3 Pool contract.
* @param owner_ Address of the owner for the contract, who will be entitled to claim the yield.
* Retrievable via Ownable's `owner()` function or this contract's `getContractDetails` functions.
*/
constructor(address diva_, address aaveV3Pool_, address owner_) Ownable(owner_) {
// Validate that none of the input addresses is zero to prevent unintended initialization with default addresses.
// Zero address check on `owner_` is performed in the OpenZeppelin's `Ownable` contract.
if (diva_ == address(0) || aaveV3Pool_ == address(0)) {
revert ZeroAddress();
}
// Store the addresses of DIVA Protocol and Aave V3 in storage.
_diva = diva_;
_aaveV3Pool = aaveV3Pool_;
}

Above order of parameters in the constructor is diva, Aave then owner while in the

AaveDivaWrapper

/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
constructor(address _aaveV3Pool, address _diva, address _owner) AaveDIVAWrapperCore(_aaveV3Pool, _diva, _owner) {}

As shown above diva is being set to Aave and vice versa leading to a lot of function calls meant for diva being called on Aave and vice versa

Impact

this will render the protocol unusable essentially as we wouldn't be able to supply tokens to Aave, create contingent pools and many more.

Tools Used

Recommendations

  • consider switching the order in AaveDivaWrapper to match the one in AaveDivaWrapperCore.

Updates

Lead Judging Commences

bube Lead Judge 9 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.