Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Commit f8f76d0

Browse files
authored
Merge pull request #13 from OpenSeaProtocol/oz-n01
OpenZeppelin N-01: Constants not using upper case format
2 parents dab3eba + bce3a35 commit f8f76d0

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/OwnedRegistrant.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import {Ownable2Step} from "openzeppelin-contracts/access/Ownable2Step.sol";
1111
*/
1212
contract OwnedRegistrant is Ownable2Step {
1313
/// @dev The default registry address.
14-
address constant registry = 0x000000000000AAeB6D7670E522A718067333cd4E;
14+
address constant REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E;
1515

1616
/// @dev The constructor that is called when the contract is being deployed.
1717
constructor(address _owner) {
18-
IOperatorFilterRegistry(registry).register(address(this));
18+
IOperatorFilterRegistry(REGISTRY).register(address(this));
1919
transferOwnership(_owner);
2020
}
2121
}

src/upgradeable/OperatorFiltererUpgradeable.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ abstract contract OperatorFiltererUpgradeable is Initializable {
1616
/// @notice Emitted when an operator is not allowed.
1717
error OperatorNotAllowed(address operator);
1818

19-
IOperatorFilterRegistry constant operatorFilterRegistry =
19+
IOperatorFilterRegistry constant OPERATOR_FILTER_REGISTRY =
2020
IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);
2121

2222
/// @dev The upgradeable initialize function that should be called when the contract is being upgraded.
@@ -27,15 +27,15 @@ abstract contract OperatorFiltererUpgradeable is Initializable {
2727
// If an inheriting token contract is deployed to a network without the registry deployed, the modifier
2828
// will not revert, but the contract will need to be registered with the registry once it is deployed in
2929
// order for the modifier to filter addresses.
30-
if (address(operatorFilterRegistry).code.length > 0) {
31-
if (!operatorFilterRegistry.isRegistered(address(this))) {
30+
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
31+
if (!OPERATOR_FILTER_REGISTRY.isRegistered(address(this))) {
3232
if (subscribe) {
33-
operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
33+
OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
3434
} else {
3535
if (subscriptionOrRegistrantToCopy != address(0)) {
36-
operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
36+
OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
3737
} else {
38-
operatorFilterRegistry.register(address(this));
38+
OPERATOR_FILTER_REGISTRY.register(address(this));
3939
}
4040
}
4141
}
@@ -68,11 +68,11 @@ abstract contract OperatorFiltererUpgradeable is Initializable {
6868
*/
6969
function _checkFilterOperator(address operator) internal view virtual {
7070
// Check registry code length to facilitate testing in environments without a deployed registry.
71-
if (address(operatorFilterRegistry).code.length > 0) {
71+
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
7272
// under normal circumstances, this function will revert rather than return false, but inheriting or
7373
// upgraded contracts may specify their own OperatorFilterRegistry implementations, which may behave
7474
// differently
75-
if (!operatorFilterRegistry.isOperatorAllowed(address(this), operator)) {
75+
if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
7676
revert OperatorNotAllowed(operator);
7777
}
7878
}

src/upgradeable/RevokableOperatorFiltererUpgradeable.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ abstract contract RevokableOperatorFiltererUpgradeable is OperatorFiltererUpgrad
5050
// Check registry code length to facilitate testing in environments without a deployed registry.
5151
if (
5252
!RevokableOperatorFiltererUpgradeableStorage.layout()._isOperatorFilterRegistryRevoked
53-
&& address(operatorFilterRegistry).code.length > 0
53+
&& address(OPERATOR_FILTER_REGISTRY).code.length > 0
5454
) {
5555
// under normal circumstances, this function will revert rather than return false, but inheriting or
5656
// upgraded contracts may specify their own OperatorFilterRegistry implementations, which may behave
5757
// differently
58-
if (!operatorFilterRegistry.isOperatorAllowed(address(this), operator)) {
58+
if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
5959
revert OperatorNotAllowed(operator);
6060
}
6161
}

0 commit comments

Comments
 (0)