Skip to content

Commit cb63226

Browse files
authored
Update dependencies (#649)
* update dependency * update OZ version to 4.9.6 * update package json
1 parent 114df57 commit cb63226

18 files changed

+53
-44
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ artifacts/@openzeppelin
77
artifacts/build-info
88
build/
99
scripts/reference-scripts
10-
cache/
10+
cache*/
1111
coverage/
1212
dist/
1313
node_modules/
1414
typechain/
15+
typechain-types/
1516
.parcel-cache/
1617

1718
abi/
1819
contracts/abi/
1920
contracts/README.md
2021
artifacts/
22+
artifacts-*/
2123
artifacts_forge/
2224
contract_artifacts/
2325

.gitmodules

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
[submodule "lib/ds-test"]
55
path = lib/ds-test
66
url = https://github.com/dapphub/ds-test
7-
[submodule "lib/openzeppelin-contracts"]
8-
path = lib/openzeppelin-contracts
9-
url = https://github.com/openzeppelin/openzeppelin-contracts
10-
[submodule "lib/openzeppelin-contracts-upgradeable"]
11-
path = lib/openzeppelin-contracts-upgradeable
12-
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
137
[submodule "lib/chainlink"]
148
path = lib/chainlink
159
url = https://github.com/smartcontractkit/chainlink
@@ -31,9 +25,6 @@
3125
[submodule "lib/murky"]
3226
path = lib/murky
3327
url = https://github.com/dmfxyz/murky
34-
[submodule "lib/openzeppelin-contracts"]
35-
path = lib/openzeppelin-contracts
36-
url = https://github.com/openzeppelin/openzeppelin-contracts
3728
[submodule "lib/solmate"]
3829
path = lib/solmate
3930
url = https://github.com/transmissions11/solmate
@@ -49,3 +40,9 @@
4940
[submodule "lib/seaport-sol"]
5041
path = lib/seaport-sol
5142
url = https://github.com/projectopensea/seaport-sol
43+
[submodule "lib/openzeppelin-contracts-upgradeable"]
44+
path = lib/openzeppelin-contracts-upgradeable
45+
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
46+
[submodule "lib/openzeppelin-contracts"]
47+
path = lib/openzeppelin-contracts
48+
url = https://github.com/OpenZeppelin/openzeppelin-contracts

contracts/infra/ContractPublisher.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ pragma solidity ^0.8.0;
1313
// \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/
1414

1515
// ========== External imports ==========
16-
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
1716
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
1817
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
18+
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";
1919
import "../extension/Multicall.sol";
2020

2121
// ========== Internal imports ==========
@@ -66,9 +66,9 @@ contract ContractPublisher is IContractPublisher, ERC2771Context, AccessControlE
6666

6767
constructor(
6868
address _defaultAdmin,
69-
address _trustedForwarder,
69+
address[] memory _trustedForwarders,
7070
IContractPublisher _prevPublisher
71-
) ERC2771Context(_trustedForwarder) {
71+
) ERC2771Context(_trustedForwarders) {
7272
_setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);
7373
_setupRole(MIGRATION_ROLE, _defaultAdmin);
7474
_setRoleAdmin(MIGRATION_ROLE, MIGRATION_ROLE);

contracts/infra/TWFactory.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import "./interface/IThirdwebContract.sol";
1717
import "../extension/interface/IContractFactory.sol";
1818

1919
import { AccessControlEnumerable, Context } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
20-
import { ERC2771Context } from "@openzeppelin/contracts/metatx/ERC2771Context.sol";
20+
import { ERC2771Context } from "../external-deps/openzeppelin/metatx/ERC2771Context.sol";
2121
import { Create2 } from "@openzeppelin/contracts/utils/Create2.sol";
2222
import { Multicall } from "../extension/Multicall.sol";
2323
import "@openzeppelin/contracts/utils/Address.sol";
@@ -46,7 +46,7 @@ contract TWFactory is Multicall, ERC2771Context, AccessControlEnumerable, IContr
4646
/// @dev mapping of proxy address to deployer address
4747
mapping(address => address) public deployer;
4848

49-
constructor(address _trustedForwarder, address _registry) ERC2771Context(_trustedForwarder) {
49+
constructor(address[] memory _trustedForwarders, address _registry) ERC2771Context(_trustedForwarders) {
5050
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
5151
_setupRole(FACTORY_ROLE, _msgSender());
5252

contracts/infra/TWFee.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "./interface/ITWFee.sol";
88

99
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
1010
import { Multicall } from "../extension/Multicall.sol";
11-
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
11+
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";
1212

1313
interface IFeeTierPlacementExtension {
1414
/// @dev Returns the fee tier for a given proxy contract address and proxy deployer address.
@@ -55,7 +55,7 @@ contract TWFee is ITWFee, Multicall, ERC2771Context, AccessControlEnumerable, IF
5555
event TierUpdated(address indexed proxyOrDeployer, uint256 tierId, uint256 validUntilTimestamp);
5656
event FeeTierUpdated(uint256 indexed tierId, uint256 indexed feeType, address recipient, uint256 bps);
5757

58-
constructor(address _trustedForwarder, address _factory) ERC2771Context(_trustedForwarder) {
58+
constructor(address[] memory _trustedForwarders, address _factory) ERC2771Context(_trustedForwarders) {
5959
factory = TWFactory(_factory);
6060

6161
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());

contracts/infra/TWMultichainRegistry.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pragma solidity ^0.8.11;
1515
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
1616
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
1717
import "../extension/Multicall.sol";
18-
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
18+
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";
1919

2020
import "./interface/ITWMultichainRegistry.sol";
2121

@@ -32,7 +32,7 @@ contract TWMultichainRegistry is ITWMultichainRegistry, Multicall, ERC2771Contex
3232

3333
EnumerableSet.UintSet private chainIds;
3434

35-
constructor(address _trustedForwarder) ERC2771Context(_trustedForwarder) {
35+
constructor(address[] memory _trustedForwarders) ERC2771Context(_trustedForwarders) {
3636
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
3737
}
3838

contracts/infra/TWRegistry.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pragma solidity ^0.8.11;
1515
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
1616
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
1717
import "../extension/Multicall.sol";
18-
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
18+
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";
1919

2020
contract TWRegistry is Multicall, ERC2771Context, AccessControlEnumerable {
2121
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
@@ -28,7 +28,7 @@ contract TWRegistry is Multicall, ERC2771Context, AccessControlEnumerable {
2828
event Added(address indexed deployer, address indexed deployment);
2929
event Deleted(address indexed deployer, address indexed deployment);
3030

31-
constructor(address _trustedForwarder) ERC2771Context(_trustedForwarder) {
31+
constructor(address[] memory _trustedForwarders) ERC2771Context(_trustedForwarders) {
3232
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
3333
}
3434

contracts/infra/TWStatelessFactory.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ pragma solidity ^0.8.11;
1414

1515
import "../extension/interface/IContractFactory.sol";
1616

17-
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
17+
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";
1818
import "../extension/Multicall.sol";
1919
import "@openzeppelin/contracts/proxy/Clones.sol";
2020

2121
contract TWStatelessFactory is Multicall, ERC2771Context, IContractFactory {
2222
/// @dev Emitted when a proxy is deployed.
2323
event ProxyDeployed(address indexed implementation, address proxy, address indexed deployer);
2424

25-
constructor(address _trustedForwarder) ERC2771Context(_trustedForwarder) {}
25+
constructor(address[] memory _trustedForwarders) ERC2771Context(_trustedForwarders) {}
2626

2727
/// @dev Deploys a proxy that points to the given implementation.
2828
function deployProxyByImplementation(

contracts/infra/forwarder/ForwarderConsumer.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ pragma solidity ^0.8.11;
1212
// \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ |
1313
// \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/
1414

15-
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
15+
import "../../external-deps/openzeppelin/metatx/ERC2771Context.sol";
1616

1717
contract ForwarderConsumer is ERC2771Context {
1818
address public caller;
1919

20-
constructor(address trustedForwarder) ERC2771Context(trustedForwarder) {}
20+
constructor(address[] memory trustedForwarders) ERC2771Context(trustedForwarders) {}
2121

2222
function setCaller() external {
2323
caller = _msgSender();

contracts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"/abi"
1818
],
1919
"dependencies": {
20-
"@openzeppelin/contracts": "^4.9.3",
21-
"@openzeppelin/contracts-upgradeable": "^4.9.3",
20+
"@openzeppelin/contracts": "^4.9.6",
21+
"@openzeppelin/contracts-upgradeable": "^4.9.6",
2222
"erc721a-upgradeable": "^3.3.0",
2323
"@thirdweb-dev/dynamic-contracts": "^1.2.4",
2424
"solady": "0.0.180"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"/contracts/**/*.sol"
99
],
1010
"devDependencies": {
11-
"@openzeppelin/contracts": "^4.9.3",
12-
"@openzeppelin/contracts-upgradeable": "^4.9.3",
11+
"@openzeppelin/contracts": "^4.9.6",
12+
"@openzeppelin/contracts-upgradeable": "^4.9.6",
1313
"@thirdweb-dev/dynamic-contracts": "^1.2.4",
1414
"@thirdweb-dev/merkletree": "^0.2.2",
1515
"@typechain/ethers-v5": "^10.2.1",

src/test/Forwarder.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ contract ForwarderTest is BaseTest {
2525
function setUp() public override {
2626
super.setUp();
2727
user = vm.addr(userPKey);
28-
consumer = new ForwarderConsumer(forwarder);
28+
consumer = new ForwarderConsumer(forwarders());
2929

3030
typehashForwardRequest = keccak256(
3131
"ForwardRequest(address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data)"

src/test/ForwarderChainlessDomain.t.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ForwarderChainlessDomain } from "contracts/infra/forwarder/ForwarderCha
77
import "./utils/BaseTest.sol";
88

99
contract ForwarderChainlessDomainTest is BaseTest {
10-
address public forwarderChainlessDomain;
10+
address[] public forwarderChainlessDomain;
1111
ForwarderConsumer public consumer;
1212

1313
uint256 public userPKey = 1020;
@@ -25,9 +25,9 @@ contract ForwarderChainlessDomainTest is BaseTest {
2525
function setUp() public override {
2626
super.setUp();
2727
user = vm.addr(userPKey);
28-
consumer = new ForwarderConsumer(forwarder);
28+
consumer = new ForwarderConsumer(forwarders());
2929

30-
forwarderChainlessDomain = address(new ForwarderChainlessDomain());
30+
forwarderChainlessDomain.push(address(new ForwarderChainlessDomain()));
3131
consumer = new ForwarderConsumer(forwarderChainlessDomain);
3232

3333
typehashForwardRequest = keccak256(
@@ -36,7 +36,7 @@ contract ForwarderChainlessDomainTest is BaseTest {
3636
nameHash = keccak256(bytes("GSNv2 Forwarder"));
3737
versionHash = keccak256(bytes("0.0.1"));
3838
typehashEip712 = keccak256("EIP712Domain(string name,string version,address verifyingContract)");
39-
domainSeparator = keccak256(abi.encode(typehashEip712, nameHash, versionHash, forwarderChainlessDomain));
39+
domainSeparator = keccak256(abi.encode(typehashEip712, nameHash, versionHash, forwarderChainlessDomain[0]));
4040

4141
vm.label(user, "End user");
4242
vm.label(forwarder, "Forwarder");
@@ -78,13 +78,13 @@ contract ForwarderChainlessDomainTest is BaseTest {
7878
forwardRequest.to = address(consumer);
7979
forwardRequest.value = 0;
8080
forwardRequest.gas = 100_000;
81-
forwardRequest.nonce = ForwarderChainlessDomain(forwarderChainlessDomain).getNonce(user);
81+
forwardRequest.nonce = ForwarderChainlessDomain(forwarderChainlessDomain[0]).getNonce(user);
8282
forwardRequest.data = abi.encodeCall(ForwarderConsumer.setCaller, ());
8383
forwardRequest.chainid = block.chainid;
8484

8585
bytes memory signature = signForwarderRequest(forwardRequest, userPKey);
8686
vm.prank(relayer);
87-
ForwarderChainlessDomain(forwarderChainlessDomain).execute(forwardRequest, signature);
87+
ForwarderChainlessDomain(forwarderChainlessDomain[0]).execute(forwardRequest, signature);
8888

8989
assertEq(consumer.caller(), user);
9090
}

src/test/TWMultichainRegistry.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ contract TWMultichainRegistryTest is ITWMultichainRegistryData, BaseTest {
4444
}
4545

4646
vm.startPrank(factoryAdmin_);
47-
_registry = new TWMultichainRegistry(address(0));
47+
_registry = new TWMultichainRegistry(forwarders());
4848

4949
_registry.grantRole(keccak256("OPERATOR_ROLE"), factory_);
5050

src/test/utils/BaseTest.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ abstract contract BaseTest is DSTest, Test {
116116
weth = new WETH9();
117117
forwarder = address(new Forwarder());
118118
eoaForwarder = address(new ForwarderEOAOnly());
119-
registry = address(new TWRegistry(forwarder));
120-
factory = address(new TWFactory(forwarder, registry));
121-
contractPublisher = address(new ContractPublisher(factoryAdmin, forwarder, new MockContractPublisher()));
119+
registry = address(new TWRegistry(forwarders()));
120+
factory = address(new TWFactory(forwarders(), registry));
121+
contractPublisher = address(new ContractPublisher(factoryAdmin, forwarders(), new MockContractPublisher()));
122122
linkToken = address(new Link());
123123
vrfV2Wrapper = address(new VRFV2Wrapper());
124124
TWRegistry(registry).grantRole(TWRegistry(registry).OPERATOR_ROLE(), factory);

yarn.lock

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,16 +512,26 @@
512512
"@nodelib/fs.scandir" "2.1.5"
513513
fastq "^1.6.0"
514514

515-
"@openzeppelin/contracts-upgradeable@^4.4.2", "@openzeppelin/contracts-upgradeable@^4.9.3":
515+
"@openzeppelin/contracts-upgradeable@^4.4.2":
516516
version "4.9.5"
517517
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.5.tgz#572b5da102fc9be1d73f34968e0ca56765969812"
518518
integrity sha512-f7L1//4sLlflAN7fVzJLoRedrf5Na3Oal5PZfIq55NFcVZ90EpV1q5xOvL4lFvg3MNICSDr2hH0JUBxwlxcoPg==
519519

520-
"@openzeppelin/contracts@^4.4.2", "@openzeppelin/contracts@^4.9.3":
520+
"@openzeppelin/contracts-upgradeable@^4.9.6":
521+
version "4.9.6"
522+
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.6.tgz#38b21708a719da647de4bb0e4802ee235a0d24df"
523+
integrity sha512-m4iHazOsOCv1DgM7eD7GupTJ+NFVujRZt1wzddDPSVGpWdKq1SKkla5htKG7+IS4d2XOCtzkUNwRZ7Vq5aEUMA==
524+
525+
"@openzeppelin/contracts@^4.4.2":
521526
version "4.9.5"
522527
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.5.tgz#1eed23d4844c861a1835b5d33507c1017fa98de8"
523528
integrity sha512-ZK+W5mVhRppff9BE6YdR8CC52C8zAvsVAiWhEtQ5+oNxFE6h1WdeWo+FJSF8KKvtxxVYZ7MTP/5KoVpAU3aSWg==
524529

530+
"@openzeppelin/contracts@^4.9.6":
531+
version "4.9.6"
532+
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.6.tgz#2a880a24eb19b4f8b25adc2a5095f2aa27f39677"
533+
integrity sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==
534+
525535
"@pkgjs/parseargs@^0.11.0":
526536
version "0.11.0"
527537
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"

0 commit comments

Comments
 (0)