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

No address(0) check

Summary

Zero address is not checked in the constructor of DSCEngine.sol

Vulnerability Details

Zero address can be set as dscAddress when the contract is being deployed

Impact

The mintDsc() and burnDsc() functions will not work as expected

Tools Used

Manual review

Recommendations

consider using the following.

constructor(address[] memory tokenAddresses, address[] memory priceFeedAddresses, address dscAddress) {
if (tokenAddresses.length != priceFeedAddresses.length) {
revert DSCEngine__TokenAddressesAndPriceFeedAddressesAmountsDontMatch();
}
if(dscAddress == address(0)){
revert DSCEngine__AddressZero();
}
// ...
}

Support

FAQs

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