Skip to content

Commit

Permalink
⚗️
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzdanilo committed Apr 9, 2024
1 parent cd88990 commit 29f0984
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 0 additions & 15 deletions src/WebauthnModularAccountFactory.sol

This file was deleted.

20 changes: 18 additions & 2 deletions test/MultiOwnerPluginIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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
);
Expand All @@ -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);
Expand Down

0 comments on commit 29f0984

Please sign in to comment.