The GivingThanks contract imports OpenZeppelin's Ownable contract but does not use it, instead opting for a custom owner variable to store the contract owner. This inconsistency may lead to unnecessary complexity and missed features from OpenZeppelin’s secure, standardized ownership management functions.
The contract includes Ownable.sol but defines a custom owner variable without utilizing the features of the Ownable contract, such as access control functions (onlyOwner), or standardized methods (transferOwnership).
Redundant Code: Increased bytecode size due to unused Ownable import.
Missed Access Control: Risks bypassing well-tested access control functions and may lead to future inconsistencies in owner-based functionality.
Maintainability: Using Ownable’s built-in features such as transfer or renounce ownership would streamline ownership logic and improve readability for other developers.
Manual Review
Refactor the GivingThanks contract to extend Ownable directly, removing the custom owner variable. Update functions that require admin privileges to use onlyOwner for access control. For example:
This approach utilizes the robust, tested access control from OpenZeppelin’s Ownable contract and eliminates unnecessary custom code.
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.