Docs

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.


View on GitHub

Usage

The BaseAccountFactory extension is an abstract contract, and expects you to implement the following functions by yourself:

NameTypeDescription
_initializeAccountinternal virtualCalled 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.

Base Contracts Implementing This Extension

Full API reference