Smart Wallets are a core component of the Ava Protocol ecosystem that facilitate on-chain interactions for automated workflows.
Smart Wallets are a core component of the Ava Protocol ecosystem that facilitate on-chain interactions for automated workflows. These deterministic contract wallet addresses are generated based on a factory contract address and a salt value, enabling workflows to execute blockchain transactions in a secure and predictable manner.
For information about how to create workflows that use smart wallets, see Workflow System and Nodes.
Smart Wallets in the Ava SDK are deterministically derived contract addresses that act as on-chain identities for your workflows. They are counterfactual in nature, meaning their addresses can be computed before deployment.
Smart wallets are computed using a factory contract address and a salt value. The factory follows the ERC-4337 account abstraction standard to facilitate deterministic address generation.
Sources:
A Smart Wallet contains several key properties that provide information about the wallet and its associated workflows.
| Property | Type | Description |
|---|---|---|
| address | string | The derived Ethereum address of the smart wallet |
| factory | string | The factory contract address used to derive the wallet |
| salt | string | The unique salt value used in address derivation |
| totalTaskCount | number | Total workflows created with this wallet |
| activeTaskCount | number | Currently active workflows |
| completedTaskCount | number | Successfully completed workflows |
| canceledTaskCount | number | Canceled workflows |
| failedTaskCount | number | Failed workflows |
Smart wallets maintain counters for different workflow states, providing an easy way to track activity across all workflows associated with a particular wallet.
Sources:
The client interface provides methods to create and retrieve smart wallets. The address is derived deterministically, which means the same salt and factory address will always produce the same wallet address.
To retrieve a smart wallet, you need to provide a salt value and have a factory address configured either in the client or passed as an option.
Sources:
To retrieve a smart wallet, you first need to initialize a client with the appropriate configuration and then call the getWallet method:
getWallet with a salt valueThe salt value can be any string, including numeric values or timestamps. The same salt and factory address will always produce the same wallet address.
Sources:
Smart wallets serve as the on-chain identity for workflows. When creating a workflow, you specify the smart wallet address that will be used to execute the workflow's on-chain actions.
When a workflow is submitted, the smart wallet's task counters are updated to reflect the new active task. As the workflow changes state (completed, canceled, failed), the corresponding counters are updated.
Sources:
The smart wallet keeps track of various statistics related to workflows (tasks) executed by the wallet. These statistics include:
These statistics update automatically based on workflow state changes:
Sources:
Choosing an appropriate salt value is important for managing your smart wallets:
The factory address is critical for correct wallet address derivation:
getWallet optionsSources:
If you encounter an error related to an invalid factory address, ensure:
If the wallet address is not what you expected:
Sources: