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

Use two-step ownership transfer

Summary

When changing the owner, it is preferable to have the new
owner send a transaction to accept the ownership, just in
case the original owner enters the wrong address.

Vulnerability Details

The owner can change the owner with the transferOwnership function. However, if the owner
is changed incorrectly by entering the wrong address, it cannot be taken back.

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/utils/Ownable.sol#L19

function transferOwnership(address _owner) public virtual onlyOwner {
owner = _owner;
emit OwnershipTransferred(msg.sender, _owner);
}

Impact

Informational

Recommendations

  1. Use OZ.Ownable2StepUpgradeable.

Support

FAQs

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