Skip to content

Commit

Permalink
Update dependencies (#649)
Browse files Browse the repository at this point in the history
* update dependency

* update OZ version to 4.9.6

* update package json
  • Loading branch information
kumaryash90 authored May 29, 2024
1 parent 114df57 commit cb63226
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 44 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ artifacts/@openzeppelin
artifacts/build-info
build/
scripts/reference-scripts
cache/
cache*/
coverage/
dist/
node_modules/
typechain/
typechain-types/
.parcel-cache/

abi/
contracts/abi/
contracts/README.md
artifacts/
artifacts-*/
artifacts_forge/
contract_artifacts/

Expand Down
15 changes: 6 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
[submodule "lib/ds-test"]
path = lib/ds-test
url = https://github.com/dapphub/ds-test
[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/chainlink"]
path = lib/chainlink
url = https://github.com/smartcontractkit/chainlink
Expand All @@ -31,9 +25,6 @@
[submodule "lib/murky"]
path = lib/murky
url = https://github.com/dmfxyz/murky
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
Expand All @@ -49,3 +40,9 @@
[submodule "lib/seaport-sol"]
path = lib/seaport-sol
url = https://github.com/projectopensea/seaport-sol
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
6 changes: 3 additions & 3 deletions contracts/infra/ContractPublisher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ pragma solidity ^0.8.0;
// \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/

// ========== External imports ==========
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";
import "../extension/Multicall.sol";

// ========== Internal imports ==========
Expand Down Expand Up @@ -66,9 +66,9 @@ contract ContractPublisher is IContractPublisher, ERC2771Context, AccessControlE

constructor(
address _defaultAdmin,
address _trustedForwarder,
address[] memory _trustedForwarders,
IContractPublisher _prevPublisher
) ERC2771Context(_trustedForwarder) {
) ERC2771Context(_trustedForwarders) {
_setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);
_setupRole(MIGRATION_ROLE, _defaultAdmin);
_setRoleAdmin(MIGRATION_ROLE, MIGRATION_ROLE);
Expand Down
4 changes: 2 additions & 2 deletions contracts/infra/TWFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import "./interface/IThirdwebContract.sol";
import "../extension/interface/IContractFactory.sol";

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

constructor(address _trustedForwarder, address _registry) ERC2771Context(_trustedForwarder) {
constructor(address[] memory _trustedForwarders, address _registry) ERC2771Context(_trustedForwarders) {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(FACTORY_ROLE, _msgSender());

Expand Down
4 changes: 2 additions & 2 deletions contracts/infra/TWFee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "./interface/ITWFee.sol";

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

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

constructor(address _trustedForwarder, address _factory) ERC2771Context(_trustedForwarder) {
constructor(address[] memory _trustedForwarders, address _factory) ERC2771Context(_trustedForwarders) {
factory = TWFactory(_factory);

_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
Expand Down
4 changes: 2 additions & 2 deletions contracts/infra/TWMultichainRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.8.11;
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "../extension/Multicall.sol";
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";

import "./interface/ITWMultichainRegistry.sol";

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

EnumerableSet.UintSet private chainIds;

constructor(address _trustedForwarder) ERC2771Context(_trustedForwarder) {
constructor(address[] memory _trustedForwarders) ERC2771Context(_trustedForwarders) {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/infra/TWRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.8.11;
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "../extension/Multicall.sol";
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";

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

constructor(address _trustedForwarder) ERC2771Context(_trustedForwarder) {
constructor(address[] memory _trustedForwarders) ERC2771Context(_trustedForwarders) {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/infra/TWStatelessFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ pragma solidity ^0.8.11;

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

import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import "../external-deps/openzeppelin/metatx/ERC2771Context.sol";
import "../extension/Multicall.sol";
import "@openzeppelin/contracts/proxy/Clones.sol";

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

constructor(address _trustedForwarder) ERC2771Context(_trustedForwarder) {}
constructor(address[] memory _trustedForwarders) ERC2771Context(_trustedForwarders) {}

/// @dev Deploys a proxy that points to the given implementation.
function deployProxyByImplementation(
Expand Down
4 changes: 2 additions & 2 deletions contracts/infra/forwarder/ForwarderConsumer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ pragma solidity ^0.8.11;
// \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ |
// \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/

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

contract ForwarderConsumer is ERC2771Context {
address public caller;

constructor(address trustedForwarder) ERC2771Context(trustedForwarder) {}
constructor(address[] memory trustedForwarders) ERC2771Context(trustedForwarders) {}

function setCaller() external {
caller = _msgSender();
Expand Down
4 changes: 2 additions & 2 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"/abi"
],
"dependencies": {
"@openzeppelin/contracts": "^4.9.3",
"@openzeppelin/contracts-upgradeable": "^4.9.3",
"@openzeppelin/contracts": "^4.9.6",
"@openzeppelin/contracts-upgradeable": "^4.9.6",
"erc721a-upgradeable": "^3.3.0",
"@thirdweb-dev/dynamic-contracts": "^1.2.4",
"solady": "0.0.180"
Expand Down
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts-upgradeable
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"/contracts/**/*.sol"
],
"devDependencies": {
"@openzeppelin/contracts": "^4.9.3",
"@openzeppelin/contracts-upgradeable": "^4.9.3",
"@openzeppelin/contracts": "^4.9.6",
"@openzeppelin/contracts-upgradeable": "^4.9.6",
"@thirdweb-dev/dynamic-contracts": "^1.2.4",
"@thirdweb-dev/merkletree": "^0.2.2",
"@typechain/ethers-v5": "^10.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/test/Forwarder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract ForwarderTest is BaseTest {
function setUp() public override {
super.setUp();
user = vm.addr(userPKey);
consumer = new ForwarderConsumer(forwarder);
consumer = new ForwarderConsumer(forwarders());

typehashForwardRequest = keccak256(
"ForwardRequest(address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data)"
Expand Down
12 changes: 6 additions & 6 deletions src/test/ForwarderChainlessDomain.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ForwarderChainlessDomain } from "contracts/infra/forwarder/ForwarderCha
import "./utils/BaseTest.sol";

contract ForwarderChainlessDomainTest is BaseTest {
address public forwarderChainlessDomain;
address[] public forwarderChainlessDomain;
ForwarderConsumer public consumer;

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

forwarderChainlessDomain = address(new ForwarderChainlessDomain());
forwarderChainlessDomain.push(address(new ForwarderChainlessDomain()));
consumer = new ForwarderConsumer(forwarderChainlessDomain);

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

vm.label(user, "End user");
vm.label(forwarder, "Forwarder");
Expand Down Expand Up @@ -78,13 +78,13 @@ contract ForwarderChainlessDomainTest is BaseTest {
forwardRequest.to = address(consumer);
forwardRequest.value = 0;
forwardRequest.gas = 100_000;
forwardRequest.nonce = ForwarderChainlessDomain(forwarderChainlessDomain).getNonce(user);
forwardRequest.nonce = ForwarderChainlessDomain(forwarderChainlessDomain[0]).getNonce(user);
forwardRequest.data = abi.encodeCall(ForwarderConsumer.setCaller, ());
forwardRequest.chainid = block.chainid;

bytes memory signature = signForwarderRequest(forwardRequest, userPKey);
vm.prank(relayer);
ForwarderChainlessDomain(forwarderChainlessDomain).execute(forwardRequest, signature);
ForwarderChainlessDomain(forwarderChainlessDomain[0]).execute(forwardRequest, signature);

assertEq(consumer.caller(), user);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/TWMultichainRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract TWMultichainRegistryTest is ITWMultichainRegistryData, BaseTest {
}

vm.startPrank(factoryAdmin_);
_registry = new TWMultichainRegistry(address(0));
_registry = new TWMultichainRegistry(forwarders());

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

Expand Down
6 changes: 3 additions & 3 deletions src/test/utils/BaseTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ abstract contract BaseTest is DSTest, Test {
weth = new WETH9();
forwarder = address(new Forwarder());
eoaForwarder = address(new ForwarderEOAOnly());
registry = address(new TWRegistry(forwarder));
factory = address(new TWFactory(forwarder, registry));
contractPublisher = address(new ContractPublisher(factoryAdmin, forwarder, new MockContractPublisher()));
registry = address(new TWRegistry(forwarders()));
factory = address(new TWFactory(forwarders(), registry));
contractPublisher = address(new ContractPublisher(factoryAdmin, forwarders(), new MockContractPublisher()));
linkToken = address(new Link());
vrfV2Wrapper = address(new VRFV2Wrapper());
TWRegistry(registry).grantRole(TWRegistry(registry).OPERATOR_ROLE(), factory);
Expand Down
14 changes: 12 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -512,16 +512,26 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

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

"@openzeppelin/contracts@^4.4.2", "@openzeppelin/contracts@^4.9.3":
"@openzeppelin/contracts-upgradeable@^4.9.6":
version "4.9.6"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.6.tgz#38b21708a719da647de4bb0e4802ee235a0d24df"
integrity sha512-m4iHazOsOCv1DgM7eD7GupTJ+NFVujRZt1wzddDPSVGpWdKq1SKkla5htKG7+IS4d2XOCtzkUNwRZ7Vq5aEUMA==

"@openzeppelin/contracts@^4.4.2":
version "4.9.5"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.5.tgz#1eed23d4844c861a1835b5d33507c1017fa98de8"
integrity sha512-ZK+W5mVhRppff9BE6YdR8CC52C8zAvsVAiWhEtQ5+oNxFE6h1WdeWo+FJSF8KKvtxxVYZ7MTP/5KoVpAU3aSWg==

"@openzeppelin/contracts@^4.9.6":
version "4.9.6"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.6.tgz#2a880a24eb19b4f8b25adc2a5095f2aa27f39677"
integrity sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==

"@pkgjs/parseargs@^0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
Expand Down

0 comments on commit cb63226

Please sign in to comment.