From a8d3ca244f39757e665ca3e7e8cf6ac551b55b78 Mon Sep 17 00:00:00 2001 From: Daniel Dimitrov Date: Thu, 11 Jan 2024 07:39:20 +0100 Subject: [PATCH 1/4] chore bump nvmrc to node v18.0.0 The default value for node was set to 16, but the project was not installable with it. ts-api-utils@1.0.3 needed at least node 16.13.0 and execa@7.2.0 needed at least 16.14.0, so decided to bump everything to at least 18. --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index c9b6b29e..65898478 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.0.0 +v18.0.0 From 918f94b3cda33d853faf9c72efa25f596f86deb8 Mon Sep 17 00:00:00 2001 From: Daniel Dimitrov Date: Thu, 11 Jan 2024 14:11:36 +0100 Subject: [PATCH 2/4] chore upgrade ethers to v6 --- package.json | 18 +++-- sdk/factory/__tests__/index.spec.ts | 18 +++-- sdk/factory/deployModuleFactory.ts | 12 +-- sdk/factory/mastercopyDeployer.ts | 34 ++++---- sdk/factory/moduleDeployer.ts | 67 +++++++++------- sdk/factory/singletonFactory.ts | 20 +++-- test/01_IAvatar.spec.ts | 7 +- test/02_Module.spec.ts | 36 +++++---- test/03_Modifier.spec.ts | 103 ++++++++++++++----------- test/04_Guard.spec.ts | 36 +++++---- test/05_ModuleProxyFactory.spec.ts | 37 ++++----- test/06_SignatureChecker.spec.ts | 94 +++++++++++------------ test/07_GuardableModifier.spec.ts | 115 +++++++++++++++++----------- yarn.lock | 115 +++++++++++++++++++++++----- 14 files changed, 436 insertions(+), 276 deletions(-) diff --git a/package.json b/package.json index 20ee94de..4159895a 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "format": "yarn format:sol && yarn format:ts", "format:sol": "prettier --write --plugin=prettier-plugin-solidity ./contracts/**/*.sol", "format:ts": "prettier --write ./sdk/**/*.ts ./test/**/*.ts ./*.ts", - "generate:types": "rm -rf src/types && typechain --target ethers-v5 --out-dir sdk/types './sdk/abi/*.json'", + "generate:types": "rm -rf src/types && typechain --target ethers-v6 --out-dir sdk/types './sdk/abi/*.json'", "prepare": "yarn generate:types && yarn build", "prerelease": "yarn clean && yarn build && yarn build:sdk", "release": "yarn publish --access public", @@ -49,13 +49,15 @@ "url": "https://github.com/gnosis/zodiac.git" }, "devDependencies": { - "@nomicfoundation/hardhat-chai-matchers": "^1.0.5", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.3", + "@nomicfoundation/hardhat-ethers": "^3.0.0", "@nomicfoundation/hardhat-network-helpers": "^1.0.7", - "@nomicfoundation/hardhat-toolbox": "^2.0.0", - "@nomiclabs/hardhat-ethers": "2.2.3", + "@nomicfoundation/hardhat-toolbox": "^4.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.0", + "@nomiclabs/hardhat-ethers": "^2.2.3", "@nomiclabs/hardhat-etherscan": "3.1.7", - "@typechain/ethers-v5": "^11.1.0", - "@typechain/hardhat": "^6.1.5", + "@typechain/ethers-v6": "^0.5.1", + "@typechain/hardhat": "^9.1.0", "@types/chai": "^4.3.3", "@types/mocha": "^10.0.0", "@types/node": "^18.8.5", @@ -90,6 +92,6 @@ "@gnosis.pm/safe-contracts": "1.3.0", "@openzeppelin/contracts": "^5.0.0", "@openzeppelin/contracts-upgradeable": "^5.0.0", - "ethers": "^5.7.1" + "ethers": "^6.9.2" } -} \ No newline at end of file +} diff --git a/sdk/factory/__tests__/index.spec.ts b/sdk/factory/__tests__/index.spec.ts index f04ba243..0a558582 100644 --- a/sdk/factory/__tests__/index.spec.ts +++ b/sdk/factory/__tests__/index.spec.ts @@ -61,14 +61,15 @@ describe("Factory JS functions ", () => { KnownContracts.REALITY_ETH, args, hre.ethers.provider, - chainId, + Number(chainId), saltNonce ); const transaction = await signer.sendTransaction(deployTx); const receipt = await transaction.wait(); - expect(receipt.transactionHash).to.be.a("string"); + + expect(receipt.hash).to.be.a("string"); expect(receipt.status).to.be.eq(1); expect(expectedModuleAddress).to.a("string"); }); @@ -99,7 +100,8 @@ describe("Factory JS functions ", () => { ], }; - const chainContracts = ContractAddresses[chainId as SupportedNetworks]; + const chainContracts = + ContractAddresses[Number(chainId) as SupportedNetworks]; const masterCopyAddress = chainContracts[KnownContracts.REALITY_ETH]; const abi = ContractAbis[KnownContracts.REALITY_ETH]; @@ -109,14 +111,14 @@ describe("Factory JS functions ", () => { abi, args, hre.ethers.provider, - chainId, + Number(chainId), saltNonce ); const transaction = await signer.sendTransaction(deployTx); const receipt = await transaction.wait(); - expect(receipt.transactionHash).to.be.a("string"); + expect(receipt.hash).to.be.a("string"); expect(receipt.status).to.be.eq(1); expect(expectedModuleAddress).to.a("string"); }); @@ -126,11 +128,11 @@ describe("Factory JS functions ", () => { const module = await getModuleInstance( KnownContracts.REALITY_ETH, - mock.address, + await mock.getAddress(), hre.ethers.provider ); await mock.givenMethodReturnBool( - module.interface.getSighash("owner"), + module.interface.getFunction("owner").selector, true ); @@ -146,7 +148,7 @@ describe("Factory JS functions ", () => { await getModuleFactoryAndMasterCopy( KnownContracts.REALITY_ETH, hre.ethers.provider, - chainId + Number(chainId) ); expect(moduleFactory).to.be.instanceOf(Contract); expect(moduleMastercopy).to.be.instanceOf(Contract); diff --git a/sdk/factory/deployModuleFactory.ts b/sdk/factory/deployModuleFactory.ts index df495a80..0fd0630a 100644 --- a/sdk/factory/deployModuleFactory.ts +++ b/sdk/factory/deployModuleFactory.ts @@ -1,13 +1,13 @@ import assert from "assert"; -import { constants as ethersConstants, ethers } from "ethers"; +import { ZeroAddress, JsonRpcSigner } from "ethers"; import { MasterCopyInitData } from "../contracts"; import { getSingletonFactory } from "./singletonFactory"; import { KnownContracts } from "./types"; -const { AddressZero } = ethersConstants; +const AddressZero = ZeroAddress; const FactoryInitData = MasterCopyInitData[KnownContracts.FACTORY]; @@ -21,7 +21,7 @@ assert(FactoryInitData); * @returns The address of the deployed Module Proxy Factory, or the zero address if it was already deployed */ export const deployModuleFactory = async ( - signer: ethers.providers.JsonRpcSigner + signer: JsonRpcSigner ): Promise => { console.log("Deploying the Module Proxy Factory..."); const singletonFactory = await getSingletonFactory(signer); @@ -30,13 +30,15 @@ export const deployModuleFactory = async ( singletonFactory.address ); - const targetAddress = await singletonFactory.callStatic.deploy( + const targetAddress = await singletonFactory.deploy.staticCall( FactoryInitData.initCode, FactoryInitData.salt ); if (targetAddress === AddressZero) { console.log( - ` ✔ Module Proxy Factory already deployed to target address on ${signer.provider.network.name}.` + ` ✔ Module Proxy Factory already deployed to target address on ${ + (await signer.provider.getNetwork()).name + }.` ); return AddressZero; } diff --git a/sdk/factory/mastercopyDeployer.ts b/sdk/factory/mastercopyDeployer.ts index 2516f8fc..3ebef99a 100644 --- a/sdk/factory/mastercopyDeployer.ts +++ b/sdk/factory/mastercopyDeployer.ts @@ -1,14 +1,16 @@ import { BytesLike, ContractFactory, - constants as ethersConstants, - ethers, + ZeroAddress, + JsonRpcSigner, + keccak256, + getAddress, + getCreate2Address, } from "ethers"; -import { keccak256, getCreate2Address, getAddress } from "ethers/lib/utils"; import { getSingletonFactory } from "./singletonFactory"; -const { AddressZero } = ethersConstants; +const AddressZero = ZeroAddress; /** * Deploy a module's mastercopy via the singleton factory. @@ -20,12 +22,14 @@ const { AddressZero } = ethersConstants; * @returns The address of the deployed module mastercopy or the zero address if it was already deployed */ export const deployMastercopy = async ( - signer: ethers.providers.JsonRpcSigner, + signer: JsonRpcSigner, mastercopyContractFactory: ContractFactory, args: Array, salt: string ): Promise => { - const deploymentTx = mastercopyContractFactory.getDeployTransaction(...args); + const deploymentTx = await mastercopyContractFactory.getDeployTransaction( + ...args + ); if (!deploymentTx.data) { throw new Error("Unable to create the deployment data (no init code)."); @@ -45,12 +49,14 @@ export const deployMastercopy = async ( * } */ export const computeTargetAddress = async ( - signer: ethers.providers.JsonRpcSigner, + signer: JsonRpcSigner, mastercopyContractFactory: ContractFactory, args: Array, salt: string ): Promise<{ address: string; isDeployed: boolean }> => { - const deploymentTx = mastercopyContractFactory.getDeployTransaction(...args); + const deploymentTx = await mastercopyContractFactory.getDeployTransaction( + ...args + ); const singletonFactory = await getSingletonFactory(signer); if (!deploymentTx.data) { @@ -60,13 +66,13 @@ export const computeTargetAddress = async ( const initCodeHash = keccak256(deploymentTx.data); const computedAddress = getCreate2Address( - singletonFactory.address, + await singletonFactory.getAddress(), salt, initCodeHash ); const targetAddress = getAddress( - (await singletonFactory.callStatic.deploy( + (await singletonFactory.deploy.staticCall( deploymentTx.data, salt )) as string @@ -86,7 +92,7 @@ export const computeTargetAddress = async ( }; export const deployMastercopyWithInitData = async ( - signer: ethers.providers.JsonRpcSigner, + signer: JsonRpcSigner, initCode: BytesLike, salt: string ): Promise => { @@ -94,13 +100,13 @@ export const deployMastercopyWithInitData = async ( // throws if this for some reason is not a valid address const targetAddress = getAddress( - (await singletonFactory.callStatic.deploy(initCode, salt)) as string + (await singletonFactory.deploy.staticCall(initCode, salt)) as string ); const initCodeHash = keccak256(initCode); const computedTargetAddress = getCreate2Address( - singletonFactory.address, + await singletonFactory.address(), salt, initCodeHash ); @@ -118,7 +124,7 @@ export const deployMastercopyWithInitData = async ( } let gasLimit; - switch (signer.provider.network.name) { + switch ((await signer.provider.getNetwork()).name) { case "optimism": gasLimit = 6000000; break; diff --git a/sdk/factory/moduleDeployer.ts b/sdk/factory/moduleDeployer.ts index 95fe4bf2..5101a4c0 100644 --- a/sdk/factory/moduleDeployer.ts +++ b/sdk/factory/moduleDeployer.ts @@ -1,5 +1,12 @@ -import { Provider } from "@ethersproject/providers"; -import { ethers, Contract, Signer, BigNumber } from "ethers"; +import { + Contract, + Signer, + Provider, + getCreate2Address, + AbiCoder, + solidityPackedKeccak256, + keccak256, +} from "ethers"; import { ContractAddresses, @@ -17,7 +24,7 @@ type TxAndExpectedAddress = { transaction: { data: string; to: string; - value: ethers.BigNumber; + value: bigint; }; expectedModuleAddress: string; }; @@ -33,7 +40,7 @@ type TxAndExpectedAddress = { * @param saltNonce * @returns the transaction and the expected address of the module proxy */ -export const deployAndSetUpModule = ( +export const deployAndSetUpModule = async ( moduleName: KnownContracts, setupArgs: { types: Array; @@ -42,15 +49,19 @@ export const deployAndSetUpModule = ( provider: Provider, chainId: number, saltNonce: string -): TxAndExpectedAddress => { +): Promise<{ + transaction: { data: string; to: string; value: bigint }; + expectedModuleAddress: string; +}> => { const { moduleFactory, moduleMastercopy } = getModuleFactoryAndMasterCopy( moduleName, provider, chainId ); + return getDeployAndSetupTx( - moduleFactory, - moduleMastercopy, + moduleFactory as unknown as Contract, + moduleMastercopy as unknown as Contract, setupArgs, saltNonce ); @@ -69,7 +80,7 @@ export const deployAndSetUpModule = ( * @param saltNonce * @returns the transaction and the expected address of the module proxy */ -export const deployAndSetUpCustomModule = ( +export const deployAndSetUpCustomModule = async ( mastercopyAddress: string, abi: ABI, setupArgs: { @@ -79,7 +90,7 @@ export const deployAndSetUpCustomModule = ( provider: Provider, chainId: number, saltNonce: string -): TxAndExpectedAddress => { +): Promise => { const chainContracts = ContractAddresses[chainId as SupportedNetworks]; const moduleFactoryAddress = chainContracts.factory; const moduleFactory = new Contract( @@ -88,48 +99,50 @@ export const deployAndSetUpCustomModule = ( provider ); const moduleMastercopy = new Contract(mastercopyAddress, abi, provider); - - return getDeployAndSetupTx( + const deployAndSetupTx = await getDeployAndSetupTx( moduleFactory, moduleMastercopy, setupArgs, saltNonce ); + + return deployAndSetupTx; }; -const getDeployAndSetupTx = ( - moduleFactory: ethers.Contract, - moduleMastercopy: ethers.Contract, +const getDeployAndSetupTx = async ( + moduleFactory: Contract, + moduleMastercopy: Contract, setupArgs: { types: Array; values: Array; }, saltNonce: string ) => { - const encodedInitParams = ethers.utils.defaultAbiCoder.encode( + const encodedInitParams = AbiCoder.defaultAbiCoder().encode( setupArgs.types, setupArgs.values ); + const moduleSetupData = moduleMastercopy.interface.encodeFunctionData( "setUp", [encodedInitParams] ); - const expectedModuleAddress = calculateProxyAddress( + const expectedModuleAddress = await calculateProxyAddress( moduleFactory, - moduleMastercopy.address, + await moduleMastercopy.getAddress(), moduleSetupData, saltNonce ); const deployData = moduleFactory.interface.encodeFunctionData( "deployModule", - [moduleMastercopy.address, moduleSetupData, saltNonce] + [await moduleMastercopy.getAddress(), moduleSetupData, saltNonce] ); const transaction = { data: deployData, - to: moduleFactory.address, - value: BigNumber.from(0), + to: await moduleFactory.getAddress(), + value: 0n, }; return { transaction, @@ -137,12 +150,12 @@ const getDeployAndSetupTx = ( }; }; -export const calculateProxyAddress = ( +export const calculateProxyAddress = async ( moduleFactory: Contract, mastercopyAddress: string, initData: string, saltNonce: string -): string => { +): Promise => { const mastercopyAddressFormatted = mastercopyAddress .toLowerCase() .replace(/^0x/, ""); @@ -151,15 +164,15 @@ export const calculateProxyAddress = ( mastercopyAddressFormatted + "5af43d82803e903d91602b57fd5bf3"; - const salt = ethers.utils.solidityKeccak256( + const salt = solidityPackedKeccak256( ["bytes32", "uint256"], - [ethers.utils.solidityKeccak256(["bytes"], [initData]), saltNonce] + [solidityPackedKeccak256(["bytes"], [initData]), saltNonce] ); - return ethers.utils.getCreate2Address( - moduleFactory.address, + return getCreate2Address( + await moduleFactory.getAddress(), salt, - ethers.utils.keccak256(byteCode) + keccak256(byteCode) ); }; diff --git a/sdk/factory/singletonFactory.ts b/sdk/factory/singletonFactory.ts index 0958275b..4531356d 100644 --- a/sdk/factory/singletonFactory.ts +++ b/sdk/factory/singletonFactory.ts @@ -1,4 +1,4 @@ -import { Contract, ethers } from "ethers"; +import { Contract, JsonRpcSigner, parseEther } from "ethers"; const singletonFactoryAbi = [ "function deploy(bytes memory _initCode, bytes32 _salt) public returns (address payable createdContract)", @@ -15,34 +15,40 @@ export const SingletonFactoryAddress = * @returns Singleton Factory contract */ export const getSingletonFactory = async ( - signer: ethers.providers.JsonRpcSigner + signer: JsonRpcSigner ): Promise => { const singletonDeployer = "0xBb6e024b9cFFACB947A71991E386681B1Cd1477D"; - const singletonFactory = new ethers.Contract( + const singletonFactory = new Contract( SingletonFactoryAddress, singletonFactoryAbi, signer ); // check if singleton factory is deployed. - if ((await signer.provider.getCode(singletonFactory.address)) === "0x") { + if ( + (await signer.provider.getCode(await singletonFactory.getAddress())) === + "0x" + ) { console.log( "Singleton factory is not deployed on this chain. Deploying singleton factory..." ); // fund the singleton factory deployer account await signer.sendTransaction({ to: singletonDeployer, - value: ethers.utils.parseEther("0.0247"), + value: parseEther("0.0247"), }); // deploy the singleton factory await ( - await signer.provider.sendTransaction( + await signer.provider.broadcastTransaction( "0xf9016c8085174876e8008303c4d88080b90154608060405234801561001057600080fd5b50610134806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80634af63f0214602d575b600080fd5b60cf60048036036040811015604157600080fd5b810190602081018135640100000000811115605b57600080fd5b820183602082011115606c57600080fd5b80359060200191846001830284011164010000000083111715608d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925060eb915050565b604080516001600160a01b039092168252519081900360200190f35b6000818351602085016000f5939250505056fea26469706673582212206b44f8a82cb6b156bfcc3dc6aadd6df4eefd204bc928a4397fd15dacf6d5320564736f6c634300060200331b83247000822470" ) ).wait(); - if ((await signer.provider.getCode(singletonFactory.address)) == "0x") { + if ( + (await signer.provider.getCode(await singletonFactory.getAddress())) == + "0x" + ) { throw Error( "Singleton factory could not be deployed to correct address, deployment haulted." ); diff --git a/test/01_IAvatar.spec.ts b/test/01_IAvatar.spec.ts index ab9134d8..170fb283 100644 --- a/test/01_IAvatar.spec.ts +++ b/test/01_IAvatar.spec.ts @@ -10,9 +10,12 @@ describe("IAvatar", async () => { const [signer] = await hre.ethers.getSigners(); const Avatar = await hre.ethers.getContractFactory("TestAvatar"); const avatar = await Avatar.connect(signer).deploy(); - const iAvatar = TestAvatar__factory.connect(avatar.address, signer); + const iAvatar = TestAvatar__factory.connect( + await avatar.getAddress(), + signer + ); const tx = { - to: avatar.address, + to: await avatar.getAddress(), value: 0, data: "0x", operation: 0, diff --git a/test/02_Module.spec.ts b/test/02_Module.spec.ts index f2d03b33..fc6d60bd 100644 --- a/test/02_Module.spec.ts +++ b/test/02_Module.spec.ts @@ -7,14 +7,20 @@ describe("Module", async () => { async function setupTests() { const Avatar = await hre.ethers.getContractFactory("TestAvatar"); const avatar = await Avatar.deploy(); - const iAvatar = await hre.ethers.getContractAt("IAvatar", avatar.address); + const iAvatar = await hre.ethers.getContractAt( + "IAvatar", + await avatar.getAddress() + ); const Module = await hre.ethers.getContractFactory("TestModule"); - const module = await Module.deploy(iAvatar.address, iAvatar.address); - await avatar.enableModule(module.address); + const module = await Module.deploy( + await iAvatar.getAddress(), + await iAvatar.getAddress() + ); + await avatar.enableModule(await module.getAddress()); const Guard = await hre.ethers.getContractFactory("TestGuard"); - const guard = await Guard.deploy(module.address); + const guard = await Guard.deploy(await module.getAddress()); const tx = { - to: avatar.address, + to: await avatar.getAddress(), value: 0, data: "0x", operation: 0, @@ -40,14 +46,14 @@ describe("Module", async () => { const [owner, wallet1] = await hre.ethers.getSigners(); await module.transferOwnership(wallet1.address); - await expect(module.setAvatar(iAvatar.address)) + await expect(module.setAvatar(await iAvatar.getAddress())) .to.be.revertedWithCustomError(module, "OwnableUnauthorizedAccount") .withArgs(owner.address); }); it("allows owner to set avatar", async () => { const { iAvatar, module } = await loadFixture(setupTests); - await expect(module.setAvatar(iAvatar.address)); + await expect(module.setAvatar(await iAvatar.getAddress())); }); it("emits previous owner and new owner", async () => { @@ -57,7 +63,7 @@ describe("Module", async () => { await expect(module.setAvatar(wallet1.address)) .to.emit(module, "AvatarSet") - .withArgs(iAvatar.address, wallet1.address); + .withArgs(await iAvatar.getAddress(), wallet1.address); }); }); @@ -66,14 +72,14 @@ describe("Module", async () => { const { iAvatar, module } = await loadFixture(setupTests); const [owner, wallet1] = await hre.ethers.getSigners(); await module.transferOwnership(wallet1.address); - await expect(module.setTarget(iAvatar.address)) + await expect(module.setTarget(await iAvatar.getAddress())) .to.be.revertedWithCustomError(module, "OwnableUnauthorizedAccount") .withArgs(owner.address); }); it("allows owner to set avatar", async () => { const { iAvatar, module } = await loadFixture(setupTests); - await expect(module.setTarget(iAvatar.address)); + await expect(module.setTarget(await iAvatar.getAddress())); }); it("emits previous owner and new owner", async () => { @@ -81,7 +87,7 @@ describe("Module", async () => { const [, wallet1] = await hre.ethers.getSigners(); await expect(module.setTarget(wallet1.address)) .to.emit(module, "TargetSet") - .withArgs(iAvatar.address, wallet1.address); + .withArgs(await iAvatar.getAddress(), wallet1.address); }); }); @@ -95,7 +101,7 @@ describe("Module", async () => { it("pre-checks transaction if guard is set", async () => { const { guard, module, tx } = await loadFixture(setupTests); - await module.setGuard(guard.address); + await module.setGuard(await guard.getAddress()); await expect( module.executeTransaction(tx.to, tx.value, tx.data, tx.operation) ).to.emit(guard, "PreChecked"); @@ -117,7 +123,7 @@ describe("Module", async () => { it("post-checks transaction if guard is set", async () => { const { guard, module, tx } = await loadFixture(setupTests); - await module.setGuard(guard.address); + await module.setGuard(await guard.getAddress()); await expect( module.executeTransaction(tx.to, tx.value, tx.data, tx.operation) ) @@ -141,7 +147,7 @@ describe("Module", async () => { it("pre-checks transaction if guard is set", async () => { const { guard, module, tx } = await loadFixture(setupTests); - await module.setGuard(guard.address); + await module.setGuard(await guard.getAddress()); await expect( module.executeTransactionReturnData( tx.to, @@ -178,7 +184,7 @@ describe("Module", async () => { it("post-checks transaction if guard is set", async () => { const { guard, module, tx } = await loadFixture(setupTests); - await module.setGuard(guard.address); + await module.setGuard(await guard.getAddress()); await expect( module.executeTransactionReturnData( tx.to, diff --git a/test/03_Modifier.spec.ts b/test/03_Modifier.spec.ts index 16c95505..4af1621f 100644 --- a/test/03_Modifier.spec.ts +++ b/test/03_Modifier.spec.ts @@ -1,12 +1,17 @@ -import { AddressZero } from "@ethersproject/constants"; import { AddressOne } from "@gnosis.pm/safe-contracts"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; -import { PopulatedTransaction } from "ethers"; -import { defaultAbiCoder, keccak256, toUtf8Bytes } from "ethers/lib/utils"; +import { + TransactionLike, + keccak256, + toUtf8Bytes, + AbiCoder, + ZeroAddress, + Signer, +} from "ethers"; import hre from "hardhat"; +const AddressZero = ZeroAddress; import { TestAvatar__factory, TestModifier__factory } from "../typechain-types"; import typedDataForTransaction from "./typedDataForTransaction"; @@ -18,16 +23,19 @@ describe("Modifier", async () => { const [signer, alice, bob, charlie] = await hre.ethers.getSigners(); const Avatar = await hre.ethers.getContractFactory("TestAvatar"); const avatar = await Avatar.connect(signer).deploy(); - const iAvatar = TestAvatar__factory.connect(avatar.address, signer); + const iAvatar = TestAvatar__factory.connect( + await avatar.getAddress(), + signer + ); const Modifier = await hre.ethers.getContractFactory("TestModifier"); const modifier = await Modifier.connect(signer).deploy( - iAvatar.address, - iAvatar.address + await iAvatar.getAddress(), + await iAvatar.getAddress() ); - await iAvatar.enableModule(modifier.address); + await iAvatar.enableModule(await modifier.getAddress()); const tx = { - to: avatar.address, + to: await avatar.getAddress(), value: 0, data: "0x", operation: 0, @@ -40,7 +48,10 @@ describe("Modifier", async () => { }; return { iAvatar, - modifier: TestModifier__factory.connect(modifier.address, signer), + modifier: TestModifier__factory.connect( + await modifier.getAddress(), + signer + ), tx, alice, bob, @@ -332,7 +343,7 @@ describe("Modifier", async () => { .withArgs(user1.address); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModule( + await modifier.execTransactionFromModule.populateTransaction( tx.to, tx.value, tx.data, @@ -340,7 +351,7 @@ describe("Modifier", async () => { ); const signature = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user1 @@ -368,7 +379,7 @@ describe("Modifier", async () => { .withArgs(user1.address); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModule( + await modifier.execTransactionFromModule.populateTransaction( tx.to, tx.value, tx.data, @@ -376,13 +387,13 @@ describe("Modifier", async () => { ); const signatureOk = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user1 ); const signatureBad = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user2 @@ -415,7 +426,7 @@ describe("Modifier", async () => { .withArgs(user1.address); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModule( + await modifier.execTransactionFromModule.populateTransaction( tx.to, tx.value, tx.data, @@ -423,13 +434,13 @@ describe("Modifier", async () => { ); const signatureOk = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user1 ); const signatureBad = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user2 @@ -465,7 +476,7 @@ describe("Modifier", async () => { await modifier.enableModule(user1.address); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModule( + await modifier.execTransactionFromModule.populateTransaction( tx.to, tx.value, tx.data, @@ -475,7 +486,7 @@ describe("Modifier", async () => { const salt = keccak256(toUtf8Bytes("salt")); const signatureOk = await sign( - modifier.address, + await modifier.getAddress(), transaction, salt, user1 @@ -537,7 +548,7 @@ describe("Modifier", async () => { .withArgs(user1.address); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModuleReturnData( + await modifier.execTransactionFromModuleReturnData.populateTransaction( tx.to, tx.value, tx.data, @@ -545,7 +556,7 @@ describe("Modifier", async () => { ); const signature = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user1 @@ -573,7 +584,7 @@ describe("Modifier", async () => { .withArgs(user1.address); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModuleReturnData( + await modifier.execTransactionFromModuleReturnData.populateTransaction( tx.to, tx.value, tx.data, @@ -581,13 +592,13 @@ describe("Modifier", async () => { ); const signatureBad = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user2 ); const signatureOk = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user1 @@ -620,7 +631,7 @@ describe("Modifier", async () => { .withArgs(user1.address); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModuleReturnData( + await modifier.execTransactionFromModuleReturnData.populateTransaction( tx.to, tx.value, tx.data, @@ -628,13 +639,13 @@ describe("Modifier", async () => { ); const signatureOk = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user1 ); const signatureBad = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), user2 @@ -670,7 +681,7 @@ describe("Modifier", async () => { await modifier.enableModule(user1.address); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModuleReturnData( + await modifier.execTransactionFromModuleReturnData.populateTransaction( tx.to, tx.value, tx.data, @@ -680,7 +691,7 @@ describe("Modifier", async () => { const salt = keccak256(toUtf8Bytes("salt")); const signatureOk = await sign( - modifier.address, + await modifier.getAddress(), transaction, salt, user1 @@ -725,20 +736,20 @@ describe("Modifier", async () => { await modifier.enableModule(bob.address); const transaction = await signTransaction( - modifier.address, - await modifier.populateTransaction.exposeSentOrSignedByModule(), + await modifier.getAddress(), + await modifier.exposeSentOrSignedByModule.populateTransaction(), keccak256(toUtf8Bytes("something salty")), bob ); // if alice sends it, msg.sender is taken into account, because alice module expect(await alice.call(transaction)).to.equal( - defaultAbiCoder.encode(["address"], [alice.address]) + AbiCoder.defaultAbiCoder().encode(["address"], [alice.address]) ); // if charlie sends it, signature is taken into account because bob module expect(await charlie.call(transaction)).to.equal( - defaultAbiCoder.encode(["address"], [bob.address]) + AbiCoder.defaultAbiCoder().encode(["address"], [bob.address]) ); }); @@ -748,15 +759,15 @@ describe("Modifier", async () => { await modifier.enableModule(alice.address); const transaction = await signTransaction( - modifier.address, - await modifier.populateTransaction.exposeSentOrSignedByModule(), + await modifier.getAddress(), + await modifier.exposeSentOrSignedByModule.populateTransaction(), keccak256(toUtf8Bytes("something salty")), alice ); // if alice sends it, msg.sender is taken into account, because alice module expect(await charlie.call(transaction)).to.equal( - defaultAbiCoder.encode(["address"], [alice.address]) + AbiCoder.defaultAbiCoder().encode(["address"], [alice.address]) ); }); @@ -766,15 +777,15 @@ describe("Modifier", async () => { // no modules enabled const transaction = await signTransaction( - modifier.address, - await modifier.populateTransaction.exposeSentOrSignedByModule(), + await modifier.getAddress(), + await modifier.exposeSentOrSignedByModule.populateTransaction(), keccak256(toUtf8Bytes("something salty")), alice ); // if alice sends it, msg.sender is taken into account, because alice module expect(await charlie.call(transaction)).to.equal( - defaultAbiCoder.encode(["address"], [AddressZero]) + AbiCoder.defaultAbiCoder().encode(["address"], [AddressZero]) ); }); }); @@ -782,32 +793,32 @@ describe("Modifier", async () => { async function sign( contract: string, - transaction: PopulatedTransaction, + transaction: TransactionLike, salt: string, - signer: SignerWithAddress + signer: Signer ) { const { domain, types, message } = typedDataForTransaction( { contract, chainId: 31337, salt }, transaction.data || "0x" ); - const signature = await signer._signTypedData(domain, types, message); + const signature = await signer.signTypedData(domain, types, message); return `${salt}${signature.slice(2)}`; } async function signTransaction( contract: string, - { from, ...transaction }: PopulatedTransaction, + { from, ...transaction }: TransactionLike, salt: string, - signer: SignerWithAddress + signer: Signer ) { const { domain, types, message } = typedDataForTransaction( { contract, chainId: 31337, salt }, transaction.data || "0x" ); - const signature = await signer._signTypedData(domain, types, message); + const signature = await signer.signTypedData(domain, types, message); return { ...transaction, diff --git a/test/04_Guard.spec.ts b/test/04_Guard.spec.ts index 4cee01ec..86cd7c79 100644 --- a/test/04_Guard.spec.ts +++ b/test/04_Guard.spec.ts @@ -11,15 +11,19 @@ async function setupTests() { const avatar = await Avatar.deploy(); const Module = await hre.ethers.getContractFactory("TestModule"); const module = TestModule__factory.connect( - (await Module.connect(owner).deploy(avatar.address, avatar.address)) - .address, + await ( + await Module.connect(owner).deploy( + await avatar.getAddress(), + await avatar.getAddress() + ) + ).getAddress(), owner ); - await avatar.enableModule(module.address); + await avatar.enableModule(await module.getAddress()); const Guard = await hre.ethers.getContractFactory("TestGuard"); const guard = TestGuard__factory.connect( - (await Guard.deploy(module.address)).address, + await (await Guard.deploy(await module.getAddress())).getAddress(), relayer ); @@ -27,12 +31,12 @@ async function setupTests() { "TestNonCompliantGuard" ); const guardNonCompliant = TestGuard__factory.connect( - (await GuardNonCompliant.deploy()).address, + await (await GuardNonCompliant.deploy()).getAddress(), hre.ethers.provider ); const tx = { - to: avatar.address, + to: await avatar.getAddress(), value: 0, data: "0x", operation: 0, @@ -58,35 +62,35 @@ describe("Guardable", async () => { describe("setGuard", async () => { it("reverts if reverts if caller is not the owner", async () => { const { other, guard, module } = await loadFixture(setupTests); - await expect(module.connect(other).setGuard(guard.address)) + await expect(module.connect(other).setGuard(await guard.getAddress())) .to.be.revertedWithCustomError(module, "OwnableUnauthorizedAccount") .withArgs(other.address); }); it("reverts if guard does not implement ERC165", async () => { const { module } = await loadFixture(setupTests); - await expect(module.setGuard(module.address)).to.be.reverted; + await expect(module.setGuard(await module.getAddress())).to.be.reverted; }); it("reverts if guard implements ERC165 and returns false", async () => { const { module, guardNonCompliant } = await loadFixture(setupTests); - await expect(module.setGuard(guardNonCompliant.address)) + await expect(module.setGuard(await guardNonCompliant.getAddress())) .to.be.revertedWithCustomError(module, "NotIERC165Compliant") - .withArgs(guardNonCompliant.address); + .withArgs(await guardNonCompliant.getAddress()); }); it("sets module and emits event", async () => { const { module, guard } = await loadFixture(setupTests); - await expect(module.setGuard(guard.address)) + await expect(module.setGuard(await guard.getAddress())) .to.emit(module, "ChangedGuard") - .withArgs(guard.address); + .withArgs(await guard.getAddress()); }); it("sets guard back to zero", async () => { const { module, guard } = await loadFixture(setupTests); - await expect(module.setGuard(guard.address)) + await expect(module.setGuard(await guard.getAddress())) .to.emit(module, "ChangedGuard") - .withArgs(guard.address); + .withArgs(await guard.getAddress()); await expect(module.setGuard(AddressZero)) .to.emit(module, "ChangedGuard") @@ -160,9 +164,9 @@ describe("BaseGuard", async () => { }); it("checks state after execution", async () => { const { module, guard } = await loadFixture(setupTests); - await expect(module.setGuard(guard.address)) + await expect(module.setGuard(await guard.getAddress())) .to.emit(module, "ChangedGuard") - .withArgs(guard.address); + .withArgs(await guard.getAddress()); await expect(guard.checkAfterExecution(txHash, true)) .to.emit(guard, "PostChecked") .withArgs(true); diff --git a/test/05_ModuleProxyFactory.spec.ts b/test/05_ModuleProxyFactory.spec.ts index c6386cbb..e1c63beb 100644 --- a/test/05_ModuleProxyFactory.spec.ts +++ b/test/05_ModuleProxyFactory.spec.ts @@ -1,11 +1,12 @@ -import { AddressZero } from "@ethersproject/constants"; import { AddressOne } from "@gnosis.pm/safe-contracts"; import { expect } from "chai"; -import { Contract } from "ethers"; +import { AbiCoder, Contract, ZeroAddress } from "ethers"; import { ethers } from "hardhat"; import { calculateProxyAddress } from "../sdk/factory"; +const AddressZero = ZeroAddress; + describe("ModuleProxyFactory", async () => { let moduleFactory: Contract; let moduleMasterCopy: Contract; @@ -23,36 +24,36 @@ describe("ModuleProxyFactory", async () => { const MasterCopyModule = await ethers.getContractFactory("TestModule"); moduleMasterCopy = await MasterCopyModule.deploy( - avatar.address, - avatar.address + await avatar.getAddress(), + await avatar.getAddress() ); - const encodedInitParams = new ethers.utils.AbiCoder().encode( + const encodedInitParams = AbiCoder.defaultAbiCoder().encode( ["address", "address"], - [avatar.address, avatar.address] + [await avatar.getAddress(), await avatar.getAddress()] ); initData = moduleMasterCopy.interface.encodeFunctionData("setUp", [ encodedInitParams, ]); - avatarAddress = avatar.address; + avatarAddress = await avatar.getAddress(); }); describe("createProxy", () => { it("should deploy the expected address ", async () => { const expectedAddress = await calculateProxyAddress( moduleFactory, - moduleMasterCopy.address, + await moduleMasterCopy.getAddress(), initData, saltNonce ); const deploymentTx = await moduleFactory.deployModule( - moduleMasterCopy.address, + await moduleMasterCopy.getAddress(), initData, saltNonce ); const transaction = await deploymentTx.wait(); - const [moduleAddress] = transaction.events[2].args; + const [moduleAddress] = transaction.logs[2].args; expect(moduleAddress).to.be.equal(expectedAddress); }); @@ -69,14 +70,14 @@ describe("ModuleProxyFactory", async () => { it("should fail to deploy because address its already taken ", async () => { await moduleFactory.deployModule( - moduleMasterCopy.address, + await moduleMasterCopy.getAddress(), initData, saltNonce ); await expect( moduleFactory.deployModule( - moduleMasterCopy.address, + await moduleMasterCopy.getAddress(), initData, saltNonce ) @@ -89,12 +90,12 @@ describe("ModuleProxyFactory", async () => { describe("deployModule ", () => { it("should deploy module", async () => { const deploymentTx = await moduleFactory.deployModule( - moduleMasterCopy.address, + await moduleMasterCopy.getAddress(), initData, saltNonce ); const transaction = await deploymentTx.wait(); - const [moduleAddress] = transaction.events[2].args; + const [moduleAddress] = transaction.logs[2].args; const newModule = await ethers.getContractAt("TestModule", moduleAddress); @@ -105,25 +106,25 @@ describe("ModuleProxyFactory", async () => { it("should emit event on module deployment", async () => { const moduleAddress = await calculateProxyAddress( moduleFactory, - moduleMasterCopy.address, + await moduleMasterCopy.getAddress(), initData, saltNonce ); await expect( moduleFactory.deployModule( - moduleMasterCopy.address, + await moduleMasterCopy.getAddress(), initData, saltNonce ) ) .to.emit(moduleFactory, "ModuleProxyCreation") - .withArgs(moduleAddress, moduleMasterCopy.address); + .withArgs(moduleAddress, await moduleMasterCopy.getAddress()); }); it("should fail to deploy because parameters are not valid ", async () => { await expect( moduleFactory.deployModule( - moduleMasterCopy.address, + await moduleMasterCopy.getAddress(), "0xaabc", saltNonce ) diff --git a/test/06_SignatureChecker.spec.ts b/test/06_SignatureChecker.spec.ts index c93b8ee8..f9e30b9e 100644 --- a/test/06_SignatureChecker.spec.ts +++ b/test/06_SignatureChecker.spec.ts @@ -1,13 +1,13 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; -import { PopulatedTransaction } from "ethers"; import { - defaultAbiCoder, + TransactionLike, + AbiCoder, keccak256, - solidityPack, + solidityPacked, toUtf8Bytes, -} from "ethers/lib/utils"; + Signer, +} from "ethers"; import hre from "hardhat"; import { TestSignature__factory } from "../typechain-types"; @@ -22,7 +22,7 @@ describe("SignatureChecker", async () => { return { testSignature: TestSignature__factory.connect( - testSignature.address, + await testSignature.getAddress(), relayer ), signer, @@ -35,9 +35,9 @@ describe("SignatureChecker", async () => { it("correctly detects an appended signature, for an entrypoint no arguments", async () => { const { testSignature, signer, relayer } = await loadFixture(setup); - const transaction = await testSignature.populateTransaction.hello(); + const transaction = await testSignature.hello.populateTransaction(); const signature = await sign( - testSignature.address, + await testSignature.getAddress(), transaction, keccak256(toUtf8Bytes("Hello this is a salt")), signer @@ -59,12 +59,12 @@ describe("SignatureChecker", async () => { it("correctly detects an appended signature, entrypoint with arguments", async () => { const { testSignature, signer, relayer } = await loadFixture(setup); - const transaction = await testSignature.populateTransaction.goodbye( + const transaction = await testSignature.goodbye.populateTransaction( 0, "0xbadfed" ); const signature = await sign( - testSignature.address, + await testSignature.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), signer @@ -89,9 +89,9 @@ describe("SignatureChecker", async () => { const ContractSigner = await hre.ethers.getContractFactory("ContractSignerYes"); - const signer = (await ContractSigner.deploy()).address; + const signer = await (await ContractSigner.deploy()).getAddress(); - const transaction = await testSignature.populateTransaction.hello(); + const transaction = await testSignature.hello.populateTransaction(); // 4 bytes of selector plus 3 bytes of custom signature // an s of 4, 5 or 6 should be okay. 7 and higher should fail @@ -100,7 +100,7 @@ describe("SignatureChecker", async () => { "0xdddddd", keccak256(toUtf8Bytes("salt")), signer, - defaultAbiCoder.encode(["uint256"], [1000]) + AbiCoder.defaultAbiCoder().encode(["uint256"], [1000]) ); await expect( @@ -117,7 +117,7 @@ describe("SignatureChecker", async () => { "0xdddddd", keccak256(toUtf8Bytes("salt")), signer, - defaultAbiCoder.encode(["uint256"], [6]) + AbiCoder.defaultAbiCoder().encode(["uint256"], [6]) ); await expect( @@ -134,16 +134,16 @@ describe("SignatureChecker", async () => { const ContractSigner = await hre.ethers.getContractFactory("ContractSignerYes"); - const signer = (await ContractSigner.deploy()).address; + const signer = await (await ContractSigner.deploy()).getAddress(); - const transaction = await testSignature.populateTransaction.hello(); + const transaction = await testSignature.hello.populateTransaction(); let signature = makeContractSignature( transaction, "0xdddddd", keccak256(toUtf8Bytes("salt")), signer, - defaultAbiCoder.encode(["uint256"], [3]) + AbiCoder.defaultAbiCoder().encode(["uint256"], [3]) ); await expect( @@ -160,7 +160,7 @@ describe("SignatureChecker", async () => { "0xdddddd", keccak256(toUtf8Bytes("salt")), signer, - defaultAbiCoder.encode(["uint256"], [4]) + AbiCoder.defaultAbiCoder().encode(["uint256"], [4]) ); await expect( @@ -177,16 +177,16 @@ describe("SignatureChecker", async () => { const ContractSigner = await hre.ethers.getContractFactory("ContractSignerYes"); - const signer = (await ContractSigner.deploy()).address; + const signer = await (await ContractSigner.deploy()).getAddress(); - const transaction = await testSignature.populateTransaction.hello(); + const transaction = await testSignature.hello.populateTransaction(); let signature = makeContractSignature( transaction, "0xdddddd", keccak256(toUtf8Bytes("salt")), signer, - defaultAbiCoder.encode(["uint256"], [60]) + AbiCoder.defaultAbiCoder().encode(["uint256"], [60]) ); await expect( @@ -203,7 +203,7 @@ describe("SignatureChecker", async () => { "0xdddddd", keccak256(toUtf8Bytes("salt")), signer, - defaultAbiCoder.encode(["uint256"], [6]) + AbiCoder.defaultAbiCoder().encode(["uint256"], [6]) ); await expect( @@ -223,7 +223,7 @@ describe("SignatureChecker", async () => { ); const contractSigner = await ContractSigner.deploy(); - const transaction = await testSignature.populateTransaction.goodbye( + const transaction = await testSignature.goodbye.populateTransaction( 0, "0xbadfed" ); @@ -232,14 +232,14 @@ describe("SignatureChecker", async () => { transaction, "0x001122334455", keccak256(toUtf8Bytes("some irrelevant salt")), - contractSigner.address + await contractSigner.getAddress() ); const signatureBad = makeContractSignature( transaction, "0x00112233445566", keccak256(toUtf8Bytes("some irrelevant salt")), - contractSigner.address + await contractSigner.getAddress() ); const transactionWithGoodSig = { @@ -257,7 +257,7 @@ describe("SignatureChecker", async () => { await expect(await relayer.sendTransaction(transactionWithGoodSig)) .to.emit(testSignature, "Goodbye") - .withArgs(contractSigner.address); + .withArgs(await contractSigner.getAddress()); await expect(await relayer.sendTransaction(transactionWithBadSig)) .to.emit(testSignature, "Goodbye") @@ -270,7 +270,7 @@ describe("SignatureChecker", async () => { await hre.ethers.getContractFactory("ContractSignerYes"); const contractSigner = await ContractSigner.deploy(); - const transaction = await testSignature.populateTransaction.goodbye( + const transaction = await testSignature.goodbye.populateTransaction( 0, "0xbadfed" ); @@ -279,7 +279,7 @@ describe("SignatureChecker", async () => { transaction, "0xaabbccddeeff", keccak256(toUtf8Bytes("salt")), - contractSigner.address + await contractSigner.getAddress() ); const transactionWithSig = { @@ -293,7 +293,7 @@ describe("SignatureChecker", async () => { await expect(await relayer.sendTransaction(transactionWithSig)) .to.emit(testSignature, "Goodbye") - .withArgs(contractSigner.address); + .withArgs(await contractSigner.getAddress()); }); it("signer returns isValid no", async () => { const { testSignature, relayer } = await loadFixture(setup); @@ -301,13 +301,13 @@ describe("SignatureChecker", async () => { const Signer = await hre.ethers.getContractFactory("ContractSignerNo"); const signer = await Signer.deploy(); - const transaction = await testSignature.populateTransaction.hello(); + const transaction = await testSignature.hello.populateTransaction(); const signature = makeContractSignature( transaction, "0xaabbccddeeff", keccak256(toUtf8Bytes("salt")), - signer.address + await signer.getAddress() ); const transactionWithSig = { @@ -328,7 +328,7 @@ describe("SignatureChecker", async () => { ); const contractSigner = await ContractSigner.deploy(); - const transaction = await testSignature.populateTransaction.goodbye( + const transaction = await testSignature.goodbye.populateTransaction( 0, "0xbadfed" ); @@ -337,14 +337,14 @@ describe("SignatureChecker", async () => { transaction, "0x", keccak256(toUtf8Bytes("some irrelevant salt")), - contractSigner.address + await contractSigner.getAddress() ); const signatureBad = makeContractSignature( transaction, "0xffff", keccak256(toUtf8Bytes("some irrelevant salt")), - contractSigner.address + await contractSigner.getAddress() ); const transactionWithGoodSig = { @@ -362,7 +362,7 @@ describe("SignatureChecker", async () => { await expect(await relayer.sendTransaction(transactionWithGoodSig)) .to.emit(testSignature, "Goodbye") - .withArgs(contractSigner.address); + .withArgs(await contractSigner.getAddress()); await expect(await relayer.sendTransaction(transactionWithBadSig)) .to.emit(testSignature, "Goodbye") @@ -376,13 +376,13 @@ describe("SignatureChecker", async () => { ); const signer = await Signer.deploy(); - const transaction = await testSignature.populateTransaction.hello(); + const transaction = await testSignature.hello.populateTransaction(); const signature = makeContractSignature( transaction, "0xaabbccddeeff", keccak256(toUtf8Bytes("salt")), - signer.address + await signer.getAddress() ); const transactionWithSig = { @@ -402,13 +402,13 @@ describe("SignatureChecker", async () => { ); const signer = await Signer.deploy(); - const transaction = await testSignature.populateTransaction.hello(); + const transaction = await testSignature.hello.populateTransaction(); const signature = makeContractSignature( transaction, "0xaabbccddeeff", keccak256(toUtf8Bytes("salt")), - signer.address + await signer.getAddress() ); const transactionWithSig = { @@ -429,7 +429,7 @@ describe("SignatureChecker", async () => { "0x" ); - const transaction = await testSignature.populateTransaction.hello(); + const transaction = await testSignature.hello.populateTransaction(); const signature = makeContractSignature( transaction, @@ -452,22 +452,22 @@ describe("SignatureChecker", async () => { async function sign( contract: string, - transaction: PopulatedTransaction, + transaction: TransactionLike, salt: string, - signer: SignerWithAddress + signer: Signer ) { const { domain, types, message } = typedDataForTransaction( { contract, chainId: 31337, salt }, transaction.data || "0x" ); - const signature = await signer._signTypedData(domain, types, message); + const signature = await signer.signTypedData(domain, types, message); return `${salt}${signature.slice(2)}`; } function makeContractSignature( - transaction: PopulatedTransaction, + transaction: TransactionLike, signerSpecificSignature: string, salt: string, r: string, @@ -475,9 +475,9 @@ function makeContractSignature( ) { const dataBytesLength = ((transaction.data?.length as number) - 2) / 2; - r = defaultAbiCoder.encode(["address"], [r]); - s = s || defaultAbiCoder.encode(["uint256"], [dataBytesLength]); - const v = solidityPack(["uint8"], [0]); + r = AbiCoder.defaultAbiCoder().encode(["address"], [r]); + s = s || AbiCoder.defaultAbiCoder().encode(["uint256"], [dataBytesLength]); + const v = solidityPacked(["uint8"], [0]); return `${signerSpecificSignature}${salt.slice(2)}${r.slice(2)}${s.slice( 2 diff --git a/test/07_GuardableModifier.spec.ts b/test/07_GuardableModifier.spec.ts index a9a853a4..90c29c6c 100644 --- a/test/07_GuardableModifier.spec.ts +++ b/test/07_GuardableModifier.spec.ts @@ -1,8 +1,6 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; -import { PopulatedTransaction } from "ethers"; -import { keccak256, toUtf8Bytes } from "ethers/lib/utils"; +import { Signer, TransactionLike, keccak256, toUtf8Bytes } from "ethers"; import hre from "hardhat"; import { @@ -20,7 +18,7 @@ describe("GuardableModifier", async () => { const Avatar = await hre.ethers.getContractFactory("TestAvatar"); const avatar = TestAvatar__factory.connect( - (await Avatar.deploy()).address, + await (await Avatar.deploy()).getAddress(), deployer ); @@ -28,18 +26,22 @@ describe("GuardableModifier", async () => { "TestGuardableModifier" ); const modifier = TestGuardableModifier__factory.connect( - (await Modifier.connect(deployer).deploy(avatar.address, avatar.address)) - .address, + await ( + await Modifier.connect(deployer).deploy( + await avatar.getAddress(), + await avatar.getAddress() + ) + ).getAddress(), deployer ); const Guard = await hre.ethers.getContractFactory("TestGuard"); const guard = TestGuard__factory.connect( - (await Guard.deploy(modifier.address)).address, + await (await Guard.deploy(await modifier.getAddress())).getAddress(), hre.ethers.provider ); - await avatar.enableModule(modifier.address); - await modifier.enableModule(executor.address); + await avatar.enableModule(await modifier.getAddress()); + await modifier.enableModule(await executor.getAddress()); return { executor, @@ -59,70 +61,70 @@ describe("GuardableModifier", async () => { await expect( modifier .connect(executor) - .execTransactionFromModule(avatar.address, 0, "0x", 0) + .execTransactionFromModule(await avatar.getAddress(), 0, "0x", 0) ).to.not.be.reverted; }); it("pre-checks transaction if guard is set", async () => { const { avatar, executor, modifier, guard } = await loadFixture(setupTests); - await modifier.setGuard(guard.address); + await modifier.setGuard(await guard.getAddress()); await expect( modifier .connect(executor) - .execTransactionFromModule(avatar.address, 0, "0x", 0) + .execTransactionFromModule(await avatar.getAddress(), 0, "0x", 0) ) .to.emit(guard, "PreChecked") - .withArgs(executor.address); + .withArgs(await executor.getAddress()); }); it("pre-check gets called with signer when transaction is relayed", async () => { const { signer, modifier, relayer, avatar, guard } = await loadFixture(setupTests); - await modifier.enableModule(signer.address); - await modifier.setGuard(guard.address); + await modifier.enableModule(await signer.getAddress()); + await modifier.setGuard(await guard.getAddress()); - const inner = await avatar.populateTransaction.enableModule( + const inner = await avatar.enableModule.populateTransaction( "0xff00000000000000000000000000000000ff3456" ); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModule( - avatar.address, + await modifier.execTransactionFromModule.populateTransaction( + await avatar.getAddress(), 0, inner.data as string, 0 ); const signature = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), signer ); const transactionWithSig = { ...transaction, - to: modifier.address, + to: await modifier.getAddress(), data: `${transaction.data}${signature.slice(2)}`, value: 0, }; await expect(await relayer.sendTransaction(transactionWithSig)) .to.emit(guard, "PreChecked") - .withArgs(signer.address); + .withArgs(await signer.getAddress()); }); it("pre-checks and reverts transaction if guard is set", async () => { const { avatar, executor, modifier, guard } = await loadFixture(setupTests); - await modifier.setGuard(guard.address); + await modifier.setGuard(await guard.getAddress()); await expect( modifier .connect(executor) - .execTransactionFromModule(avatar.address, 1337, "0x", 0) + .execTransactionFromModule(await avatar.getAddress(), 1337, "0x", 0) ).to.be.revertedWith("Cannot send 1337"); }); @@ -133,19 +135,19 @@ describe("GuardableModifier", async () => { await expect( modifier .connect(executor) - .execTransactionFromModule(avatar.address, 0, "0x", 0) + .execTransactionFromModule(await avatar.getAddress(), 0, "0x", 0) ).not.to.emit(guard, "PostChecked"); }); it("post-checks transaction if guard is set", async () => { const { avatar, executor, modifier, guard } = await loadFixture(setupTests); - await modifier.setGuard(guard.address); + await modifier.setGuard(await guard.getAddress()); await expect( modifier .connect(executor) - .execTransactionFromModule(avatar.address, 0, "0x", 0) + .execTransactionFromModule(await avatar.getAddress(), 0, "0x", 0) ) .to.emit(guard, "PostChecked") .withArgs(true); @@ -159,22 +161,32 @@ describe("GuardableModifier", async () => { await expect( modifier .connect(executor) - .execTransactionFromModuleReturnData(avatar.address, 0, "0x", 0) + .execTransactionFromModuleReturnData( + await avatar.getAddress(), + 0, + "0x", + 0 + ) ).to.not.be.reverted; }); it("pre-checks transaction if guard is set", async () => { const { avatar, executor, modifier, guard } = await loadFixture(setupTests); - await modifier.setGuard(guard.address); + await modifier.setGuard(await guard.getAddress()); await expect( modifier .connect(executor) - .execTransactionFromModuleReturnData(avatar.address, 0, "0x", 0) + .execTransactionFromModuleReturnData( + await avatar.getAddress(), + 0, + "0x", + 0 + ) ) .to.emit(guard, "PreChecked") - .withArgs(executor.address); + .withArgs(await executor.getAddress()); }); it("pre-check gets called with signer when transaction is relayed", async () => { @@ -182,29 +194,29 @@ describe("GuardableModifier", async () => { await loadFixture(setupTests); await modifier.enableModule(signer.address); - await modifier.setGuard(guard.address); + await modifier.setGuard(await guard.getAddress()); - const inner = await avatar.populateTransaction.enableModule( + const inner = await avatar.enableModule.populateTransaction( "0xff00000000000000000000000000000000ff3456" ); const { from, ...transaction } = - await modifier.populateTransaction.execTransactionFromModuleReturnData( - avatar.address, + await modifier.execTransactionFromModuleReturnData.populateTransaction( + await avatar.getAddress(), 0, inner.data as string, 0 ); const signature = await sign( - modifier.address, + await modifier.getAddress(), transaction, keccak256(toUtf8Bytes("salt")), signer ); const transactionWithSig = { ...transaction, - to: modifier.address, + to: await modifier.getAddress(), data: `${transaction.data}${signature.slice(2)}`, value: 0, }; @@ -217,12 +229,17 @@ describe("GuardableModifier", async () => { it("pre-checks and reverts transaction if guard is set", async () => { const { avatar, executor, modifier, guard } = await loadFixture(setupTests); - await modifier.setGuard(guard.address); + await modifier.setGuard(await guard.getAddress()); await expect( modifier .connect(executor) - .execTransactionFromModuleReturnData(avatar.address, 1337, "0x", 0) + .execTransactionFromModuleReturnData( + await avatar.getAddress(), + 1337, + "0x", + 0 + ) ).to.be.revertedWith("Cannot send 1337"); }); @@ -233,19 +250,29 @@ describe("GuardableModifier", async () => { await expect( modifier .connect(executor) - .execTransactionFromModuleReturnData(avatar.address, 0, "0x", 0) + .execTransactionFromModuleReturnData( + await avatar.getAddress(), + 0, + "0x", + 0 + ) ).not.to.emit(guard, "PostChecked"); }); it("post-checks transaction if guard is set", async () => { const { avatar, executor, modifier, guard } = await loadFixture(setupTests); - await modifier.setGuard(guard.address); + await modifier.setGuard(await guard.getAddress()); await expect( modifier .connect(executor) - .execTransactionFromModuleReturnData(avatar.address, 0, "0x", 0) + .execTransactionFromModuleReturnData( + await avatar.getAddress(), + 0, + "0x", + 0 + ) ) .to.emit(guard, "PostChecked") .withArgs(true); @@ -255,16 +282,16 @@ describe("GuardableModifier", async () => { async function sign( contract: string, - transaction: PopulatedTransaction, + transaction: TransactionLike, salt: string, - signer: SignerWithAddress + signer: Signer ) { const { domain, types, message } = typedDataForTransaction( { contract, chainId: 31337, salt }, transaction.data || "0x" ); - const signature = await signer._signTypedData(domain, types, message); + const signature = await signer.signTypedData(domain, types, message); return `${salt}${signature.slice(2)}`; } diff --git a/yarn.lock b/yarn.lock index ca9709c8..49ebf1c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,11 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@adraffy/ens-normalize@1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" + integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== + "@babel/code-frame@^7.0.0": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" @@ -542,6 +547,13 @@ dependencies: "@noble/hashes" "1.3.1" +"@noble/curves@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + "@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" @@ -552,7 +564,7 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== -"@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1": +"@noble/hashes@1.3.2", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1": version "1.3.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== @@ -717,17 +729,24 @@ mcl-wasm "^0.7.1" rustbn.js "~0.2.0" -"@nomicfoundation/hardhat-chai-matchers@^1.0.5": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-1.0.6.tgz#72a2e312e1504ee5dd73fe302932736432ba96bc" - integrity sha512-f5ZMNmabZeZegEfuxn/0kW+mm7+yV7VNDxLpMOMGXWFJ2l/Ct3QShujzDRF9cOkK9Ui/hbDeOWGZqyQALDXVCQ== +"@nomicfoundation/hardhat-chai-matchers@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.3.tgz#f4c074d39b74bd283c99e2c2bf143e3cef51ae18" + integrity sha512-A40s7EAK4Acr8UP1Yudgi9GGD9Cca/K3LHt3DzmRIje14lBfHtg9atGQ7qK56vdPcTwKmeaGn30FzxMUfPGEMw== dependencies: - "@ethersproject/abi" "^5.1.2" "@types/chai-as-promised" "^7.1.3" chai-as-promised "^7.1.1" deep-eql "^4.0.1" ordinal "^1.0.3" +"@nomicfoundation/hardhat-ethers@^3.0.0": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.5.tgz#0422c2123dec7c42e7fb2be8e1691f1d9708db56" + integrity sha512-RNFe8OtbZK6Ila9kIlHp0+S80/0Bu/3p41HUpaRIoHLm6X3WekTd83vob3rE54Duufu1edCiBDxspBzi2rxHHw== + dependencies: + debug "^4.1.1" + lodash.isequal "^4.5.0" + "@nomicfoundation/hardhat-network-helpers@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.9.tgz#767449e8a2acda79306ac84626117583d95d25aa" @@ -735,10 +754,25 @@ dependencies: ethereumjs-util "^7.1.4" -"@nomicfoundation/hardhat-toolbox@^2.0.0": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.2.tgz#ec95f23b53cb4e71a1a7091380fa223aad18f156" - integrity sha512-vnN1AzxbvpSx9pfdRHbUzTRIXpMLPXnUlkW855VaDk6N1pwRaQ2gNzEmFAABk4lWf11E00PKwFd/q27HuwYrYg== +"@nomicfoundation/hardhat-toolbox@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-4.0.0.tgz#eb1f619218dd1414fa161dfec92d3e5e53a2f407" + integrity sha512-jhcWHp0aHaL0aDYj8IJl80v4SZXWMS1A2XxXa1CA6pBiFfJKuZinCkO6wb+POAt0LIfXB3gA3AgdcOccrcwBwA== + +"@nomicfoundation/hardhat-verify@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.3.tgz#173557f8cfa53c8c9da23a326f54d24fe459ae68" + integrity sha512-ESbRu9by53wu6VvgwtMtm108RSmuNsVqXtzg061D+/4R7jaWh/Wl/8ve+p6SdDX7vA1Z3L02hDO1Q3BY4luLXQ== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "^5.0.2" + cbor "^8.1.0" + chalk "^2.4.2" + debug "^4.1.1" + lodash.clonedeep "^4.5.0" + semver "^6.3.0" + table "^6.8.0" + undici "^5.14.0" "@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": version "0.1.1" @@ -806,7 +840,7 @@ "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" -"@nomiclabs/hardhat-ethers@2.2.3": +"@nomiclabs/hardhat-ethers@^2.2.3": version "2.2.3" resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0" integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg== @@ -1033,18 +1067,18 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== -"@typechain/ethers-v5@^11.1.0": - version "11.1.2" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-11.1.2.tgz#82510c1744f37a2f906b9e0532ac18c0b74ffe69" - integrity sha512-ID6pqWkao54EuUQa0P5RgjvfA3MYqxUQKpbGKERbsjBW5Ra7EIXvbMlPp2pcP5IAdUkyMCFYsP2SN5q7mPdLDQ== +"@typechain/ethers-v6@^0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v6/-/ethers-v6-0.5.1.tgz#42fe214a19a8b687086c93189b301e2b878797ea" + integrity sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA== dependencies: lodash "^4.17.15" ts-essentials "^7.0.1" -"@typechain/hardhat@^6.1.5": - version "6.1.6" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-6.1.6.tgz#1a749eb35e5054c80df531cf440819cb347c62ea" - integrity sha512-BiVnegSs+ZHVymyidtK472syodx1sXYlYJJixZfRstHVGYTi8V1O7QG4nsjyb0PC/LORcq7sfBUcHto1y6UgJA== +"@typechain/hardhat@^9.1.0": + version "9.1.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-9.1.0.tgz#6985015f01dfb37ef2ca8a29c742d05890351ddc" + integrity sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA== dependencies: fs-extra "^9.1.0" @@ -1133,6 +1167,11 @@ dependencies: undici-types "~5.26.4" +"@types/node@18.15.13": + version "18.15.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== + "@types/node@^10.0.3": version "10.17.60" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" @@ -1342,6 +1381,11 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== +aes-js@4.0.0-beta.5: + version "4.0.0-beta.5" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== + agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -2714,6 +2758,19 @@ ethers@^5.7.0, ethers@^5.7.1, ethers@^5.7.2: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" +ethers@^6.9.2: + version "6.9.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.9.2.tgz#6f4632f62e2350fa8354ff28624027a175ef85a4" + integrity sha512-YpkrtILnMQz5jSEsJQRTpduaGT/CXuLnUIuOYzHA0v/7c8IX91m2J48wSKjzGL5L9J/Us3tLoUdb+OwE3U+FFQ== + dependencies: + "@adraffy/ens-normalize" "1.10.0" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "18.15.13" + aes-js "4.0.0-beta.5" + tslib "2.4.0" + ws "8.5.0" + ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -3985,6 +4042,16 @@ lodash.camelcase@^4.3.0: resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -5538,6 +5605,11 @@ tsconfig-paths@^3.14.2: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -5847,6 +5919,11 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== + ws@^7.4.6: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" From 50eedf7fbe4f548ee1fa142452c73a13bb2d7e0a Mon Sep 17 00:00:00 2001 From: Daniel Dimitrov Date: Thu, 11 Jan 2024 15:25:13 +0100 Subject: [PATCH 3/4] fix typechain ethers-v6 generate wrong types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unfortunately there is a bug in typechain and we get some name clashes in the generated code. There is a PR that fixes this, but until it gets merged I’ve added a patch. More info on the name clash: https://github.com/dethcrypto/TypeChain/pull/887 Once this PR is merged the patch could be removed. --- package.json | 6 +- patches/@typechain+ethers-v6+0.5.1.patch | 61 +++++++++++++++ sdk/factory/moduleDeployer.ts | 2 +- yarn.lock | 94 ++++++++++++++++++++++-- 4 files changed, 152 insertions(+), 11 deletions(-) create mode 100644 patches/@typechain+ethers-v6+0.5.1.patch diff --git a/package.json b/package.json index 4159895a..753a58ba 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,8 @@ "prepare": "yarn generate:types && yarn build", "prerelease": "yarn clean && yarn build && yarn build:sdk", "release": "yarn publish --access public", - "verify": "yarn hardhat verify --network" + "verify": "yarn hardhat verify --network", + "postinstall": "patch-package" }, "directories": { "test": "test" @@ -76,6 +77,7 @@ "hardhat-deploy": "^0.11.28", "hardhat-gas-reporter": "^1.0.9", "husky": "^8.0.1", + "patch-package": "^8.0.0", "prettier": "^3.0.3", "prettier-plugin-solidity": "^1.1.3", "rimraf": "^5.0.1", @@ -83,7 +85,7 @@ "solhint-plugin-prettier": "^0.1.0", "solidity-coverage": "^0.8.4", "ts-node": "^10.9.1", - "typechain": "^8.3.0", + "typechain": "^8.3.2", "typescript": "^5.2.2", "yargs": "^17.6.0" }, diff --git a/patches/@typechain+ethers-v6+0.5.1.patch b/patches/@typechain+ethers-v6+0.5.1.patch new file mode 100644 index 00000000..acc8302e --- /dev/null +++ b/patches/@typechain+ethers-v6+0.5.1.patch @@ -0,0 +1,61 @@ +diff --git a/node_modules/@typechain/ethers-v6/dist/codegen/index.js b/node_modules/@typechain/ethers-v6/dist/codegen/index.js +index 604775c..0275a0e 100644 +--- a/node_modules/@typechain/ethers-v6/dist/codegen/index.js ++++ b/node_modules/@typechain/ethers-v6/dist/codegen/index.js +@@ -40,8 +40,9 @@ function codegenContractTypings(contract, codegenConfig) { + + ${events_1.EVENT_METHOD_OVERRIDES} + ++ + ${(0, lodash_1.values)(contract.functions) +- .filter((f) => !reserved_keywords_1.reservedKeywords.has(f[0].name)) ++ .filter((f) => !reserved_keywords_1.ethersPassProperties.has(f[0].name) && !reserved_keywords_1.baseContractProperties.has(f[0].name)) + .map(functions_1.codegenFunctions.bind(null, { codegenConfig })) + .join('\n')} + +diff --git a/node_modules/@typechain/ethers-v6/dist/codegen/index.js.map b/node_modules/@typechain/ethers-v6/dist/codegen/index.js.map +index b67af83..ddc2cbc 100644 +--- a/node_modules/@typechain/ethers-v6/dist/codegen/index.js.map ++++ b/node_modules/@typechain/ethers-v6/dist/codegen/index.js.map +@@ -1 +1 @@ +-{"version":3,"file":"index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AO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,sBAAsB,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAQ,CAAC,CAAA;AACvG,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.d.ts b/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.d.ts +index d3da299..78d7ede 100644 +--- a/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.d.ts ++++ b/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.d.ts +@@ -1,2 +1,3 @@ +-export declare const reservedKeywords: Set; ++export declare const ethersPassProperties: Set; ++export declare const baseContractProperties: Set; + export declare const reservedKeywordsLabels: Set; +diff --git a/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.js b/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.js +index f5a47b1..f8f0994 100644 +--- a/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.js ++++ b/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.js +@@ -1,7 +1,12 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.reservedKeywordsLabels = exports.reservedKeywords = void 0; +-exports.reservedKeywords = new Set(['signer', 'provider', 'deployTransaction', 'deployed', 'fallback', 'connect']); ++exports.reservedKeywordsLabels = exports.baseContractProperties = exports.ethersPassProperties = void 0; ++const ethers_1 = require("ethers"); ++exports.ethersPassProperties = new Set(['then']); ++exports.baseContractProperties = new Set([ ++ ...Object.getOwnPropertyNames(ethers_1.BaseContract.prototype), ++ ...Object.keys(new ethers_1.BaseContract('0x', [])), // for readOnly properties ++]); + exports.reservedKeywordsLabels = new Set([ + 'class', + 'function', +diff --git a/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.js.map b/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.js.map +index 8c70249..c3bf0f1 100644 +--- a/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.js.map ++++ b/node_modules/@typechain/ethers-v6/dist/codegen/reserved-keywords.js.map +@@ -1 +1 @@ +-{"version":3,"file":"reserved-keywords.js","sourceRoot":"","sources":["../../src/codegen/reserved-keywords.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAA;AAE1G,QAAA,sBAAsB,GAAG,IAAI,GAAG,CAAC;IAC5C,OAAO;IACP,UAAU;IACV,WAAW;IACX,SAAS;IACT,YAAY;IACZ,aAAa;IACb,OAAO;IACP,MAAM;IACN,KAAK;IACL,KAAK;IACL,OAAO;IACP,IAAI;IACJ,MAAM;IACN,KAAK;IACL,OAAO;IACP,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,SAAS;IACT,OAAO;IACP,UAAU;IACV,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,WAAW;IACX,MAAM;IACN,UAAU;IACV,OAAO;IACP,OAAO;IACP,IAAI;CACL,CAAC,CAAA"} +\ No newline at end of file ++{"version":3,"file":"reserved-keywords.js","sourceRoot":"","sources":["../../src/codegen/reserved-keywords.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAExB,QAAA,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AACxC,QAAA,sBAAsB,GAAG,IAAI,GAAG,CAAC;IAC5C,GAAG,MAAM,CAAC,mBAAmB,CAAC,qBAAY,CAAC,SAAS,CAAC;IACrD,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,qBAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,0BAA0B;CACvE,CAAC,CAAA;AAEW,QAAA,sBAAsB,GAAG,IAAI,GAAG,CAAC;IAC5C,OAAO;IACP,UAAU;IACV,WAAW;IACX,SAAS;IACT,YAAY;IACZ,aAAa;IACb,OAAO;IACP,MAAM;IACN,KAAK;IACL,KAAK;IACL,OAAO;IACP,IAAI;IACJ,MAAM;IACN,KAAK;IACL,OAAO;IACP,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,SAAS;IACT,OAAO;IACP,UAAU;IACV,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,WAAW;IACX,MAAM;IACN,UAAU;IACV,OAAO;IACP,OAAO;IACP,IAAI;CACL,CAAC,CAAA"} +\ No newline at end of file diff --git a/sdk/factory/moduleDeployer.ts b/sdk/factory/moduleDeployer.ts index 5101a4c0..8f8e3b9e 100644 --- a/sdk/factory/moduleDeployer.ts +++ b/sdk/factory/moduleDeployer.ts @@ -142,7 +142,7 @@ const getDeployAndSetupTx = async ( const transaction = { data: deployData, to: await moduleFactory.getAddress(), - value: 0n, + value: BigInt(0), }; return { transaction, diff --git a/yarn.lock b/yarn.lock index 49ebf1c7..22c3c819 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1328,6 +1328,11 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -1943,6 +1948,11 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +ci-info@^3.7.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -2899,6 +2909,13 @@ find-up@^2.1.0: dependencies: locate-path "^2.0.0" +find-yarn-workspace-root@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" + integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== + dependencies: + micromatch "^4.0.2" + flat-cache@^3.0.4: version "3.1.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.1.tgz#a02a15fdec25a8f844ff7cc658f03dd99eb4609b" @@ -3016,7 +3033,7 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.1.0: +fs-extra@^9.0.0, fs-extra@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== @@ -3280,7 +3297,7 @@ graceful-fs@4.2.10: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -3824,7 +3841,7 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -3910,6 +3927,16 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json-stable-stringify@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz#43d39c7c8da34bfaf785a61a56808b0def9f747d" + integrity sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA== + dependencies: + call-bind "^1.0.5" + isarray "^2.0.5" + jsonify "^0.0.1" + object-keys "^1.1.1" + json5@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" @@ -3940,6 +3967,11 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jsonify@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" + integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== + jsonschema@^1.2.4: version "1.4.1" resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.1.tgz#cc4c3f0077fb4542982973d8a083b6b34f482dab" @@ -3966,6 +3998,13 @@ kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + klaw@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" @@ -4169,7 +4208,7 @@ micro-ftch@^0.3.1: resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" integrity sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg== -micromatch@^4.0.4: +micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== @@ -4487,6 +4526,14 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" +open@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + open@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/open/-/open-9.1.0.tgz#684934359c90ad25742f5a26151970ff8c6c80b6" @@ -4608,6 +4655,27 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +patch-package@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-8.0.0.tgz#d191e2f1b6e06a4624a0116bcb88edd6714ede61" + integrity sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^4.1.2" + ci-info "^3.7.0" + cross-spawn "^7.0.3" + find-yarn-workspace-root "^2.0.0" + fs-extra "^9.0.0" + json-stable-stringify "^1.0.2" + klaw-sync "^6.0.0" + minimist "^1.2.6" + open "^7.4.2" + rimraf "^2.6.3" + semver "^7.5.3" + slash "^2.0.0" + tmp "^0.0.33" + yaml "^2.2.2" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -4937,7 +5005,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^2.2.8: +rimraf@^2.2.8, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -5077,7 +5145,7 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.4, semver@^7.3.7, semver@^7.3.8, semver@^7.5.2, semver@^7.5.4: +semver@^7.3.4, semver@^7.3.7, semver@^7.3.8, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -5176,6 +5244,11 @@ signal-exit@^4.0.1: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -5537,7 +5610,7 @@ titleize@^3.0.0: resolved "https://registry.yarnpkg.com/titleize/-/titleize-3.0.0.tgz#71c12eb7fdd2558aa8a44b0be83b8a76694acd53" integrity sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ== -tmp@0.0.33: +tmp@0.0.33, tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== @@ -5669,7 +5742,7 @@ type-fest@^0.7.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== -typechain@^8.3.0: +typechain@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.3.2.tgz#1090dd8d9c57b6ef2aed3640a516bdbf01b00d73" integrity sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q== @@ -5944,6 +6017,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@^2.2.2: + version "2.3.4" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" + integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== + yargs-parser@20.2.4: version "20.2.4" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" From f51ba56240e627eb298cc57073746ca2be72da8e Mon Sep 17 00:00:00 2001 From: Daniel Dimitrov Date: Fri, 12 Jan 2024 22:47:17 +0100 Subject: [PATCH 4/4] bump package version to 4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 753a58ba..06e58579 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gnosis.pm/zodiac", - "version": "3.5.2", + "version": "4.0.0", "description": "Zodiac is a composable design philosophy and collection of standards for building DAO ecosystem tooling.", "author": "Auryn Macmillan ", "license": "LGPL-3.0+",