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

Zero address check is missing for both airdropVault and stakingVault in `constructor::LoveToken.sol`

Summary

When we launch the project and initialize the LoveTokens to the users who have soulmate NFT. Those LoveTokens will be stored in two vaults. The LoveTokens which will be given as airdrop for who holds soulmate NFT, those LoveTokens will be stored in the airdropVault. The LoveTokens which will be given as staking reward for who holds soulmate NFT, those LoveTokens will be stored in the stakingVault.

Vulnerability Details

There must be a zero address checks for both airdropVault and stakingVault. If there is a zero address vault, we can revert through errors.

Impact

If there is no zero address check, then those LoveTokens cannot be stored in the vaults because those can be a zero addresses vaults.

Tools Used

Manually

Recommendations

Add two errors at the lines of 16th and 17th:

+ error Airdrop_IncorrectAddress();
+ error Staking_IncorrectAddress();

Add two zero address checks inside the constructor:

+ if(_airdropVault == address(0)) {
+ revert Airdrop_IncorrectAddress();
+ }
+ if(_stakingVault == address(0)) {
+ revert Staking_IncorrectAddress();
+ }
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.