Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reference EIP-2470 (create2 deployer) #4344

Merged
merged 1 commit into from
Oct 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion EIPS/eip-4337.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ The paymaster scheme allows a contract to passively pay on users' behalf under a

It is an important design goal of this proposal to replicate the key property of EOAs that users do not need to perform some custom action or rely on an existing user to create their wallet; they can simply generate an address locally and immediately start accepting funds.

This is accomplished by having the entry point itself create wallets using CREATE2. The `UserOperation` struct has an `initCode` field; this field would be empty for all operations by a given wallet after the first, but the first operation would fill in the `initCode`. The entry point creates the wallet, and then performs the operation. The user can compute the address of their wallet by locally running the [EIP 1014](https://eips.ethereum.org/EIPS/eip-1014) CREATE2 address formula. The salt used is the `nonce` of the `UserOperation`.
This is accomplished by having the entry point itself create wallets using CREATE2. The `UserOperation` struct has an `initCode` field; this field would be empty for all operations by a given wallet after the first, but the first operation would fill in the `initCode`. The entry point uses [EIP-2470](https://eips.ethereum.org/EIPS/eip-2470) deployer contract to create the wallet, and then performs the operation. The user can compute the address of their wallet by locally running the [EIP 1014](https://eips.ethereum.org/EIPS/eip-1014) CREATE2 address formula. The salt used is the `nonce` of the `UserOperation`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is accomplished by having the entry point itself create wallets using CREATE2. The `UserOperation` struct has an `initCode` field; this field would be empty for all operations by a given wallet after the first, but the first operation would fill in the `initCode`. The entry point uses [EIP-2470](https://eips.ethereum.org/EIPS/eip-2470) deployer contract to create the wallet, and then performs the operation. The user can compute the address of their wallet by locally running the [EIP 1014](https://eips.ethereum.org/EIPS/eip-1014) CREATE2 address formula. The salt used is the `nonce` of the `UserOperation`.
This is accomplished by having the entrypoint itself create wallets using CREATE2. The `UserOperation` struct has an `initCode` field; this field would be empty for all operations by a given wallet after the first, but the first operation would fill in the `initCode`. The entry point uses [EIP-2470](./eip-2470.md) deployer contract to create the wallet, and then performs the operation. The user can compute the address of their wallet by locally running the [EIP 1014](./eip-1014.md) `CREATE2` address formula. The salt used is the `nonce` of the `UserOperation`.

(The EntryPoint contract has a utility method `getSenderAddress()` for that purpose)

### Entry point upgrading

Expand Down