Skip to content

About

Standardized modular tooling EVM smart accounts following ERC-7579

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

OpenZeppelin Accounts

Standardized modular tooling and SDK for EVM smart accounts.

OpenZeppelin Accounts delivers production-ready ERC-7579 modules and a TypeScript SDK for interacting with smart accounts. Because the modules conform to the ERC-7579 standard they can be installed on any compatible account: including OpenZeppelin's AccountERC7579, Kernel, and the bundled OpenAccount.

Packages

Package Description
@openzeppelin-accounts/contracts Solidity contracts: OpenAccount, validator modules, executor modules, and multisig primitives
@openzeppelin-accounts/sdk TypeScript SDK: Viem-native account factories and ERC-7579 bundler client actions

Installation

Contracts (Hardhat / Foundry)

npm install @openzeppelin-accounts/contracts

SDK

npm install @openzeppelin-accounts/sdk viem

Overview

Contracts

The contracts package provides:

  • OpenAccount: A production-ready, ERC-4337 and ERC-7579 compliant smart account with EIP-712 signature support and NFT holder capabilities. Deployed via OpenAccountFactory at a deterministic address on all major EVM chains:
    0x9045eF209067701bE7b78AaC216C04Ffa6543330
    
  • Validators: Signature validation modules (ECDSA, WebAuthn/passkey).
  • Executors: Execution modules for spending limits, social recovery, and more.
  • Multisig: ERC-7913-based multisig and weighted multisig modules, including confidential variants.

SDK

The SDK wraps Viem's account abstraction primitives with ERC-7579-aware helpers:

  • toOpenAccount: Creates a SmartAccount instance for the OpenAccount contract, supporting both factory-based (counterfactual) and existing-address modes.
  • toERC7579Account: Creates a SmartAccount for any ERC-7579 account, accepting caller-supplied address and factory args.
  • erc7579Actions: Viem bundler client extension providing typed methods: installModules, uninstallModules, isModuleInstalled, supportsModule, supportsExecutionMode, execute, and accountId.

Quick Start

import { createPublicClient, http, getContract, encodePacked } from 'viem';
import { mainnet } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';
import { createBundlerClient } from 'viem/account-abstraction';
import { toOpenAccount, erc7579Actions } from '@openzeppelin-accounts/sdk';
import OpenAccountFactoryABI from '@openzeppelin-accounts/contracts/out/OpenAccountFactory.sol/OpenAccountFactory.json' assert { type: 'json' };

const client = createPublicClient({ chain: mainnet, transport: http() });
const signer = privateKeyToAccount('0x<privateKey>');

const factory = getContract({
  address: '0x9045eF209067701bE7b78AaC216C04Ffa6543330',
  abi: OpenAccountFactoryABI.abi,
  client,
});

// Create a smart account backed by an ECDSA validator
const account = await toOpenAccount({
  client,
  signer,
  factory,
  moduleTypeIds: ['validator'],
  modules: ['0x<ecdsaValidatorAddress>'],
  initDatas: [encodePacked(['address'], [signer.address])],
  getStubSignature: async () => '0x' + 'ff'.repeat(65),
});

// Extend a bundler client with ERC-7579 actions
const bundlerClient = createBundlerClient({
  account,
  client,
  transport: http('https://bundler.example.com'),
}).extend(erc7579Actions());

// The first user operation deploys the account automatically
const hash = await bundlerClient.execute({
  calls: [{ to: '0x<recipient>', data: '0x', value: 0n }],
});

Documentation

Full documentation is available at docs.openzeppelin.com/accounts. Its sources live in docs and are synced to the OpenZeppelin docs site on release.

Security

This project is maintained by OpenZeppelin. Smart contracts are a nascent technology and carry a high level of technical risk and uncertainty. Using this library is not a substitute for a security audit.

Audit reports are available in packages/contracts/audits, which also lists the contracts that have not been audited yet.

This project has not yet had a stable release. Please report security vulnerabilities by email to security@openzeppelin.com.

Contributing

Contributions are welcome. Please open an issue or pull request on GitHub.

License

Released under the MIT License.

About

Standardized modular tooling EVM smart accounts following ERC-7579

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages