File tree Expand file tree Collapse file tree 6 files changed +21
-8
lines changed Expand file tree Collapse file tree 6 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,20 @@ import "./interface/IOwnable.sol";
1111
1212abstract contract Ownable is IOwnable {
1313 /// @dev Owner of the contract (purpose: OpenSea compatibility)
14- address public override owner;
14+ address private _owner;
15+
16+ /// @dev Reverts if caller is not the owner.
17+ modifier onlyOwner () {
18+ if (msg .sender != _owner) {
19+ revert Ownable__NotAuthorized ();
20+ }
21+ _;
22+ }
23+
24+ /// @dev Returns the owner of the contract.
25+ function owner () public view returns (address ) {
26+ return _owner;
27+ }
1528
1629 /// @dev Lets a contract admin set a new owner for the contract. The new owner must be a contract admin.
1730 function setOwner (address _newOwner ) external override {
@@ -23,8 +36,8 @@ abstract contract Ownable is IOwnable {
2336
2437 /// @dev Lets a contract admin set a new owner for the contract. The new owner must be a contract admin.
2538 function _setupOwner (address _newOwner ) internal {
26- address _prevOwner = owner ;
27- owner = _newOwner;
39+ address _prevOwner = _owner ;
40+ _owner = _newOwner;
2841
2942 emit OwnerUpdated (_prevOwner, _newOwner);
3043 }
Original file line number Diff line number Diff line change @@ -624,7 +624,7 @@ function owner() external view returns (address)
624624
625625
626626
627-
627+ * Returns the owner of the contract. *
628628
629629
630630#### Returns
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function owner() external view returns (address)
1818
1919
2020
21- * Owner of the contract (purpose: OpenSea compatibility) *
21+ * Returns the owner of the contract. *
2222
2323
2424#### Returns
Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ function owner() external view returns (address)
661661
662662
663663
664-
664+ * Returns the owner of the contract. *
665665
666666
667667#### Returns
Original file line number Diff line number Diff line change @@ -722,7 +722,7 @@ function owner() external view returns (address)
722722
723723
724724
725-
725+ * Returns the owner of the contract. *
726726
727727
728728#### Returns
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function owner() external view returns (address)
1818
1919
2020
21-
21+ * Returns the owner of the contract. *
2222
2323
2424#### Returns
You can’t perform that action at this time.
0 commit comments