Trick or Treat

First Flight #27
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Use Constructor for Imports Initialization

Summary

Avoid initializing inherited contracts on the contract line. Instead, handle initialization in the constructor to maintain control and clarity.

Vulnerability Details

The original code initializes Ownable on the contract line using msg.sender, which can lead to unintended behaviors. Moving this initialization to the constructor ensures consistent and clear handling of parameters.

Impact

Low

Tools Used

Manual Review

Recommendation

Move inherited contract initialization to the constructor. For example:

contract SpookySwap is ERC721URIStorage, Ownable, ReentrancyGuard {
constructor(Treat[] memory treats) ERC721("SpookyTreats", "SPKY") Ownable(msg.sender) { }
}
Updates

Appeal created

bube Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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