Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Latest commit

 

History

History
33 lines (17 loc) · 1.27 KB

046.md

File metadata and controls

33 lines (17 loc) · 1.27 KB

Bnke0x0

low

USE OWNABLE2STEPUPGRADEABLE INSTEAD OF OWNABLEUPGRADEABLE CONTRACT

Summary

Vulnerability Detail

Impact

transferOwnership function is used to change Ownership from OwnableUpgradeable.sol.

There is another Openzeppelin Ownable contract (Ownable2StepUpgradeable.sol) has transferOwnership function , use it is more secure due to 2-stage ownership transfer.

Ownable2StepUpgradeable.sol

Code Snippet

https://github.com/sherlock-audit/2023-01-optimism/blob/main/optimism/packages/contracts-bedrock/contracts/L1/SystemConfig.sol#L6 => '"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";'

https://github.com/sherlock-audit/2023-01-optimism/blob/main/optimism/packages/contracts-bedrock/contracts/deployment/SystemDictator.sol#L6 => '"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";'

https://github.com/sherlock-audit/2023-01-optimism/blob/main/optimism/packages/contracts-bedrock/contracts/L2/CrossDomainOwnable2.sol#L6 => '"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";'

Tool used

Manual Review

Recommendation

USE OWNABLE2STEPUPGRADEABLE INSTEAD OF OWNABLEUPGRADEABLE CONTRACT