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

Constructor of `LoveToken.sol` should contain a zero address check for constructor arguments.

Summary Event Arguments in the constructor of LoveToken.sol should be zero address checked. This would prevent any mishaps when deploying contracts.

Vulnerability Details

If an argument is passed with a zero address there is no check to prevent against this.

Impact

Although this the chance of this happening is low the impact would be high. If a contract was deployed with an incorrect argument for the constructor there is no way in the contract to correct this mistake. Depending on the deployment process this single contract might have to be re-deployed or even worse multiple contracts may have to be re-deployed.

Tools Used

Foundry

Recommendations

constructor(
    ISoulmate _soulmateContract,
    address _airdropVault,
    address _stakingVault
) ERC20("LoveToken", "<3", 18) {
  •     if(address(_soulmateContract) == 0 || _aidropVault == 0 || _stakingVault == 0) { revert; }
      soulmateContract = _soulmateContract;
      airdropVault = _airdropVault;
      stakingVault = _stakingVault;
    

    }

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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