From 7b7332328f71a30e0504cc4d6025c5ac086a8b88 Mon Sep 17 00:00:00 2001 From: Mikhail <16622558+mmv08@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:40:31 +0200 Subject: [PATCH] Add EntryPointSimulations contract --- modules/4337/contracts/test/Imports.sol | 1 + modules/4337/src/deploy/entrypointHelpers.ts | 20 ++++++++++++++++++++ modules/4337/test/utils/setup.ts | 5 +++++ 3 files changed, 26 insertions(+) create mode 100644 modules/4337/contracts/test/Imports.sol create mode 100644 modules/4337/src/deploy/entrypointHelpers.ts diff --git a/modules/4337/contracts/test/Imports.sol b/modules/4337/contracts/test/Imports.sol new file mode 100644 index 000000000..936595fc1 --- /dev/null +++ b/modules/4337/contracts/test/Imports.sol @@ -0,0 +1 @@ +import "@account-abstraction/contracts/core/EntryPointSimulations.sol"; \ No newline at end of file diff --git a/modules/4337/src/deploy/entrypointHelpers.ts b/modules/4337/src/deploy/entrypointHelpers.ts new file mode 100644 index 000000000..881720e9a --- /dev/null +++ b/modules/4337/src/deploy/entrypointHelpers.ts @@ -0,0 +1,20 @@ +import { DeployFunction } from 'hardhat-deploy/types' + +const deploy: DeployFunction = async ({ deployments, getNamedAccounts, network }) => { + if (!network.tags.test) { + return + } + + const { deployer } = await getNamedAccounts() + const { deploy } = deployments + + await deploy('EntryPointSimulations', { + from: deployer, + args: [], + log: true, + deterministicDeployment: true, + }) +} + + +export default deploy diff --git a/modules/4337/test/utils/setup.ts b/modules/4337/test/utils/setup.ts index 0b3a8e5f2..4b5ea607d 100644 --- a/modules/4337/test/utils/setup.ts +++ b/modules/4337/test/utils/setup.ts @@ -53,6 +53,11 @@ export const getEntryPoint = async () => { return await ethers.getContractAt('IEntryPoint', EntryPointDeployment.address) } +export const getEntryPointSimulations = async () => { + const EntryPointDeployment = await deployments.get('EntryPointSimulations') + return await ethers.getContractAt('EntryPointSimulations', EntryPointDeployment.address) +} + export const getSafeAtAddress = async (address: string) => { return await ethers.getContractAt('SafeMock', address) }