BaseAccount
import "@thirdweb-dev/contracts/smart-wallet/utils/BaseAccount.sol";
The BaseAccount
smart contract is an extension that is intended to be used when creating your own smart account contract
which does not use one of our ready-to-use base-contract account smart contracts.
It is abstract, allowing you to customize the functionality for your use case.
This smart contract extension conforms to the IAccount
interface which is detectable on the dashboard as the SmartWallet
extension.
Usage
The BaseAccount
extension is an abstract contract, and expects you to implement the following functions by yourself:
Name | Type | Description |
---|---|---|
entryPoint | public view | Return the current entryPoint used by this account. |
_validateSignature | internal | Validate the signature is valid for this message. |
_validateNonce | internal | Validate the nonce of the UserOperation. |
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.