-
Notifications
You must be signed in to change notification settings - Fork 138
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
feat: entry point address as optional to SmartAccountProvider #180
Conversation
79efd67
to
bc2e02b
Compare
bc2e02b
to
f2717f8
Compare
8ff1972
to
1b90588
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple nits, but LGTM otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wanted to discuss current approach re: escape in the opts param vs. if you considered just having the entrypoint be an optional constructor param with a default value if not present.
thanks for reflecting the change across all surfaces 🙏
packages/core/src/utils/defaults.ts
Outdated
* @returns a {@link abi.Address} for the given chain | ||
* @throws if the chain doesn't have an address currently deployed | ||
*/ | ||
export const getDefaultEntryPointContract = (chain: Chain): Address => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit(naming): to me the method name implies retrieving an object containing details about a contract, not just the address.
should we name it: getDefaultEntryPointAddress
packages/core/src/provider/base.ts
Outdated
@@ -87,7 +96,6 @@ export type SmartAccountProviderConfig< | |||
> = { | |||
rpcProvider: string | PublicErc4337Client<TTransport>; | |||
chain: Chain; | |||
entryPointAddress: Address; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above re: question on why we can't just make this optional with a default value,
424329d
to
68628f2
Compare
Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
68628f2
to
a05006f
Compare
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
* feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
app.asana.com/0/1205598840815267/1205773893380310/f
Part of the task linked above, removed entrypoint contract address param from SmartAccountProvider constructor params/class fields and instead, made entry point contract of the linked SCA account to be the source of entry point contract address.
In case the entry point contract address is needed prior to account being connected, entry point contract address defaults to the default entry point contract address from the getDefaultEntryPointContract helper.
Follow up PRs will made to make entry point contract address param for SmartContractAccount class as optional (in case user wants to use their own for some reason).
PR-Codex overview
Detailed summary
defaults.js
anduserop.js
to theutils
directory inpackages/core/src/utils
.privy.ts
,fireblocks.md
, andlit.md
in thesite/snippets
andsite/smart-accounts/signers
directories.readonly entryPointAddress: Address
totypes.ts
inpackages/core/src/provider
.@alchemy/aa-core
version inpackages/alchemy/package.json
andpackages/accounts/package.json
.introduction.md
insite/packages/aa-alchemy/provider
,site/packages/aa-alchemy/middleware
,site/packages/aa-ethers/provider-adapter
, andsite/packages/aa-core/client
.getDefaultSimpleAccountFactoryAddress
andgetDefaultLightAccountFactoryAddress
imports inindex.ts
andlight-account/__tests__/account.test.ts
inpackages/accounts/src
andlight-account/utils.js
inpackages/core/src/account
.@alchemy/aa-accounts
,@alchemy/aa-alchemy
, and@alchemy/aa-core
versions inexamples/aa-simple-dapp/package.json
andexamples/alchemy-daapp/package.json
.fromEthersProvider.md
insite/packages/aa-ethers/provider-adapter
.provider.ts
inpackages/alchemy/src
.introduction.md
insite/packages/aa-alchemy/middleware
.getDefaultLightAccountFactoryAddress
import inindex.ts
inpackages/core/src
.simple.test.ts
inpackages/core/src/account/__tests__
.@alchemy/aa-accounts
,@alchemy/aa-alchemy
, and@alchemy/aa-core
versions inexamples/aa-simple-dapp/package.json
andexamples/alchemy-daapp/package.json
.connect.md
insite/packages/aa-ethers/account-signer
.createPublicErc4337Client.md
insite/packages/aa-core/client
.provider.test.ts
inpackages/alchemy/src/__tests__
.ethers-provider.ts
insite/snippets
.sponsoring-gas.md
insite/smart-accounts
.index.tsx
inexamples/aa-simple-dapp/src/context/wallet
.withAlchemyGasManager.md
insite/packages/aa-alchemy/middleware
.types.ts
inpackages/core/src/account
.userop.ts
inpackages/core/src/utils
.config.ts
insite/.vitepress
.capsule.md
insite/smart-accounts/signers
.