Skip to content

Commit

Permalink
Update to EntryPoint Release (#269)
Browse files Browse the repository at this point in the history
With the `EntryPoint` v0.7 release right around the corner, this PR
updates the branch to use the contract version that was deployed.

We manage to deploy the `EntryPoint` to the exact same address, so are
definitely using the correct code :)

```bash
$ npx hardhat deploy --network hardhat | rg '"EntryPoint"'
deploying "EntryPoint" (tx: 0x1ca5c698c8f3416559c59a95356a344285fa17e674072ed9d63b0f79ba224963)...: deployed at 0x0000000071727De22E5E9d8BAf0edAc6f37da032 with 3650209 gas
```
  • Loading branch information
nlordell authored Feb 28, 2024
1 parent 10dd85e commit 0449070
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 1,517 deletions.
2 changes: 1 addition & 1 deletion examples/safe-4337-passkeys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@web3modal/ethers": "^4.0.5",
"@safe-global/safe-erc4337": "^0.2.0",
"@safe-global/safe-erc4337": "^0.3.0",
"ethers": "^6.11.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
6 changes: 3 additions & 3 deletions modules/4337/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Solidity optimizer: enabled with 10.000.000 runs

## Supported EntryPoint

TBD
The official deployments support the EntryPoint v0.7.0 with the canonical deployment at `0x0000000071727De22E5E9d8BAf0edAc6f37da032`.

## Expected addresses

- `SafeModuleSetup` at `TBD`
- `Safe4337Module` at `TBD`
- `SafeModuleSetup` at `0x2dd68b007B46fBe91B9A7c3EDa5A7a1063cB5b47`
- `Safe4337Module` at `0xfaa6F2eC82BdA7C22220522869E854a3446053A5`

## Changes

Expand Down
8 changes: 4 additions & 4 deletions modules/4337/contracts/Safe4337Module.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ pragma solidity 0.8.23;

import {HandlerContext} from "@safe-global/safe-contracts/contracts/handler/HandlerContext.sol";
import {CompatibilityFallbackHandler} from "@safe-global/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol";
import {IAccount} from "@account-abstraction/contracts/contracts/interfaces/IAccount.sol";
import {PackedUserOperation} from "@account-abstraction/contracts/contracts/interfaces/PackedUserOperation.sol";
import {_packValidationData} from "@account-abstraction/contracts/contracts/core/Helpers.sol";
import {UserOperationLib} from "@account-abstraction/contracts/contracts/core/UserOperationLib.sol";
import {IAccount} from "@account-abstraction/contracts/interfaces/IAccount.sol";
import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol";
import {_packValidationData} from "@account-abstraction/contracts/core/Helpers.sol";
import {UserOperationLib} from "@account-abstraction/contracts/core/UserOperationLib.sol";
import {ISafe} from "./interfaces/Safe.sol";

/**
Expand Down
6 changes: 3 additions & 3 deletions modules/4337/contracts/experimental/SafeSignerLaunchpad.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0 <0.9.0;

import {IAccount} from "@account-abstraction/contracts/contracts/interfaces/IAccount.sol";
import {PackedUserOperation} from "@account-abstraction/contracts/contracts/interfaces/PackedUserOperation.sol";
import {_packValidationData} from "@account-abstraction/contracts/contracts/core/Helpers.sol";
import {IAccount} from "@account-abstraction/contracts/interfaces/IAccount.sol";
import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol";
import {_packValidationData} from "@account-abstraction/contracts/core/Helpers.sol";
import {SafeStorage} from "@safe-global/safe-contracts/contracts/libraries/SafeStorage.sol";
import {SignatureValidatorConstants} from "./SignatureValidatorConstants.sol";

Expand Down
8 changes: 4 additions & 4 deletions modules/4337/contracts/test/SafeMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* solhint-disable one-contract-per-file */
pragma solidity >=0.8.0;

import {IAccount} from "@account-abstraction/contracts/contracts/interfaces/IAccount.sol";
import {UserOperationLib} from "@account-abstraction/contracts/contracts/core/UserOperationLib.sol";
import {PackedUserOperation} from "@account-abstraction/contracts/contracts/interfaces/PackedUserOperation.sol";
import {_packValidationData} from "@account-abstraction/contracts/contracts/core/Helpers.sol";
import {IAccount} from "@account-abstraction/contracts/interfaces/IAccount.sol";
import {UserOperationLib} from "@account-abstraction/contracts/core/UserOperationLib.sol";
import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol";
import {_packValidationData} from "@account-abstraction/contracts/core/Helpers.sol";

contract SafeMock {
address public singleton;
Expand Down
2 changes: 1 addition & 1 deletion modules/4337/contracts/test/TestStakedFactory.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0 <0.9.0;

import {IEntryPoint} from "@account-abstraction/contracts/contracts/interfaces/IEntryPoint.sol";
import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol";

contract TestStakedFactory {
address public immutable FACTORY;
Expand Down
4 changes: 2 additions & 2 deletions modules/4337/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@safe-global/safe-erc4337",
"version": "0.2.0",
"version": "0.3.0",
"description": "Safe Module for ERC-4337 support",
"homepage": "https://github.com/safe-global/safe-modules/4337",
"license": "GPL-3.0",
Expand Down Expand Up @@ -48,7 +48,7 @@
"url": "https://github.com/safe-global/safe-modules/issues"
},
"devDependencies": {
"@account-abstraction/contracts": "github:5afe/account-abstraction#prerelease/2024-02-12",
"@account-abstraction/contracts": "^0.7.0",
"@noble/curves": "^1.3.0",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@openzeppelin/contracts": "^5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions modules/4337/src/deploy/entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EntryPoint from '@account-abstraction/contracts/artifacts/contracts/core/EntryPoint.sol/EntryPoint.json'
import EntryPoint from '@account-abstraction/contracts/artifacts/EntryPoint.json'
import { DeployFunction } from 'hardhat-deploy/types'

const ENTRY_POINT = process.env.DEPLOYMENT_ENTRY_POINT_ADDRESS
Expand All @@ -13,7 +13,7 @@ const deploy: DeployFunction = async ({ deployments, getNamedAccounts, network }
contract: EntryPoint,
args: [],
log: true,
deterministicDeployment: true,
deterministicDeployment: '0x90d8084deab30c2a37c45e8d47f49f2f7965183cb6990a98943ef94940681de3',
})
} else if (!ENTRY_POINT) {
throw new Error('DEPLOYMENT_ENTRY_POINT_ADDRESS must be set')
Expand Down
Loading

0 comments on commit 0449070

Please sign in to comment.