@@ -24,47 +24,47 @@ contract OwnableRolesFacet {
2424
2525 /// @dev Allows the owner to transfer the ownership to `newOwner`.
2626 function transferOwnership (address _newOwner ) public onlyOwner {
27- _newOwner._transferOwnership ();
27+ _newOwner.transferOwnership ();
2828 }
2929
3030 /// @dev Allows the owner to renounce their ownership.
3131 function renounceOwnership () public onlyOwner {
32- OwnableRolesLib._renounceOwnership ();
32+ OwnableRolesLib.renounceOwnership ();
3333 }
3434
3535 /// @dev Request a two-step ownership handover to the caller.
3636 /// The request will automatically expire in 48 hours (172800 seconds) by default.
3737 function requestOwnershipHandover () public {
38- OwnableRolesLib._requestOwnershipHandover ();
38+ OwnableRolesLib.requestOwnershipHandover ();
3939 }
4040
4141 /// @dev Cancels the two-step ownership handover to the caller, if any.
4242 function cancelOwnershipHandover () public {
43- OwnableRolesLib._cancelOwnershipHandover ();
43+ OwnableRolesLib.cancelOwnershipHandover ();
4444 }
4545
4646 /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
4747 /// Reverts if there is no existing ownership handover requested by `pendingOwner`.
4848 function completeOwnershipHandover (address _pendingOwner ) public onlyOwner {
49- _pendingOwner._completeOwnershipHandover ();
49+ _pendingOwner.completeOwnershipHandover ();
5050 }
5151
5252 /// @dev Allows the owner to grant `user` `roles`.
5353 /// If the `user` already has a role, then it will be an no-op for the role.
5454 function grantRoles (address _user , uint256 _roles ) public onlyOwner {
55- _user._grantRoles (_roles);
55+ _user.grantRoles (_roles);
5656 }
5757
5858 /// @dev Allows the owner to remove `user` `roles`.
5959 /// If the `user` does not have a role, then it will be an no-op for the role.
6060 function revokeRoles (address _user , uint256 _roles ) public onlyOwner {
61- _user._removeRoles (_roles);
61+ _user.removeRoles (_roles);
6262 }
6363
6464 /// @dev Allow the caller to remove their own roles.
6565 /// If the caller does not have a role, then it will be an no-op for the role.
6666 function renounceRoles (uint256 _roles ) public {
67- msg .sender ._removeRoles (_roles);
67+ msg .sender .removeRoles (_roles);
6868 }
6969
7070 /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
@@ -73,41 +73,41 @@ contract OwnableRolesFacet {
7373
7474 /// @dev Returns the owner of the contract.
7575 function owner () public view returns (address ) {
76- return OwnableRolesLib._owner ();
76+ return OwnableRolesLib.owner ();
7777 }
7878
7979 /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
8080 function ownershipHandoverExpiresAt (address _pendingOwner ) public view returns (uint256 ) {
81- return _pendingOwner._ownershipHandoverExpiresAt ();
81+ return _pendingOwner.ownershipHandoverExpiresAt ();
8282 }
8383
8484 /// @dev Returns the roles of `user`.
8585 function rolesOf (address _user ) public view returns (uint256 ) {
86- return _user._rolesOf ();
86+ return _user.rolesOf ();
8787 }
8888
8989 /// @dev Returns whether `user` has any of `roles`.
9090 function hasAnyRole (address _user , uint256 _roles ) public view returns (bool ) {
91- return _user._rolesOf () & _roles != 0 ;
91+ return _user.rolesOf () & _roles != 0 ;
9292 }
9393
9494 /// @dev Returns whether `user` has all of `roles`.
9595 function hasAllRoles (address _user , uint256 _roles ) public view returns (bool ) {
96- return _user._rolesOf () & _roles == _roles;
96+ return _user.rolesOf () & _roles == _roles;
9797 }
9898
9999 /// @dev Convenience function to return a `roles` bitmap from an array of `ordinals`.
100100 /// This is meant for frontends like Etherscan, and is therefore not fully optimized.
101101 /// Not recommended to be called on-chain.
102102 function rolesFromOrdinals (uint8 [] memory ordinals ) external pure returns (uint256 ) {
103- return ordinals._rolesFromOrdinals ();
103+ return ordinals.rolesFromOrdinals ();
104104 }
105105
106106 /// @dev Convenience function to return an array of `ordinals` from the `roles` bitmap.
107107 /// This is meant for frontends like Etherscan, and is therefore not fully optimized.
108108 /// Not recommended to be called on-chain.
109109 function ordinalsFromRoles (uint256 roles ) external pure returns (uint8 [] memory ) {
110- return roles._ordinalsFromRoles ();
110+ return roles.ordinalsFromRoles ();
111111 }
112112
113113 /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
@@ -116,27 +116,27 @@ contract OwnableRolesFacet {
116116
117117 /// @dev Marks a function as only callable by the owner.
118118 modifier onlyOwner () {
119- OwnableRolesLib._checkOwner ();
119+ OwnableRolesLib.checkOwner ();
120120 _;
121121 }
122122
123123 /// @dev Marks a function as only callable by an account with `roles`.
124124 modifier onlyRoles (uint256 _roles ) {
125- OwnableRolesLib._checkRoles (_roles);
125+ OwnableRolesLib.checkRoles (_roles);
126126 _;
127127 }
128128
129129 /// @dev Marks a function as only callable by the owner or by an account
130130 /// with `roles`. Checks for ownership first, then lazily checks for roles.
131131 modifier onlyOwnerOrRoles (uint256 _roles ) {
132- OwnableRolesLib._checkOwnerOrRoles (_roles);
132+ OwnableRolesLib.checkOwnerOrRoles (_roles);
133133 _;
134134 }
135135
136136 /// @dev Marks a function as only callable by an account with `roles` or the owner.
137137 /// Checks for roles first, then lazily checks for ownership.
138138 modifier onlyRolesOrOwner (uint256 _roles ) {
139- OwnableRolesLib._checkRolesOrOwner (_roles);
139+ OwnableRolesLib.checkRolesOrOwner (_roles);
140140 _;
141141 }
142142}
0 commit comments