Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

No function to change owner

Summary

there is no provision for changing the owner of the contract. This vulnerability could result in a permanent loss of control over the contract.

Vulnerability Details

The contract lacks a function to transfer ownership. As a result, once the contract is deployed, the initial owner (address that deploys the contract) is set as the permanent owner, and this ownership cannot be transferred to another address.

Impact

If the initial owner loses access to their private key or wishes to transfer control to another address, there is no mechanism in place to do so.

Tools Used

Manual Analysis

Recommendations

Add transferOwner function.

function transferOwnership(address newOwner) external {
require(msg.sender == s_owner, "Only the current owner can transfer ownership");
require(newOwner != address(0), "New owner address cannot be zero");
s_owner = newOwner;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
almost 2 years ago
inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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