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

Possible failure to initialize in `HealthToken.sol`

Summary

Initializing addresses in a different function might lead to Initialization failure

Vulnerability Details

Instead of utilizing the setMarketAndVotingAddress() function within the HealthToken.sol contract to set the addresses of the MartenitsaMarketplace and MartenitsaVoting contracts, it is preferable to initialize them within the constructor to mitigate the risk of initialization failure.

Impact

Impact : Low

Likelihood : Low

Tools Used

Manual Review

Recommendations

constructor() ERC20("HealthToken", "HT") Ownable(msg.sender) {
+ _martenitsaMarketplace = MartenitsaMarketplace(martenitsaMarketplace);
+ _martenitsaVoting = MartenitsaVoting(martenitsaVoting);
}
- function setMarketAndVotingAddress(address martenitsaMarketplace, address martenitsaVoting) public onlyOwner {
- _martenitsaMarketplace = MartenitsaMarketplace(martenitsaMarketplace);
- _martenitsaVoting = MartenitsaVoting(martenitsaVoting);
- }
Updates

Lead Judging Commences

bube Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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