First Flight #21: KittyFi

First Flight #21
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

KittyPool::constructor Missing checks for address(0) when assigning values to address state variables, can lead to loss of assets in the protocol

Summary

The issue of "missing checks for address(0)" in smart contracts refers to the lack of validation to ensure that an address being assigned or used is not the zero address (0x0000000000000000000000000000000000000000). The zero address is a special address in Ethereum that often indicates an uninitialized state or serves as a null value for addresses.

Vulnerability Details

constructor(address _meowntainer, address _euroPriceFeed, address aavePool) {
meowntainer = _meowntainer;
i_kittyCoin = new KittyCoin(address(this));
i_euroPriceFeed = _euroPriceFeed;
i_aavePool = aavePool;
}

Impact

can lead to loss of assets in the protocol

Tools Used

manual review

Recommendations

Add require statement in the constructor to check for address zero

constructor(address _meowntainer, address _euroPriceFeed, address aavePool) {
+ require(_meowntainer != address(0), "Meowntainer address cannot be the zero address");
+ require(_euroPriceFeed != address(0), "Euro Price Feed address cannot be the zero address");
+ require(aavePool != address(0), "Aave Pool address cannot be the zero address");
meowntainer = _meowntainer;
i_kittyCoin = new KittyCoin(address(this));
i_euroPriceFeed = _euroPriceFeed;
i_aavePool = aavePool;
}
Updates

Lead Judging Commences

shikhar229169 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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