Managed Account
import "@thirdweb-dev/contracts/smart-wallet/managed/ManagedAccount.sol";
This contract inherits from the BaseAccount
contract.
Like DynamicAccount
, the ManagedAccount
smart wallet is an upgradeable smart contract written in the dynamic contract pattern.
App developers can issue ManagedAccount
smart wallets programmatically by deploying a ManagedAccountFactory
smart contract.
The admin of the ManagedAccountFactory
contract can push upgrades to all ManagedAccount
contracts that it creates. This admin does not require any permissions on the ManagedAccount
smart wallets to do so.
An upgrade to the features of ManagedAccount
applies to all ManagedAccount
smart wallets created by the factory. This is the right wallet for developers who anticipate pushing 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/managed/ManagedAccount.sol";
contract ManagedTokenBoundAccount is ManagedAccount {
constructor(
IEntryPoint _entrypoint
)
ManagedAccount(
_entrypoint
)
{}
}
Functions to Override
The following functions have been implemented on this contract & are available to be overridden to add custom logic: