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

Add / test an account creation workflow #17

Open
1 of 3 tasks
NiloCK opened this issue Oct 13, 2023 · 2 comments
Open
1 of 3 tasks

Add / test an account creation workflow #17

NiloCK opened this issue Oct 13, 2023 · 2 comments
Assignees

Comments

@NiloCK
Copy link
Contributor

NiloCK commented Oct 13, 2023

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
@geoknee
Copy link
Contributor

geoknee commented Oct 13, 2023

@NiloCK are we having an entrypoint after all, then?

@NiloCK
Copy link
Contributor Author

NiloCK commented Oct 13, 2023

@NiloCK are we having an entrypoint after all, then?

Yes. Entry point, but no bundler.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants