Docs

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.


View on GitHub

Usage

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

NameTypeDescription
entryPointpublic viewReturn the current entryPoint used by this account.
_validateSignatureinternalValidate the signature is valid for this message.
_validateNonceinternalValidate 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.

Base Contracts Implementing This Extension

Full API reference