Solady Smart Account
The toSoladySmartAccount
simple Smart Account Implementation that references Solady's ERC4337.sol
Smart Account contract.
Usage
example.ts
import { toSoladySmartAccount } from 'viem/account-abstraction'
import { client, owner } from './config.js'
const account = await toSoladySmartAccount({
client,
owner,
})
Returns
SmartAccount<SoladySmartAccountImplementation>
Parameters
entryPoint (optional)
- Type:
{ abi: Abi, address: Address, version: EntryPointVersion }
Compatible EntryPoint for the Smart Account to reference. The EntryPoint is used to:
- Determine the target EntryPoint address for the User Operation
- Compute User Operation hashes
- Retrieve the Smart Account nonce
- Distinguish which type of
UserOperation
structure to use
const account = await toSoladySmartAccount({
client,
entryPoint: {
abi: [/* ... */],
address: '0x0000000071727De22E5E9d8BAf0edAc6f37da032',
version: '0.7',
},
owner,
})
factoryAddress
- Type:
Address
Factory address of the Smart Account.
const account = await toSoladySmartAccount({
client,
factoryAddress: '0xda4b37208c41c4f6d1b101cac61e182fe1da0754',
owner,
})
owner
- Type:
Address | Account
Owner of the Smart Account.
const account = await toSoladySmartAccount({
client,
owner: privateKeyToAccount('0x...'),
})
salt (optional)
- Type:
Hex
Salt to use for Smart Account deployment.
const account = await toSoladySmartAccount({
client,
owner,
salt: '0x5',
})