Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Add / test an account creation workflow #17

@NiloCK

Description

@NiloCK

4337 Account creation flow looks like this:

  • create a UserOp with
    • sender == your precomputed wallet address
    • initCode == contractFactoryAddress+encodedConstructorParameters

The entrypoint will call the given contractFactoryAddress with the given encodedConstructorParameters.

The wallet address can be precomputed with:

const accountAddress = ethers.utils.getCreate2Address(
  contractFactoryAddress,
  salt,
  scBridgeWalletContractBytecodeHash
);

To do:

  • make a factory contract (add a factory for BridgeAccounts #16)
  • add a deployed 4337 entrypoint contract to our hardhat / test config
  • test precomputed addresses by hitting the entrypoint with an initAccount operation

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions