From 29f0984391e1b8aedf01971c8bd3dac34b74746b Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Tue, 9 Apr 2024 16:39:28 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9A=97=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yaml | 13 +------------ src/WebauthnModularAccountFactory.sol | 15 --------------- test/MultiOwnerPluginIntegration.t.sol | 20 ++++++++++++++++++-- 3 files changed, 19 insertions(+), 29 deletions(-) delete mode 100644 src/WebauthnModularAccountFactory.sol diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6fe72a2..8ae017d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,16 +11,5 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: oven-sh/setup-bun@v1 - uses: foundry-rs/foundry-toolchain@v1 - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: pip - cache-dependency-path: requirements.txt - - run: pip install -r requirements.txt - - run: bun install - - run: bun run test + - run: forge test --force --mt test_userOpValidation_owner_standardExecute -vvvvv diff --git a/src/WebauthnModularAccountFactory.sol b/src/WebauthnModularAccountFactory.sol deleted file mode 100644 index 1a7dc04..0000000 --- a/src/WebauthnModularAccountFactory.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.25; - -import { IEntryPoint } from "modular-account/src/interfaces/erc4337/IEntryPoint.sol"; -import { MultiOwnerModularAccountFactory } from "modular-account/src/factory/MultiOwnerModularAccountFactory.sol"; - -contract WebauthnModularAccountFactory is MultiOwnerModularAccountFactory { - constructor( - address pluginManager_, - address entryPoint_, - address plugin_, - bytes32 manifestHash_, - IEntryPoint entryPointImplementation_ - ) MultiOwnerModularAccountFactory(pluginManager_, entryPoint_, plugin_, manifestHash_, entryPointImplementation_) { } -} diff --git a/test/MultiOwnerPluginIntegration.t.sol b/test/MultiOwnerPluginIntegration.t.sol index 0048c1b..578b9bd 100644 --- a/test/MultiOwnerPluginIntegration.t.sol +++ b/test/MultiOwnerPluginIntegration.t.sol @@ -3,10 +3,12 @@ pragma solidity ^0.8.25; import { Test } from "forge-std/Test.sol"; -import { EntryPoint } from "account-abstraction/core/EntryPoint.sol"; import { IERC1271 } from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { EntryPoint } from "account-abstraction/core/EntryPoint.sol"; + import { UpgradeableModularAccount } from "modular-account/src/account/UpgradeableModularAccount.sol"; import { MultiOwnerModularAccountFactory } from "modular-account/src/factory/MultiOwnerModularAccountFactory.sol"; import { IEntryPoint } from "modular-account/src/interfaces/erc4337/IEntryPoint.sol"; @@ -53,10 +55,19 @@ contract MultiOwnerPluginIntegration is Test { // setup plugins and factory plugin = new WebauthnOwnerPlugin(); + + UpgradeableModularAccount implementation = new UpgradeableModularAccount(IEntryPoint(address(entryPoint))); + + emit log_named_address(" this", address(this)); + emit log_named_address(" plugin", address(plugin)); + emit log_named_address("implementation", address(implementation)); + emit log_named_bytes32(" manifest", keccak256(abi.encode(plugin.pluginManifest()))); + emit log_named_address(" entrypoint", address(entryPoint)); + factory = new MultiOwnerModularAccountFactory( address(this), address(plugin), - address(new UpgradeableModularAccount(IEntryPoint(address(entryPoint)))), + address(implementation), keccak256(abi.encode(plugin.pluginManifest())), entryPoint ); @@ -65,6 +76,11 @@ contract MultiOwnerPluginIntegration is Test { owners = new address[](2); owners[0] = owner1 > owner2 ? owner2 : owner1; owners[1] = owner2 > owner1 ? owner2 : owner1; + emit log_named_address(" proxy code", type(ERC1967Proxy).creationCode); + emit log_named_address(" factory impl", factory.IMPL()); + emit log_named_bytes32( + " hash", keccak256(abi.encodePacked(type(ERC1967Proxy).creationCode, abi.encode(factory.IMPL(), ""))) + ); account = UpgradeableModularAccount(payable(factory.getAddress(0, owners))); vm.label(address(account), "account"); vm.deal(address(account), 100 ether);