The constructor of the MartenitsaEvent.sol contract utilizes the onlyOwner modifier, which restricts its execution to the contract owner. However, this restriction appears unnecessary for a constructor function.
The use of the onlyOwner modifier in the constructor function imposes an unnecessary constraint, as constructor functions are automatically executed by the deploying address, which is typically the contract owner. The onlyOwner modifier is commonly employed in functions that require privileged access control, but applying it to a constructor adds no additional security or functionality.
While this redundancy does not introduce a security vulnerability per se, it may contribute to code complexity and maintenance overhead. Unnecessary modifiers can obscure the intent of the code and increase the risk of errors during contract deployment or upgrades.
manual code review.
To streamline the contract and improve readability, it is advisable to remove the onlyOwner modifier from the constructor function. This action simplifies the codebase without compromising security or functionality.
Example:
By removing the unnecessary modifier, the constructor becomes more concise and aligns with common coding practices.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.