20,000 USDC
View results
Submission Details
Severity: medium
Valid

Use a 2-step ownership transfer pattern

Summary

If the owner calls Ownable.transferOwnership() function to transfer the ownership to the new address directly, there is a risk that the ownership is transferred to an invalid address, thus causing the contract to be without an owner.

Vulnerability Details

It’s possible that the onlyOwner role mistakenly transfers ownership to the wrong address, resulting in a loss of the onlyOwner role.

Impact

Once the ownership of the contract is lost it cannot be recovered.

Tools Used

None

Recommendations

Consider overriding the default transferOwnership() function to first nominate an address as the pendingOwner and implementing an acceptOwnership() function which is called by the pendingOwner to confirm the transfer.

Support

FAQs

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

Give us feedback!