This project provides a reusable library for implementing ERC-4337 compliant smart contract wallets. It is primarily designed to be used as a library within the metacontract (mc) framework, allowing developers to easily integrate account abstraction features into their projects.
The library includes:
- Basic ERC-4337 implementation (
ERC4337Base.sol
) - Storage schema for ERC-4337 wallets (
Schema.sol
) - Storage access utilities (
Storage.sol
) - An example implementation of a simple smart wallet (
MySmartWallet.sol
)
To use this library in your metacontract project:
- Install the library using Forge:
forge install ecdysisxyz/erc4337
- Import the necessary contracts in your Solidity files:
import { ERC4337Base } from "ecdysisxyz/erc4337/src/main/functions/ERC4337Base.sol"; import { Schema as ERC4337Schema } from "ecdysisxyz/erc4337/src/main/storage/Schema.sol"; import { Storage as ERC4337Storage } from "ecdysisxyz/erc4337/src/main/storage/Storage.sol";
- Extend the
ERC4337Base
contract and implement your custom logic.
See examples/MySmartWallet.sol
for a basic implementation of an ERC-4337 compliant smart wallet using this library.
- ERC-4337 compliant implementation
- Modular and extensible design
- Compatible with the metacontract (mc) framework
- Basic owner management and arbitrary transaction execution
Please note that this project is currently in beta and under active development. While we strive for high-quality code, the implementation has not yet undergone a formal audit. Use caution when integrating this library into production systems.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Welcome to the Meta Contract Template! This template is your fast track to smart contract development, offering a pre-configured setup with the Meta Contract framework and essential tools like the ERC-7201 Storage Location Calculator. It's designed for developers looking to leverage advanced features and best practices right from the start.
Ensure you have Foundry installed, then initialize your project with:
$ forge init <Your Project Name> -t metacontract/template
This command sets up your environment with all the benefits of the meta contract framework, streamlining your development process.
- Pre-integrated with meta contract for optimal smart contract development with highly flexible upgradeability & maintainability.
- Includes ERC-7201 Storage Location Calculator for calculating storage locations based on ERC-7201 names for enhanced efficiency.
- Ready-to-use project structure for immediate development start.
For detailed documentation and further guidance, visit Meta Contract Book.
Start building your decentralized applications with meta contract today and enjoy a seamless development experience!