Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

```SantaToken::santasList``` address - zero-check address missing

Summary

The constructor of the SantaToken contract does not prevent the santasList address from being set to 0x0.

Vulnerability Details

//SantaToken.sol
constructor(address santasList) ERC20("SantaToken", "SANTA", DECIMALS) {
@> i_santasList = santasList;
}

Impact

The santasList address is used in the mint and burn functions of the SantaToken contract. If the santasList address is mistakenly set to 0x0, any tokens minted or burned are irretrievably lost.

Tools Used

slither

Recommendations

Add a check in the constructor of the SantaToken contract to ensure that the santasList address cannot be set to 0x0.

constructor(address santasList) ERC20("SantaToken", "SANTA", DECIMALS) {
+ require(santasList != address(0), "SantasList address cannot be 0x0");
i_santasList = santasList;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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