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

```initVault``` function of LoveToken.sol can be reinitialize multiple times

Summary

The initVault function lacks any safeguards to prevent these authorized addresses from calling it multiple times. This vulnerability allows attackers to exploit the function and:

  1. Mint an unlimited amount of tokens

  2. Approve excessive token transfers:

if (msg.sender == airdropVault) {
_mint(airdropVault, 500_000_000 ether);
approve(managerContract, 500_000_000 ether);
emit AirdropInitialized(managerContract);
} else if (msg.sender == stakingVault) {
_mint(stakingVault, 500_000_000 ether);
approve(managerContract, 500_000_000 ether);
emit StakingInitialized(managerContract);
} else revert LoveToken__Unauthorized();
}```
## Vulnerability Details
No mechanism exists to restrict the number of times each authorized address can call initVault which can lead to minting an unlimited amount of tokens
## Impact
Unlimited token minting can significantly dilute the value of existing tokens, harming investors and holders.
## Tools Used
Manual Review
## Recommendations
Use a boolean flag similar to ```vaultInitialize```, but combine it with proper access control mechanisms. Ensure only authorized addresses can call initVault and set the flag to true after the initial initialization.
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.