Bid Beasts

First Flight #49
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Redundant Owner Getter Duplicating OpenZeppelin Functionality

Redundant Owner Getter Duplicating OpenZeppelin Functionality

Description

Ownable contract provides a public owner() view function to query the contract owner. The explicit getOwner() function duplicates this, adding unnecessary code and ABI bloat.

@>function getOwner() public view returns (address) {
return owner();
}@>

Risk

Likelihood:

  • During contract deployment and ABI generation.

  • When developers or tools scan for owner-related methods.

Impact:

  • Minor ABI size increase and gas irrelevance.

  • Potential developer confusion from duplicated interfaces.

Proof of Concept

Calls both OZ owner() and explicit getOwner(), asserts same result and matches OWNER to show exact duplicate function.

function testRedundantOwnerGetter() public {
// Call OpenZeppelin owner()
address ozOwner = market.owner();
// Call explicit getter
address explicitOwner = market.getOwner();
// Identical results confirm redundancy
assertEq(ozOwner, explicitOwner);
assertEq(ozOwner, OWNER);
}

Recommended Mitigation

Deletes getOwner() entirely, relying on OpenZeppelin's built-in owner() to avoid extra code and confusion.

- function getOwner() public view returns (address) {
- return owner();
- }
Updates

Lead Judging Commences

cryptoghost Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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