Dynamic Account
import "@thirdweb-dev/contracts/smart-wallet/dynamic/DynamicAccount.sol";
This contract inherits from the BaseAccount
contract.
App developers can issue DynamicAccount
smart wallets programmatically by deploying a DynamicAccountFactory
smart contract.
The difference between DynamicAccount
smart wallet and Account
smart wallet is that DynamicAccount
is an upgradeable smart contract written in the dynamic contract pattern.
The admin of a given DynamicAccount
smart wallet is allowed to make upgrades to their own smart wallets. This is the right wallet for developers who anticipate providing opt-in upgrades to their users’ wallets.
If you intend to issue accounts programmatically using a custom factory contract, you must do the following:
Create a new factory contract by extending the BaseAccountFactory extension.
Override the
_initializeAccount
function on the factory to create a new wallet. (reference)
Detected Extensions
Once deployed, you can use the features made available by these extensions on the SDK and dashboard:
Click on each feature to learn more about what functions are available.
Usage
Import the contract and inherit from it. This is an example contract demonstrating one way that you could override the functionality to create a token bound account.
import "@thirdweb-dev/contracts/smart-wallet/dynamic/DynamicAccount.sol";
contract DynamicTokenBoundAccount is DynamicAccount {
constructor(
IEntryPoint _entrypoint,
address _defaultExtension
)
DynamicAccount(
_entrypoint,
_defaultExtension
)
{}
}
Functions to Override
The following functions have been implemented on this contract & are available to be overridden to add custom logic: