BaseAccountFactory
import "@thirdweb-dev/contracts/smart-wallet/utils/BaseAccountFactory.sol";
The BaseAccountFactory
smart contract is an extension usable with the Dynamic, Managed and Non-Upgradable Account smart contracts.
When creating your Smart Wallet account factory contract, inherit from this extension to include all of the base logic to create your factory.
This smart contract extension conforms to the IAccountFactory
interface which is detectable on the dashboard as the SmartWalletFactory
extension.
Usage
The BaseAccountFactory
extension is an abstract contract, and expects you to implement the following functions by yourself:
Name | Type | Description |
---|---|---|
_initializeAccount | internal virtual | Called in createAccount . Initializes the account contract created in createAccount . |
This is an example factory smart contract demonstrating how to inherit from this extension and override the functions to add (optional) custom functionality.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@thirdweb-dev/contracts/smart-wallet/utils/BaseAccountFactory.sol";
contract MyAccountFactory is BaseAccountFactory { ... }
SDK Usage
This extension unlocks the use of the smart wallet in the wallet SDK.