From 25602b90ba8f72148c92e8f62bbe847b08c3bab7 Mon Sep 17 00:00:00 2001 From: Jay Paik Date: Thu, 21 Nov 2024 00:44:55 -0500 Subject: [PATCH] fix: [S4] use Ownable2Step in AccountFactory --- gas-snapshots/ModularAccount.json | 2 +- gas-snapshots/SemiModularAccount.json | 2 +- src/factory/AccountFactory.sol | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gas-snapshots/ModularAccount.json b/gas-snapshots/ModularAccount.json index 6e877df8..050f0170 100644 --- a/gas-snapshots/ModularAccount.json +++ b/gas-snapshots/ModularAccount.json @@ -1,5 +1,5 @@ { - "Runtime_AccountCreation": "176125", + "Runtime_AccountCreation": "176147", "Runtime_BatchTransfers": "93045", "Runtime_Erc20Transfer": "78454", "Runtime_InstallSessionKey_Case1": "423148", diff --git a/gas-snapshots/SemiModularAccount.json b/gas-snapshots/SemiModularAccount.json index 2e9dfa3e..0f431b62 100644 --- a/gas-snapshots/SemiModularAccount.json +++ b/gas-snapshots/SemiModularAccount.json @@ -1,5 +1,5 @@ { - "Runtime_AccountCreation": "97745", + "Runtime_AccountCreation": "97767", "Runtime_BatchTransfers": "89031", "Runtime_Erc20Transfer": "74488", "Runtime_InstallSessionKey_Case1": "421700", diff --git a/src/factory/AccountFactory.sol b/src/factory/AccountFactory.sol index 326abc6c..29b13228 100644 --- a/src/factory/AccountFactory.sol +++ b/src/factory/AccountFactory.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.26; import {ValidationConfigLib} from "@erc6900/reference-implementation/libraries/ValidationConfigLib.sol"; import {IEntryPoint} from "@eth-infinitism/account-abstraction/interfaces/IEntryPoint.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {LibClone} from "solady/utils/LibClone.sol"; @@ -15,7 +16,7 @@ import {SemiModularAccountBytecode} from "../account/SemiModularAccountBytecode. /// @author Alchemy /// @notice Factory contract to deploy modular accounts. Allows creation of both modular and semi-modular accounts /// (the bytecode variant). -contract AccountFactory is Ownable { +contract AccountFactory is Ownable2Step { ModularAccount public immutable ACCOUNT_IMPL; SemiModularAccountBytecode public immutable SEMI_MODULAR_ACCOUNT_IMPL; IEntryPoint public immutable ENTRY_POINT;