From f88fea0acbe3621946633584a38bd4876e3dbabd Mon Sep 17 00:00:00 2001 From: Marco Peyfuss Date: Mon, 25 Dec 2023 16:54:15 -0700 Subject: [PATCH 1/4] modules --- .gitmodules | 12 --- Makefile | 2 - lib/forge-std | 1 - lib/openzeppelin-contracts | 1 - lib/openzeppelin-contracts-upgradeable | 1 - lib/tl-sol-tools | 1 - remappings.txt | 5 - src/BlockAllRegistry.sol | 7 +- src/BlockList.sol | 82 ---------------- src/BlockListRegistry.sol | 44 ++++----- src/BlockListRegistryFactory.sol | 11 ++- src/BlockListUpgradeable.sol | 95 ------------------- src/IBlockList.sol | 28 ------ src/IBlockListRegistry.sol | 17 ++-- test/{unit_tests => }/BlockAllRegistry.t.sol | 2 +- test/{unit_tests => }/BlockListRegistry.t.sol | 6 +- .../BlockListRegistryFactory.t.sol | 2 +- .../BlockAllIntegration.t.sol | 24 ----- .../BlockListIntegration.t.sol | 78 --------------- .../BlockListUpgradeableIntegration.t.sol | 79 --------------- test/mocks/BlockListMock.sol | 36 ------- test/mocks/BlockListMockUpgradeable.sol | 42 -------- test/mocks/FakeBlockList.sol | 10 -- test/unit_tests/BlockList.t.sol | 93 ------------------ test/unit_tests/BlockListUpgradeable.t.sol | 94 ------------------ 25 files changed, 43 insertions(+), 730 deletions(-) delete mode 160000 lib/forge-std delete mode 160000 lib/openzeppelin-contracts delete mode 160000 lib/openzeppelin-contracts-upgradeable delete mode 160000 lib/tl-sol-tools delete mode 100644 remappings.txt delete mode 100644 src/BlockList.sol delete mode 100644 src/BlockListUpgradeable.sol delete mode 100644 src/IBlockList.sol rename test/{unit_tests => }/BlockAllRegistry.t.sol (91%) rename test/{unit_tests => }/BlockListRegistry.t.sol (94%) rename test/{unit_tests => }/BlockListRegistryFactory.t.sol (94%) delete mode 100644 test/integration_tests/BlockAllIntegration.t.sol delete mode 100644 test/integration_tests/BlockListIntegration.t.sol delete mode 100644 test/integration_tests/BlockListUpgradeableIntegration.t.sol delete mode 100644 test/mocks/BlockListMock.sol delete mode 100644 test/mocks/BlockListMockUpgradeable.sol delete mode 100644 test/mocks/FakeBlockList.sol delete mode 100644 test/unit_tests/BlockList.t.sol delete mode 100644 test/unit_tests/BlockListUpgradeable.t.sol diff --git a/.gitmodules b/.gitmodules index bf05eef..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +0,0 @@ -[submodule "lib/forge-std"] - path = lib/forge-std - url = https://github.com/foundry-rs/forge-std -[submodule "lib/openzeppelin-contracts"] - path = lib/openzeppelin-contracts - url = https://github.com/OpenZeppelin/openzeppelin-contracts -[submodule "lib/openzeppelin-contracts-upgradeable"] - path = lib/openzeppelin-contracts-upgradeable - url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable -[submodule "lib/tl-sol-tools"] - path = lib/tl-sol-tools - url = https://github.com/Transient-Labs/tl-sol-tools diff --git a/Makefile b/Makefile index 6052d7d..b98577b 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,6 @@ remove: # Install the Modules install: forge install foundry-rs/forge-std - forge install OpenZeppelin/openzeppelin-contracts@v4.8.3 - forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v4.8.3 forge install Transient-Labs/tl-sol-tools@2.2.1 # Update modules diff --git a/lib/forge-std b/lib/forge-std deleted file mode 160000 index e8a047e..0000000 --- a/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e8a047e3f40f13fa37af6fe14e6e06283d9a060e diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts deleted file mode 160000 index 0a25c19..0000000 --- a/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0a25c1940ca220686588c4af3ec526f725fe2582 diff --git a/lib/openzeppelin-contracts-upgradeable b/lib/openzeppelin-contracts-upgradeable deleted file mode 160000 index 58fa0f8..0000000 --- a/lib/openzeppelin-contracts-upgradeable +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 58fa0f81c4036f1a3b616fdffad2fd27e5d5ce21 diff --git a/lib/tl-sol-tools b/lib/tl-sol-tools deleted file mode 160000 index a6704b6..0000000 --- a/lib/tl-sol-tools +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a6704b6ae509adcf676a487b0491f1f92cf1d0a3 diff --git a/remappings.txt b/remappings.txt deleted file mode 100644 index 907c7e5..0000000 --- a/remappings.txt +++ /dev/null @@ -1,5 +0,0 @@ -ds-test/=lib/forge-std/lib/ds-test/src/ -forge-std/=lib/forge-std/src -openzeppelin/=lib/openzeppelin-contracts/contracts/ -openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ -tl-sol-tools/=lib/tl-sol-tools/src/ \ No newline at end of file diff --git a/src/BlockAllRegistry.sol b/src/BlockAllRegistry.sol index 6d12d41..7c49304 100644 --- a/src/BlockAllRegistry.sol +++ b/src/BlockAllRegistry.sol @@ -1,13 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {IBlockListRegistry} from "./IBlockListRegistry.sol"; +import {IBlockListRegistry} from "src/IBlockListRegistry.sol"; /// @title BlockAllRegistry -/// @notice BlockList that blocks all approvals -/// can be used as a semi-soulbound token +/// @notice BlockList that blocks all approvals and can be used as a semi-soulbound token /// @author transientlabs.xyz -/// @custom:version 4.1.0 +/// @custom:version 4.0.2 contract BlockAllRegistry is IBlockListRegistry { /// @inheritdoc IBlockListRegistry diff --git a/src/BlockList.sol b/src/BlockList.sol deleted file mode 100644 index 39e2349..0000000 --- a/src/BlockList.sol +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.19; - -import {BlockedOperator, Unauthorized, IBlockList} from "./IBlockList.sol"; -import {IBlockListRegistry} from "./IBlockListRegistry.sol"; - -/// @title BlockList -/// @author transientlabs.xyz -/// @notice abstract contract that can be inherited to block -/// approvals from non-royalty paying marketplaces -/// @custom:version 4.0.0 -abstract contract BlockList is IBlockList { - /*////////////////////////////////////////////////////////////////////////// - Public State Variables - //////////////////////////////////////////////////////////////////////////*/ - - IBlockListRegistry public blockListRegistry; - - /*////////////////////////////////////////////////////////////////////////// - Events - //////////////////////////////////////////////////////////////////////////*/ - - event BlockListRegistryUpdated(address indexed caller, address indexed oldRegistry, address indexed newRegistry); - - /*////////////////////////////////////////////////////////////////////////// - Modifiers - //////////////////////////////////////////////////////////////////////////*/ - - /// @dev modifier that can be applied to approval functions in order to block listings on marketplaces - modifier notBlocked(address operator) { - if (getBlockListStatus(operator)) { - revert BlockedOperator(); - } - _; - } - - /*////////////////////////////////////////////////////////////////////////// - Constructor - //////////////////////////////////////////////////////////////////////////*/ - - /// @param blockListRegistryAddr - the initial BlockList Registry Address - constructor(address blockListRegistryAddr) { - blockListRegistry = IBlockListRegistry(blockListRegistryAddr); - emit BlockListRegistryUpdated(msg.sender, address(0), blockListRegistryAddr); - } - - /*////////////////////////////////////////////////////////////////////////// - Admin Functions - //////////////////////////////////////////////////////////////////////////*/ - - /// @notice function to transfer ownership of the blockList - /// @dev requires blockList admin - /// @dev can be transferred to the ZERO_ADDRESS if desired - /// @dev BE VERY CAREFUL USING THIS - /// @param newBlockListRegistry - the address of the new BlockList registry - function updateBlockListRegistry(address newBlockListRegistry) public { - if (!isBlockListAdmin(msg.sender)) revert Unauthorized(); - - address oldRegistry = address(blockListRegistry); - blockListRegistry = IBlockListRegistry(newBlockListRegistry); - emit BlockListRegistryUpdated(msg.sender, oldRegistry, newBlockListRegistry); - } - - /*////////////////////////////////////////////////////////////////////////// - Public Read Functions - //////////////////////////////////////////////////////////////////////////*/ - - /// @inheritdoc IBlockList - function getBlockListStatus(address operator) public view override returns (bool) { - if (address(blockListRegistry).code.length == 0) return false; - try blockListRegistry.getBlockListStatus(operator) returns (bool isBlocked) { - return isBlocked; - } catch { - return false; - } - } - - /// @notice Abstract function to determine if an address is a blocklist admin. - /// @param potentialAdmin - the potential admin address to check - function isBlockListAdmin(address potentialAdmin) public view virtual returns (bool); -} diff --git a/src/BlockListRegistry.sol b/src/BlockListRegistry.sol index 1878085..2470624 100644 --- a/src/BlockListRegistry.sol +++ b/src/BlockListRegistry.sol @@ -2,18 +2,19 @@ pragma solidity 0.8.19; import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol"; -import {OwnableAccessControlUpgradeable} from "tl-sol-tools/upgradeable/access/OwnableAccessControlUpgradeable.sol"; -import {IBlockListRegistry} from "./IBlockListRegistry.sol"; +import {OwnableAccessControlUpgradeable} from "lib/tl-sol-tools/src/upgradeable/access/OwnableAccessControlUpgradeable.sol"; +import {IBlockListRegistry} from "src/IBlockListRegistry.sol"; -/// @title BlockList -/// @notice abstract contract that can be inherited to block -/// approvals from non-royalty paying marketplaces +/// @title BlockListRegistry +/// @notice Registry that can be used to block approvals from non-royalty paying marketplaces /// @author transientlabs.xyz /// @custom:version 4.0.0 contract BlockListRegistry is IBlockListRegistry, OwnableAccessControlUpgradeable, ERC165Upgradeable { + /*////////////////////////////////////////////////////////////////////////// Constants //////////////////////////////////////////////////////////////////////////*/ + bytes32 public constant BLOCK_LIST_ADMIN_ROLE = keccak256("BLOCK_LIST_ADMIN_ROLE"); /*////////////////////////////////////////////////////////////////////////// @@ -27,13 +28,14 @@ contract BlockListRegistry is IBlockListRegistry, OwnableAccessControlUpgradeabl Constructor //////////////////////////////////////////////////////////////////////////*/ - /// @param disable - disable the initalizer on deployment + /// @param disable Disable the initalizer on deployment constructor(bool disable) { if (disable) _disableInitializers(); } - /// @param newOwner - the initial owner of this contract - /// @param initBlockList - initial list of addresses to add to the blocklist + /// @notice Function that can be called once to initialize the registry + /// @param newOwner The initial owner of this contract + /// @param initBlockList Initial list of addresses to add to the blocklist function initialize(address newOwner, address[] memory initBlockList) external initializer { uint256 len = initBlockList.length; for (uint8 i = 0; i < len; i++) { @@ -46,11 +48,8 @@ contract BlockListRegistry is IBlockListRegistry, OwnableAccessControlUpgradeabl Admin Functions //////////////////////////////////////////////////////////////////////////*/ - /// @notice function to clear the block list status - /// @dev must be called by the blockList owner or admin - /// @dev the blockList owner is likely the same as the owner of the token contract - /// but this could be different under certain applications. This implementation - /// makes no assumption of this though as it is standalone from the token contract. + /// @inheritdoc IBlockListRegistry + /// @dev Must be called by the blockList owner or blocklist admin function clearBlockList() external onlyRoleOrOwner(BLOCK_LIST_ADMIN_ROLE) { _c++; emit BlockListCleared(msg.sender); @@ -60,8 +59,7 @@ contract BlockListRegistry is IBlockListRegistry, OwnableAccessControlUpgradeabl Public Read Functions //////////////////////////////////////////////////////////////////////////*/ - /// @notice function to get blocklist status with True meaning that the operator is blocked - /// @param operator - the address to check on the BlockList + /// @inheritdoc IBlockListRegistry function getBlockListStatus(address operator) public view returns (bool) { return _getBlockListStatus(operator); } @@ -75,11 +73,7 @@ contract BlockListRegistry is IBlockListRegistry, OwnableAccessControlUpgradeabl Public Write Functions //////////////////////////////////////////////////////////////////////////*/ - /// @notice function to set the block list status for multiple operators - /// @dev must be called by the blockList owner or admin - /// @dev the blockList owner is likely the same as the owner of the token contract - /// but this could be different under certain applications. This implementation - /// makes no assumption of this though as it is standalone from the token contract. + /// @inheritdoc IBlockListRegistry function setBlockListStatus(address[] calldata operators, bool status) external onlyRoleOrOwner(BLOCK_LIST_ADMIN_ROLE) @@ -93,15 +87,15 @@ contract BlockListRegistry is IBlockListRegistry, OwnableAccessControlUpgradeabl Internal Functions //////////////////////////////////////////////////////////////////////////*/ - /// @notice internal function to get blockList status - /// @param operator - the address for which to get the BlockList status + /// @notice Internal function to get blockList status + /// @param operator The address for which to get the BlockList status function _getBlockListStatus(address operator) internal view returns (bool) { return _blockList[_c][operator]; } - /// @notice internal function to set blockList status for one operator - /// @param operator - address to set the status for - /// @param status - True means add to the BlockList + /// @notice Internal function to set blockList status for one operator + /// @param operator Address to set the status for + /// @param status True means add to the BlockList function _setBlockListStatus(address operator, bool status) internal { _blockList[_c][operator] = status; emit BlockListStatusChange(msg.sender, operator, status); diff --git a/src/BlockListRegistryFactory.sol b/src/BlockListRegistryFactory.sol index 73c3222..c197e7b 100644 --- a/src/BlockListRegistryFactory.sol +++ b/src/BlockListRegistryFactory.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {Ownable} from "openzeppelin/access/Ownable.sol"; -import {Clones} from "openzeppelin/proxy/Clones.sol"; -import {BlockListRegistry} from "./BlockListRegistry.sol"; +import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; +import {Clones} from "lib/openzeppelin-contracts/contracts/proxy/Clones.sol"; +import {BlockListRegistry} from "src/BlockListRegistry.sol"; /// @title BlockListFactory -/// @notice contract factory to deploy blocklist registries. +/// @notice Contract factory to deploy blocklist registries. /// @author transientlabs.xyz /// @custom:version 4.0.0 contract BlockListRegistryFactory is Ownable { @@ -26,6 +26,7 @@ contract BlockListRegistryFactory is Ownable { /*////////////////////////////////////////////////////////////////////////// Constructor //////////////////////////////////////////////////////////////////////////*/ + constructor(address initRegistryTemplate) Ownable() { blockListRegistryTemplate = initRegistryTemplate; } @@ -35,8 +36,8 @@ contract BlockListRegistryFactory is Ownable { //////////////////////////////////////////////////////////////////////////*/ /// @notice Update the address of the blocklist registry template used. - /// @param newBlockListRegistryTemplate Address of template to be used by clones. /// @dev Must be contract owner to call. + /// @param newBlockListRegistryTemplate Address of template to be used by clones. function setBlockListRegistryTemplate(address newBlockListRegistryTemplate) external onlyOwner { blockListRegistryTemplate = newBlockListRegistryTemplate; } diff --git a/src/BlockListUpgradeable.sol b/src/BlockListUpgradeable.sol deleted file mode 100644 index 3f7a1cc..0000000 --- a/src/BlockListUpgradeable.sol +++ /dev/null @@ -1,95 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.19; - -import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; -import {BlockedOperator, Unauthorized, IBlockList} from "./IBlockList.sol"; -import {IBlockListRegistry} from "./IBlockListRegistry.sol"; - -/// @title BlockList -/// @author transientlabs.xyz -/// @notice abstract contract that can be inherited to block -/// approvals from non-royalty paying marketplaces -/// @custom:version 4.0.0 -abstract contract BlockListUpgradeable is Initializable, IBlockList { - /*////////////////////////////////////////////////////////////////////////// - Public State Variables - //////////////////////////////////////////////////////////////////////////*/ - - IBlockListRegistry public blockListRegistry; - - /*////////////////////////////////////////////////////////////////////////// - Events - //////////////////////////////////////////////////////////////////////////*/ - - event BlockListRegistryUpdated(address indexed caller, address indexed oldRegistry, address indexed newRegistry); - - /*////////////////////////////////////////////////////////////////////////// - Modifiers - //////////////////////////////////////////////////////////////////////////*/ - - /// @dev modifier that can be applied to approval functions in order to block listings on marketplaces - modifier notBlocked(address operator) { - if (getBlockListStatus(operator)) { - revert BlockedOperator(); - } - _; - } - - /*////////////////////////////////////////////////////////////////////////// - Initializer - //////////////////////////////////////////////////////////////////////////*/ - - /// @param blockListRegistryAddr - the initial BlockList Registry Address - function __BlockList_init(address blockListRegistryAddr) internal onlyInitializing { - __BlockList_init_unchained(blockListRegistryAddr); - } - - /// @param blockListRegistryAddr - the initial BlockList Registry Address - function __BlockList_init_unchained(address blockListRegistryAddr) internal onlyInitializing { - blockListRegistry = IBlockListRegistry(blockListRegistryAddr); - emit BlockListRegistryUpdated(msg.sender, address(0), blockListRegistryAddr); - } - - /*////////////////////////////////////////////////////////////////////////// - Admin Functions - //////////////////////////////////////////////////////////////////////////*/ - - /// @notice function to transfer ownership of the blockList - /// @dev requires blockList owner - /// @dev can be transferred to the ZERO_ADDRESS if desired - /// @dev BE VERY CAREFUL USING THIS - /// @param newBlockListRegistry - the address of the new BlockList registry - function updateBlockListRegistry(address newBlockListRegistry) public { - if (!isBlockListAdmin(msg.sender)) revert Unauthorized(); - - address oldRegistry = address(blockListRegistry); - blockListRegistry = IBlockListRegistry(newBlockListRegistry); - emit BlockListRegistryUpdated(msg.sender, oldRegistry, newBlockListRegistry); - } - - /*////////////////////////////////////////////////////////////////////////// - Public Read Functions - //////////////////////////////////////////////////////////////////////////*/ - - /// @inheritdoc IBlockList - function getBlockListStatus(address operator) public view override returns (bool) { - if (address(blockListRegistry).code.length == 0) return false; - try blockListRegistry.getBlockListStatus(operator) returns (bool isBlocked) { - return isBlocked; - } catch { - return false; - } - } - - /// @notice Abstract function to determine if the operator is a blocklist admin. - /// @param potentialAdmin - the potential admin address to check - function isBlockListAdmin(address potentialAdmin) public view virtual returns (bool); - - /*////////////////////////////////////////////////////////////////////////// - Upgradeability Gap - //////////////////////////////////////////////////////////////////////////*/ - - /// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps - uint256[50] private _gap; -} diff --git a/src/IBlockList.sol b/src/IBlockList.sol deleted file mode 100644 index ac98a77..0000000 --- a/src/IBlockList.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.19; - -/*////////////////////////////////////////////////////////////////////////// - Custom Errors -//////////////////////////////////////////////////////////////////////////*/ - -/// @dev blocked operator error -error BlockedOperator(); - -/// @dev unauthorized to call fn method -error Unauthorized(); - -/*////////////////////////////////////////////////////////////////////////// - IBlockList -//////////////////////////////////////////////////////////////////////////*/ - -/// @title IBlockList -/// @notice interface for the BlockList Contract -/// @author transientlabs.xyz -/// @custom:version 4.0.0 -interface IBlockList { - /// @notice function to get blocklist status with True meaning that the operator is blocked - /// @dev must return false if the blocklist registry is an EOA or an incompatible contract, true/false if compatible - /// @param operator - operator to check against for blocking - function getBlockListStatus(address operator) external view returns (bool); -} diff --git a/src/IBlockListRegistry.sol b/src/IBlockListRegistry.sol index 77eaab3..74ab310 100644 --- a/src/IBlockListRegistry.sol +++ b/src/IBlockListRegistry.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.19; /// @title BlockList Registry -/// @notice interface for the BlockListRegistry Contract +/// @notice Interface for the BlockListRegistry Contract /// @author transientlabs.xyz -/// @custom:version 4.0.0 +/// @custom:version 4.0.2 interface IBlockListRegistry { /*////////////////////////////////////////////////////////////////////////// Events @@ -18,18 +18,21 @@ interface IBlockListRegistry { Public Read Functions //////////////////////////////////////////////////////////////////////////*/ - /// @notice function to get blocklist status with True meaning that the operator is blocked + /// @notice Function to get blocklist status with True meaning that the operator is blocked + /// @param operator The operator in question to check against the blocklist function getBlockListStatus(address operator) external view returns (bool); /*////////////////////////////////////////////////////////////////////////// Public Write Functions //////////////////////////////////////////////////////////////////////////*/ - /// @notice function to set the block list status for multiple operators - /// @dev must be called by the blockList owner + /// @notice Function to set the block list status for multiple operators + /// @dev Must be called by the blockList owner + /// @param operators An address array of operators to set a status for + /// @param status The status to set for all `operators` function setBlockListStatus(address[] calldata operators, bool status) external; - /// @notice function to clear the block list status - /// @dev must be called by the blockList owner + /// @notice Function to clear the block list status + /// @dev Must be called by the blockList owner function clearBlockList() external; } diff --git a/test/unit_tests/BlockAllRegistry.t.sol b/test/BlockAllRegistry.t.sol similarity index 91% rename from test/unit_tests/BlockAllRegistry.t.sol rename to test/BlockAllRegistry.t.sol index d685d29..a2612d5 100644 --- a/test/unit_tests/BlockAllRegistry.t.sol +++ b/test/BlockAllRegistry.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import "forge-std/Test.sol"; -import {BlockAllRegistry} from "../../src/BlockAllRegistry.sol"; +import {BlockAllRegistry} from "src/BlockAllRegistry.sol"; contract BlockAllRegistryUnitTest is Test { diff --git a/test/unit_tests/BlockListRegistry.t.sol b/test/BlockListRegistry.t.sol similarity index 94% rename from test/unit_tests/BlockListRegistry.t.sol rename to test/BlockListRegistry.t.sol index 9deb0a4..0c1ca2c 100644 --- a/test/unit_tests/BlockListRegistry.t.sol +++ b/test/BlockListRegistry.t.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.19; import "forge-std/Test.sol"; -import {NotRoleOrOwner} from "tl-sol-tools/access/OwnableAccessControl.sol"; -import {BlockListRegistry, IBlockListRegistry} from "../../src/BlockListRegistry.sol"; -import {IERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol"; +import {NotRoleOrOwner} from "lib/tl-sol-tools/src/access/OwnableAccessControl.sol"; +import {BlockListRegistry, IBlockListRegistry} from "src/BlockListRegistry.sol"; +import {IERC165Upgradeable} from "lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/IERC165Upgradeable.sol"; contract BlockListRegistryUnitTest is Test, BlockListRegistry { address[] public initBlockedOperators = [address(1), address(2), address(3)]; diff --git a/test/unit_tests/BlockListRegistryFactory.t.sol b/test/BlockListRegistryFactory.t.sol similarity index 94% rename from test/unit_tests/BlockListRegistryFactory.t.sol rename to test/BlockListRegistryFactory.t.sol index d5b5eff..ff96236 100644 --- a/test/unit_tests/BlockListRegistryFactory.t.sol +++ b/test/BlockListRegistryFactory.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import "forge-std/Test.sol"; -import {BlockListRegistryFactory} from "../../src/BlockListRegistryFactory.sol"; +import {BlockListRegistryFactory} from "src/BlockListRegistryFactory.sol"; contract BlockListRegistryFactoryUnitTest is Test { BlockListRegistryFactory public factory; diff --git a/test/integration_tests/BlockAllIntegration.t.sol b/test/integration_tests/BlockAllIntegration.t.sol deleted file mode 100644 index db4b795..0000000 --- a/test/integration_tests/BlockAllIntegration.t.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import "forge-std/Test.sol"; -import {BlockedOperator} from "../../src/IBlockList.sol"; -import {BlockAllRegistry} from "../../src/BlockAllRegistry.sol"; -import {BlockListMock} from "../mocks/BlockListMock.sol"; - -contract BlockAllIntegrationTest is Test { - - BlockListMock public mockContract; - - function setUp() public { - BlockAllRegistry registry = new BlockAllRegistry(); - mockContract = new BlockListMock(address(registry)); - } - - // Test blocking all registry - function testNewRegistry(address operator) public { - vm.expectRevert(BlockedOperator.selector); - mockContract.setApprovalForAll(operator, true); - } - -} \ No newline at end of file diff --git a/test/integration_tests/BlockListIntegration.t.sol b/test/integration_tests/BlockListIntegration.t.sol deleted file mode 100644 index e431d53..0000000 --- a/test/integration_tests/BlockListIntegration.t.sol +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import "forge-std/Test.sol"; -import {BlockedOperator} from "../../src/IBlockList.sol"; -import {BlockListRegistryFactory} from "../../src/BlockListRegistryFactory.sol"; -import {BlockListRegistry, IBlockListRegistry} from "../../src/BlockListRegistry.sol"; -import {BlockListMock} from "../mocks/BlockListMock.sol"; - -contract BlockListIntegrationTest is Test { - address public blockListRegistryTemplate; - address public registry; - BlockListRegistryFactory public factory; - BlockListMock public mockContract; - address[] public blockList; - - function setUp() public { - blockList.push(address(1)); - blockList.push(address(2)); - blockList.push(address(3)); - - blockListRegistryTemplate = address(new BlockListRegistry(true)); - factory = new BlockListRegistryFactory(blockListRegistryTemplate); - registry = factory.createBlockListRegistry(blockList); - mockContract = new BlockListMock(registry); - } - - // Test Initialization - function testInitialization() public { - assertTrue(mockContract.getBlockListStatus(address(1))); - assertTrue(mockContract.getBlockListStatus(address(2))); - assertTrue(mockContract.getBlockListStatus(address(3))); - assertFalse(mockContract.getBlockListStatus(address(4))); - } - - // Test Add & Remove Blocked Operators - function testAddRemoveOperators() public { - address[] memory newOperators = new address[](4); - newOperators[0] = address(4); - newOperators[1] = address(5); - newOperators[2] = address(6); - newOperators[3] = address(7); - - // add operators - BlockListRegistry(registry).setBlockListStatus(newOperators, true); - assertTrue(mockContract.getBlockListStatus(address(4))); - assertTrue(mockContract.getBlockListStatus(address(5))); - assertTrue(mockContract.getBlockListStatus(address(6))); - assertTrue(mockContract.getBlockListStatus(address(7))); - - for (uint256 i = 0; i < newOperators.length; i++) { - vm.expectRevert(BlockedOperator.selector); - mockContract.setApprovalForAll(newOperators[i], true); - } - - // remove operators - BlockListRegistry(registry).setBlockListStatus(newOperators, false); - assertFalse(mockContract.getBlockListStatus(address(4))); - assertFalse(mockContract.getBlockListStatus(address(5))); - assertFalse(mockContract.getBlockListStatus(address(6))); - assertFalse(mockContract.getBlockListStatus(address(7))); - - for (uint256 i = 0; i < newOperators.length; i++) { - mockContract.setApprovalForAll(newOperators[i], true); - assertTrue(mockContract.isApprovedForAll(address(this), newOperators[i])); - } - } - - // Test New Registry - function testNewRegistry(address[] calldata blockedOperators) public { - address newRegistry = address(factory.createBlockListRegistry(blockedOperators)); - mockContract.updateBlockListRegistry(newRegistry); - for (uint256 i = 0; i < blockedOperators.length; i++) { - vm.expectRevert(BlockedOperator.selector); - mockContract.setApprovalForAll(blockedOperators[i], true); - } - } -} diff --git a/test/integration_tests/BlockListUpgradeableIntegration.t.sol b/test/integration_tests/BlockListUpgradeableIntegration.t.sol deleted file mode 100644 index c4c25ad..0000000 --- a/test/integration_tests/BlockListUpgradeableIntegration.t.sol +++ /dev/null @@ -1,79 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import "forge-std/Test.sol"; -import {BlockedOperator} from "../../src/IBlockList.sol"; -import {BlockListRegistryFactory} from "../../src/BlockListRegistryFactory.sol"; -import {BlockListRegistry, IBlockListRegistry} from "../../src/BlockListRegistry.sol"; -import {BlockListMockUpgradeable} from "../mocks/BlockListMockUpgradeable.sol"; - -contract BlockListUpgradeableIntegrationTest is Test { - address public blockListRegistryTemplate; - address public registry; - BlockListRegistryFactory public factory; - BlockListMockUpgradeable public mockContract; - address[] public blockList; - - function setUp() public { - blockList.push(address(1)); - blockList.push(address(2)); - blockList.push(address(3)); - - blockListRegistryTemplate = address(new BlockListRegistry(true)); - factory = new BlockListRegistryFactory(blockListRegistryTemplate); - registry = factory.createBlockListRegistry(blockList); - mockContract = new BlockListMockUpgradeable(); - mockContract.initialize(registry); - } - - // Test Initialization - function testInitialization() public { - assertTrue(mockContract.getBlockListStatus(address(1))); - assertTrue(mockContract.getBlockListStatus(address(2))); - assertTrue(mockContract.getBlockListStatus(address(3))); - assertFalse(mockContract.getBlockListStatus(address(4))); - } - - // Test Add & Remove Blocked Operators - function testAddRemoveOperators() public { - address[] memory newOperators = new address[](4); - newOperators[0] = address(4); - newOperators[1] = address(5); - newOperators[2] = address(6); - newOperators[3] = address(7); - - // add operators - BlockListRegistry(registry).setBlockListStatus(newOperators, true); - assertTrue(mockContract.getBlockListStatus(address(4))); - assertTrue(mockContract.getBlockListStatus(address(5))); - assertTrue(mockContract.getBlockListStatus(address(6))); - assertTrue(mockContract.getBlockListStatus(address(7))); - - for (uint256 i = 0; i < newOperators.length; i++) { - vm.expectRevert(BlockedOperator.selector); - mockContract.setApprovalForAll(newOperators[i], true); - } - - // remove operators - BlockListRegistry(registry).setBlockListStatus(newOperators, false); - assertFalse(mockContract.getBlockListStatus(address(4))); - assertFalse(mockContract.getBlockListStatus(address(5))); - assertFalse(mockContract.getBlockListStatus(address(6))); - assertFalse(mockContract.getBlockListStatus(address(7))); - - for (uint256 i = 0; i < newOperators.length; i++) { - mockContract.setApprovalForAll(newOperators[i], true); - assertTrue(mockContract.isApprovedForAll(address(this), newOperators[i])); - } - } - - // Test New Registry - function testNewRegistry(address[] calldata blockedOperators) public { - address newRegistry = address(factory.createBlockListRegistry(blockedOperators)); - mockContract.updateBlockListRegistry(newRegistry); - for (uint256 i = 0; i < blockedOperators.length; i++) { - vm.expectRevert(BlockedOperator.selector); - mockContract.setApprovalForAll(blockedOperators[i], true); - } - } -} diff --git a/test/mocks/BlockListMock.sol b/test/mocks/BlockListMock.sol deleted file mode 100644 index 6975cae..0000000 --- a/test/mocks/BlockListMock.sol +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {BlockList} from "../../src/BlockList.sol"; -import {ERC721} from "openzeppelin/token/ERC721/ERC721.sol"; -import {OwnableAccessControl} from "tl-sol-tools/access/OwnableAccessControl.sol"; - -contract BlockListMock is ERC721, OwnableAccessControl, BlockList { - uint256 private _counter; - - constructor(address newBlockListRegistry) - ERC721("Mock", "MOCK") - OwnableAccessControl() - BlockList(newBlockListRegistry) - {} - - /// @inheritdoc BlockList - function isBlockListAdmin(address potentialAdmin) public view override returns (bool) { - return potentialAdmin == owner(); - } - - /// @dev mint function - function mint() external onlyOwner { - _counter++; - _mint(msg.sender, _counter); - } - - /// @dev blocked approvals - function approve(address to, uint256 tokenId) public override notBlocked(to) { - super.approve(to, tokenId); - } - - function setApprovalForAll(address operator, bool approved) public override notBlocked(operator) { - super.setApprovalForAll(operator, approved); - } -} diff --git a/test/mocks/BlockListMockUpgradeable.sol b/test/mocks/BlockListMockUpgradeable.sol deleted file mode 100644 index adcc224..0000000 --- a/test/mocks/BlockListMockUpgradeable.sol +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {BlockListUpgradeable} from "../../src/BlockListUpgradeable.sol"; -import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; -import {ERC721Upgradeable} from "openzeppelin-upgradeable/token/ERC721/ERC721Upgradeable.sol"; -import {OwnableAccessControlUpgradeable} from "tl-sol-tools/upgradeable/access/OwnableAccessControlUpgradeable.sol"; - -contract BlockListMockUpgradeable is - Initializable, - ERC721Upgradeable, - OwnableAccessControlUpgradeable, - BlockListUpgradeable -{ - uint256 private _counter; - - function initialize(address newBlockListRegistry) external initializer { - __ERC721_init("Mock", "MOCK"); - __OwnableAccessControl_init(msg.sender); - __BlockList_init(newBlockListRegistry); - } - - /// @inheritdoc BlockListUpgradeable - function isBlockListAdmin(address potentialAdmin) public view override returns (bool) { - return potentialAdmin == owner(); - } - - /// @dev mint function - function mint() external onlyOwner { - _counter++; - _mint(msg.sender, _counter); - } - - /// @dev blocked approvals - function approve(address to, uint256 tokenId) public override notBlocked(to) { - super.approve(to, tokenId); - } - - function setApprovalForAll(address operator, bool approved) public override notBlocked(operator) { - super.setApprovalForAll(operator, approved); - } -} diff --git a/test/mocks/FakeBlockList.sol b/test/mocks/FakeBlockList.sol deleted file mode 100644 index 6aed638..0000000 --- a/test/mocks/FakeBlockList.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -contract FakeBlockList { - uint256 public number; - - constructor() { - number = 1; - } -} diff --git a/test/unit_tests/BlockList.t.sol b/test/unit_tests/BlockList.t.sol deleted file mode 100644 index 64b5a3b..0000000 --- a/test/unit_tests/BlockList.t.sol +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import "forge-std/Test.sol"; -import {Unauthorized, BlockedOperator} from "../../src/IBlockList.sol"; -import {IBlockListRegistry} from "../../src/IBlockListRegistry.sol"; -import {BlockListMock} from "../mocks/BlockListMock.sol"; -import {FakeBlockList} from "../mocks/FakeBlockList.sol"; - -contract BlockListUnitTest is Test { - event BlockListRegistryUpdated(address indexed caller, address indexed oldRegistry, address indexed newRegistry); - - BlockListMock public mockContract; - - function setUp() public { - mockContract = new BlockListMock(address(0)); - mockContract.mint(); - } - - function testInitialization() public { - assertTrue(mockContract.isBlockListAdmin(address(this))); - assertEq(address(mockContract.blockListRegistry()), address(0)); - } - - /// @dev test to ensure the try/catch works as intended on EOA registries - function testZeroAddressRegistry(address operator) public { - assertFalse(mockContract.getBlockListStatus(operator)); - } - - /// @dev test to ensure the try/catch works as intended with bad contract registries - function testFakeRegistry(address operator) public { - address registry = address(new FakeBlockList()); - mockContract.updateBlockListRegistry(registry); - assertFalse(mockContract.getBlockListStatus(operator)); - } - - /// @dev test to update the registry - function testUpdateBlockListRegistry(address newRegistry) public { - address oldRegistry = address(mockContract.blockListRegistry()); - vm.expectEmit(true, true, true, false); - emit BlockListRegistryUpdated(address(this), oldRegistry, newRegistry); - mockContract.updateBlockListRegistry(newRegistry); - } - - /// @dev test access control - function testAccessControl(address user) public { - vm.assume(user != address(this)); - vm.startPrank(user, user); - vm.expectRevert(Unauthorized.selector); - mockContract.updateBlockListRegistry(address(0)); - vm.stopPrank(); - } - - /// @dev test approve fail - function testApproveFail() public { - address registry = makeAddr("Registry"); - mockContract.updateBlockListRegistry(registry); - vm.mockCall(registry, abi.encodeWithSelector(IBlockListRegistry.getBlockListStatus.selector), abi.encode(true)); - vm.expectRevert(BlockedOperator.selector); - mockContract.approve(registry, 1); - vm.clearMockedCalls(); - } - - /// @dev test approve succeed - function testApproveSucceed() public { - address registry = makeAddr("Registry"); - mockContract.updateBlockListRegistry(registry); - vm.mockCall(registry, abi.encodeWithSelector(IBlockListRegistry.getBlockListStatus.selector), abi.encode(false)); - mockContract.approve(registry, 1); - assertEq(mockContract.getApproved(1), registry); - vm.clearMockedCalls(); - } - - /// @dev test set approval for all fail - function testSetApprovalForAllFail() public { - address registry = makeAddr("Registry"); - mockContract.updateBlockListRegistry(registry); - vm.mockCall(registry, abi.encodeWithSelector(IBlockListRegistry.getBlockListStatus.selector), abi.encode(true)); - vm.expectRevert(BlockedOperator.selector); - mockContract.setApprovalForAll(registry, true); - vm.clearMockedCalls(); - } - - /// @dev test set approval for all succeed - function testSetApprovalForAllSucceed() public { - address registry = makeAddr("Registry"); - mockContract.updateBlockListRegistry(registry); - vm.mockCall(registry, abi.encodeWithSelector(IBlockListRegistry.getBlockListStatus.selector), abi.encode(false)); - mockContract.setApprovalForAll(registry, true); - assertTrue(mockContract.isApprovedForAll(address(this), registry)); - vm.clearMockedCalls(); - } -} diff --git a/test/unit_tests/BlockListUpgradeable.t.sol b/test/unit_tests/BlockListUpgradeable.t.sol deleted file mode 100644 index 3fe8791..0000000 --- a/test/unit_tests/BlockListUpgradeable.t.sol +++ /dev/null @@ -1,94 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import "forge-std/Test.sol"; -import {Unauthorized, BlockedOperator} from "../../src/IBlockList.sol"; -import {IBlockListRegistry} from "../../src/IBlockListRegistry.sol"; -import {BlockListMockUpgradeable} from "../mocks/BlockListMockUpgradeable.sol"; -import {FakeBlockList} from "../mocks/FakeBlockList.sol"; - -contract BlockListUpgradeableUnitTest is Test { - event BlockListRegistryUpdated(address indexed caller, address indexed oldRegistry, address indexed newRegistry); - - BlockListMockUpgradeable public mockContract; - - function setUp() public { - mockContract = new BlockListMockUpgradeable(); - mockContract.initialize(address(0)); - mockContract.mint(); - } - - function testInitialization() public { - assertTrue(mockContract.isBlockListAdmin(address(this))); - assertEq(address(mockContract.blockListRegistry()), address(0)); - } - - /// @dev test to ensure the try/catch works as intended on EOA registries - function testZeroAddressRegistry(address operator) public { - assertFalse(mockContract.getBlockListStatus(operator)); - } - - /// @dev test to ensure the try/catch works as intended with bad contract registries - function testFakeRegistry(address operator) public { - address registry = address(new FakeBlockList()); - mockContract.updateBlockListRegistry(registry); - assertFalse(mockContract.getBlockListStatus(operator)); - } - - /// @dev test to update the registry - function testUpdateBlockListRegistry(address newRegistry) public { - address oldRegistry = address(mockContract.blockListRegistry()); - vm.expectEmit(true, true, true, false); - emit BlockListRegistryUpdated(address(this), oldRegistry, newRegistry); - mockContract.updateBlockListRegistry(newRegistry); - } - - /// @dev test access control - function testAccessControl(address user) public { - vm.assume(user != address(this)); - vm.startPrank(user, user); - vm.expectRevert(Unauthorized.selector); - mockContract.updateBlockListRegistry(address(0)); - vm.stopPrank(); - } - - /// @dev test approve fail - function testApproveFail() public { - address registry = makeAddr("Registry"); - mockContract.updateBlockListRegistry(registry); - vm.mockCall(registry, abi.encodeWithSelector(IBlockListRegistry.getBlockListStatus.selector), abi.encode(true)); - vm.expectRevert(BlockedOperator.selector); - mockContract.approve(registry, 1); - vm.clearMockedCalls(); - } - - /// @dev test approve succeed - function testApproveSucceed() public { - address registry = makeAddr("Registry"); - mockContract.updateBlockListRegistry(registry); - vm.mockCall(registry, abi.encodeWithSelector(IBlockListRegistry.getBlockListStatus.selector), abi.encode(false)); - mockContract.approve(registry, 1); - assertEq(mockContract.getApproved(1), registry); - vm.clearMockedCalls(); - } - - /// @dev test set approval for all fail - function testSetApprovalForAllFail() public { - address registry = makeAddr("Registry"); - mockContract.updateBlockListRegistry(registry); - vm.mockCall(registry, abi.encodeWithSelector(IBlockListRegistry.getBlockListStatus.selector), abi.encode(true)); - vm.expectRevert(BlockedOperator.selector); - mockContract.setApprovalForAll(registry, true); - vm.clearMockedCalls(); - } - - /// @dev test set approval for all succeed - function testSetApprovalForAllSucceed() public { - address registry = makeAddr("Registry"); - mockContract.updateBlockListRegistry(registry); - vm.mockCall(registry, abi.encodeWithSelector(IBlockListRegistry.getBlockListStatus.selector), abi.encode(false)); - mockContract.setApprovalForAll(registry, true); - assertTrue(mockContract.isApprovedForAll(address(this), registry)); - vm.clearMockedCalls(); - } -} From 5c35a90497f92c36980e8c2a22fed829428475ab Mon Sep 17 00:00:00 2001 From: Marco Peyfuss Date: Mon, 25 Dec 2023 16:54:16 -0700 Subject: [PATCH 2/4] forge install: forge-std v1.7.4 --- .gitmodules | 3 +++ lib/forge-std | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/forge-std diff --git a/.gitmodules b/.gitmodules index e69de29..888d42d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/forge-std"] + path = lib/forge-std + url = https://github.com/foundry-rs/forge-std diff --git a/lib/forge-std b/lib/forge-std new file mode 160000 index 0000000..155d547 --- /dev/null +++ b/lib/forge-std @@ -0,0 +1 @@ +Subproject commit 155d547c449afa8715f538d69454b83944117811 From 0b8f2e4a01e9fa1d6c6439b926d4f1bb7e19b626 Mon Sep 17 00:00:00 2001 From: Marco Peyfuss Date: Mon, 25 Dec 2023 16:54:46 -0700 Subject: [PATCH 3/4] forge install: tl-sol-tools 2.2.1 --- .gitmodules | 3 +++ lib/tl-sol-tools | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/tl-sol-tools diff --git a/.gitmodules b/.gitmodules index 888d42d..b061614 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/forge-std"] path = lib/forge-std url = https://github.com/foundry-rs/forge-std +[submodule "lib/tl-sol-tools"] + path = lib/tl-sol-tools + url = https://github.com/Transient-Labs/tl-sol-tools diff --git a/lib/tl-sol-tools b/lib/tl-sol-tools new file mode 160000 index 0000000..a6704b6 --- /dev/null +++ b/lib/tl-sol-tools @@ -0,0 +1 @@ +Subproject commit a6704b6ae509adcf676a487b0491f1f92cf1d0a3 From 4c9d5e7fb4cca479f2bb7d0ca2468e9ce6d51c3c Mon Sep 17 00:00:00 2001 From: Marco Peyfuss Date: Mon, 25 Dec 2023 16:58:19 -0700 Subject: [PATCH 4/4] 4.0.2 - removed blocklist abstract contracts as the iheritance tree gets tricky and this is a registry more than anything so doesn't make sense to include those abstract contracts. Especially as this will stay at 0.8.19 for the foreseeable future to avoid deploying a new factory. --- foundry.toml | 4 +--- remappings.txt | 5 +++++ src/BlockListRegistry.sol | 2 +- src/BlockListRegistryFactory.sol | 4 ++-- test/BlockListRegistry.t.sol | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 remappings.txt diff --git a/foundry.toml b/foundry.toml index b083148..ac815ac 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,8 +6,6 @@ libs = ['lib'] # a list of librar libraries = [] # a list of deployed libraries to link against cache = true # whether to cache builds or not force = false # whether to ignore the cache (clean build) -evm_version = 'london' # the evm version (by hardfork name) -#solc_version = '0.8.17' # override for the solc version (setting this ignores `auto_detect_solc`) auto_detect_solc = true # enable auto-detection of the appropriate solc version to use offline = false # disable downloading of missing solc version(s) optimizer = true # enable or disable the solc optimizer @@ -18,4 +16,4 @@ gas_reports = ["*"] fs_permissions = [{ access = 'read', path = './test/file_utils'}] [fuzz] -runs = 2000 \ No newline at end of file +runs = 20000 \ No newline at end of file diff --git a/remappings.txt b/remappings.txt new file mode 100644 index 0000000..346f38a --- /dev/null +++ b/remappings.txt @@ -0,0 +1,5 @@ +ds-test/=lib/forge-std/lib/ds-test/src/ +forge-std/=lib/forge-std/src/ +openzeppelin-upgradeable/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/ +openzeppelin/=lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/ +tl-sol-tools/=lib/tl-sol-tools/src/ \ No newline at end of file diff --git a/src/BlockListRegistry.sol b/src/BlockListRegistry.sol index 2470624..1f78efb 100644 --- a/src/BlockListRegistry.sol +++ b/src/BlockListRegistry.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol"; -import {OwnableAccessControlUpgradeable} from "lib/tl-sol-tools/src/upgradeable/access/OwnableAccessControlUpgradeable.sol"; +import {OwnableAccessControlUpgradeable} from "tl-sol-tools/upgradeable/access/OwnableAccessControlUpgradeable.sol"; import {IBlockListRegistry} from "src/IBlockListRegistry.sol"; /// @title BlockListRegistry diff --git a/src/BlockListRegistryFactory.sol b/src/BlockListRegistryFactory.sol index c197e7b..a63d90d 100644 --- a/src/BlockListRegistryFactory.sol +++ b/src/BlockListRegistryFactory.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; -import {Clones} from "lib/openzeppelin-contracts/contracts/proxy/Clones.sol"; +import {Ownable} from "openzeppelin/access/Ownable.sol"; +import {Clones} from "openzeppelin/proxy/Clones.sol"; import {BlockListRegistry} from "src/BlockListRegistry.sol"; /// @title BlockListFactory diff --git a/test/BlockListRegistry.t.sol b/test/BlockListRegistry.t.sol index 0c1ca2c..eab6b6f 100644 --- a/test/BlockListRegistry.t.sol +++ b/test/BlockListRegistry.t.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.19; import "forge-std/Test.sol"; -import {NotRoleOrOwner} from "lib/tl-sol-tools/src/access/OwnableAccessControl.sol"; +import {NotRoleOrOwner} from "tl-sol-tools/access/OwnableAccessControl.sol"; import {BlockListRegistry, IBlockListRegistry} from "src/BlockListRegistry.sol"; -import {IERC165Upgradeable} from "lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/IERC165Upgradeable.sol"; +import {IERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol"; contract BlockListRegistryUnitTest is Test, BlockListRegistry { address[] public initBlockedOperators = [address(1), address(2), address(3)];