From c7c79a668e24cef46c250a19900cf761d01b1a11 Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev <16622558+mmv08@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:42:26 +0100 Subject: [PATCH] use build artifacts from safe-contracts directly --- modules/passkey/package.json | 2 +- modules/passkey/test/4337-e2e/WebAuthnSigner.spec.ts | 11 ++++++----- package-lock.json | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/passkey/package.json b/modules/passkey/package.json index 4814de5d..770012a0 100644 --- a/modules/passkey/package.json +++ b/modules/passkey/package.json @@ -43,6 +43,7 @@ "@noble/curves": "^1.3.0", "@nomicfoundation/hardhat-toolbox": "^4.0.0", "@account-abstraction/contracts": "^0.7.0", + "@safe-global/safe-erc4337": "^0.3.0", "cbor": "^9.0.2", "dotenv": "^16.4.5", "hardhat": "^2.21.0", @@ -55,7 +56,6 @@ } }, "dependencies": { - "@safe-global/safe-erc4337": "^0.3.0", "@safe-global/safe-contracts": "^1.4.1-build.0" } } diff --git a/modules/passkey/test/4337-e2e/WebAuthnSigner.spec.ts b/modules/passkey/test/4337-e2e/WebAuthnSigner.spec.ts index f447893f..701ae2fa 100644 --- a/modules/passkey/test/4337-e2e/WebAuthnSigner.spec.ts +++ b/modules/passkey/test/4337-e2e/WebAuthnSigner.spec.ts @@ -1,4 +1,5 @@ import { expect } from 'chai' +import SafeL2 from '@safe-global/safe-contracts/build/artifacts/contracts/SafeL2.sol/SafeL2.json' import { deployments, ethers, network } from 'hardhat' import { packGasParameters, unpackUserOperation } from '@safe-global/safe-erc4337/dist/src/utils/userOp' import { bundlerRpc, prepareAccounts, waitForUserOp } from '../utils/e2e' @@ -26,11 +27,11 @@ describe('E2E - WebAuthn Signers', () => { const bundler = bundlerRpc() const entryPoint = await ethers.getContractAt('IEntryPoint', EntryPoint.address) - const module = await ethers.getContractAt('Safe4337Module', Safe4337Module.address) - const proxyFactory = await ethers.getContractAt('SafeProxyFactory', SafeProxyFactory.address) - const safeModuleSetup = await ethers.getContractAt('SafeModuleSetup', SafeModuleSetup.address) + const module = await ethers.getContractAt(Safe4337Module.abi, Safe4337Module.address) + const proxyFactory = await ethers.getContractAt(SafeProxyFactory.abi, SafeProxyFactory.address) + const safeModuleSetup = await ethers.getContractAt(SafeModuleSetup.abi, SafeModuleSetup.address) const signerLaunchpad = await ethers.getContractAt('Safe256BitECSignerLaunchpad', Safe256BitECSignerLaunchpad.address) - const singleton = await ethers.getContractAt('SafeL2', SafeL2.address) + const singleton = await ethers.getContractAt(SafeL2.abi, SafeL2.address) const webAuthnVerifier = await ethers.getContractAt('WebAuthnVerifier', WebAuthnVerifier.address) const WebAuthnSignerFactory = await ethers.getContractFactory('WebAuthnSignerFactory') @@ -231,7 +232,7 @@ describe('E2E - WebAuthn Signers', () => { const [implementation] = ethers.AbiCoder.defaultAbiCoder().decode(['address'], await ethers.provider.getStorage(safe, 0)) expect(implementation).to.equal(singleton.target) - const safeInstance = await ethers.getContractAt('SafeL2', safe) + const safeInstance = await ethers.getContractAt(SafeL2.abi, safe) expect(await safeInstance.getOwners()).to.deep.equal([signerAddress]) }) }) diff --git a/package-lock.json b/package-lock.json index 7c6cd7ae..8595414f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1046,13 +1046,13 @@ "version": "0.1.0", "license": "GPL-3.0", "dependencies": { - "@safe-global/safe-contracts": "^1.4.1-build.0", - "@safe-global/safe-erc4337": "^0.3.0" + "@safe-global/safe-contracts": "^1.4.1-build.0" }, "devDependencies": { "@account-abstraction/contracts": "^0.7.0", "@noble/curves": "^1.3.0", "@nomicfoundation/hardhat-toolbox": "^4.0.0", + "@safe-global/safe-erc4337": "^0.3.0", "cbor": "^9.0.2", "dotenv": "^16.4.5", "hardhat": "^2.21.0",