smartWallet
Creates a ERC4337 smart wallet based on a admin account.
Smart wallets are smart contract wallets that enable multiple benefits for users:
Sponsor gas fees for transactions
Multiple owners
Session keys
Batch transactions
Predictable addresses
Programmable features
Learn more about account abstraction
To connect to a smart wallet, you need to provide an admin account as the personalAccount
option.
Any wallet can be used as an admin account, including an in-app wallets.
The sponsorGas
option is used to enable sponsored gas for transactions automatically.
You can pass a custom account factory to the smartWallet
function to use a your own account factory.
Both v0.6 (default) and v0.7 ERC4337 Entrypoints are supported. To use the v0.7 Entrypoint, simply pass in a compatible account factory.
You can use the predeployed DEFAULT_ACCOUNT_FACTORY_V0_7
or deploy your own AccountFactory v0.7 .
You can pass options to the smartWallet
function to configure the smart wallet.
Refer to SmartWalletOptions for more details.