Skip to content

Commit 8efe536

Browse files
feat: add account factory 0.7 to explore (#4951)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces support for new account factories and updates documentation regarding custom account factories and Entrypoint v0.7. It enhances the `smartWallet` function and provides clearer information on available account factory options. ### Detailed summary - Added support for `thirdweb.eth/AccountFactory_0_7` and `thirdweb.eth/ManagedAccountFactory_0_7`. - Updated documentation to include usage of custom account factories with the `smartWallet` function. - Included examples for using v0.7 Entrypoint with `smartWallet`. - Revised default account factory information in the documentation to specify v0.6 and v0.7 options. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 5c4c570 commit 8efe536

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

apps/dashboard/src/data/explore.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ const SMART_WALLET = {
272272
contracts: [
273273
"thirdweb.eth/AccountFactory",
274274
"thirdweb.eth/ManagedAccountFactory",
275+
"thirdweb.eth/AccountFactory_0_7",
276+
"thirdweb.eth/ManagedAccountFactory_0_7",
275277
],
276278
showInExplore: true,
277279
} satisfies ExploreCategory;

apps/portal/src/app/connect/account-abstraction/factories/page.mdx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export const metadata = createMetadata({
2020

2121
# Account Factories
2222

23-
By default, the SDK uses a global account factory deployed on most chains at address [`0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00`](https://thirdweb.com/1/0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00).
23+
By default, the SDK uses a global account factory deployed on most chains:
24+
25+
- [`AccountFactory`](https://thirdweb.com/thirdweb.eth/AccountFactory) at address [`0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00`](https://thirdweb.com/1/0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00) for Entrypoint v0.6.
26+
- [`AccountFactory_0_7`](https://thirdweb.com/thirdweb.eth/AccountFactory_0_7) at address [`0x4be0ddfebca9a5a4a617dee4dece99e7c862dceb`](https://thirdweb.com/1/0x4be0ddfebca9a5a4a617dee4dece99e7c862dceb) for Entrypoint v0.7.
2427

2528
The default account factory deploys standard, immutable accounts with the features listed below. However, you can customize the behavior of your apps smart accounts by deploying your own account factory contracts.
2629

@@ -32,15 +35,25 @@ thirdweb offers different kinds of prebuilt account factories:
3235

3336
<Grid>
3437
<ArticleIconCard
35-
title="Account Factory"
38+
title="Account Factory for Entrypoint v0.6"
3639
href="https://thirdweb.com/thirdweb.eth/AccountFactory"
3740
icon={WalletsSmartIcon}
3841
/>
3942
<ArticleIconCard
40-
title="Managed Account Factory"
43+
title="Managed Account Factory for Entrypoint v0.6"
4144
href="https://thirdweb.com/thirdweb.eth/ManagedAccountFactory"
4245
icon={WalletsSmartIcon}
4346
/>
47+
<ArticleIconCard
48+
title="Account Factory for Entrypoint v0.7"
49+
href="https://thirdweb.com/thirdweb.eth/AccountFactory_0_7"
50+
icon={WalletsSmartIcon}
51+
/>
52+
<ArticleIconCard
53+
title="Managed Account Factory for Entrypoint v0.7"
54+
href="https://thirdweb.com/thirdweb.eth/ManagedAccountFactory_0_7"
55+
icon={WalletsSmartIcon}
56+
/>
4457
</Grid>
4558

4659
#### Account Factories comparison

packages/thirdweb/src/wallets/smart/smart-wallet.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,40 @@ import { getDefaultAccountFactory } from "./lib/constants.js";
6969
* });
7070
* ```
7171
*
72+
* ## Using a custom account factory
73+
*
74+
* You can pass a custom account factory to the `smartWallet` function to use a your own account factory.
75+
*
76+
* ```ts
77+
* import { smartWallet } from "thirdweb/wallets";
78+
* import { sepolia } from "thirdweb/chains";
79+
*
80+
* const wallet = smartWallet({
81+
* chain: sepolia,
82+
* sponsorGas: true, // enable sponsored transactions
83+
* factoryAddress: "0x...", // custom factory address
84+
* });
85+
*
86+
* ## Using v0.7 Entrypoint
87+
*
88+
* Both v0.6 (default) and v0.7 ERC4337 Entrypoints are supported. To use the v0.7 Entrypoint, you can pass the `entrypointAddress` option to the `smartWallet` function, as well as a compatible account factory.
89+
*
90+
* You can use the predeployed `DEFAULT_ACCOUNT_FACTORY_V0_7` or deploy your own [AccountFactory v0.7](https://thirdweb.com/thirdweb.eth/AccountFactory_0_7).
91+
*
92+
* ```ts
93+
* import { smartWallet, DEFAULT_ACCOUNT_FACTORY_V0_7, ENTRYPOINT_ADDRESS_v0_7 } from "thirdweb/wallets/smart";
94+
* import { sepolia } from "thirdweb/chains";
95+
*
96+
* const wallet = smartWallet({
97+
* chain: sepolia,
98+
* sponsorGas: true, // enable sponsored transactions
99+
* factoryAddress: DEFAULT_ACCOUNT_FACTORY_V0_7,
100+
* overrides: {
101+
* entrypointAddress: ENTRYPOINT_ADDRESS_v0_7
102+
* }
103+
* });
104+
* ```
105+
*
72106
* ## Configuring the smart wallet
73107
*
74108
* You can pass options to the `smartWallet` function to configure the smart wallet.

0 commit comments

Comments
 (0)