https://github.com/zkfriendly/erc4337-template
This Porject provides a template for developing ERC4337 Smart Accounts. With an integrated bundler for testing.
https://github.com/zkfriendly/erc4337-template
Last synced: 10 months ago
JSON representation
This Porject provides a template for developing ERC4337 Smart Accounts. With an integrated bundler for testing.
- Host: GitHub
- URL: https://github.com/zkfriendly/erc4337-template
- Owner: zkfriendly
- Created: 2024-12-07T09:48:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-07T09:49:02.000Z (over 1 year ago)
- Last Synced: 2025-02-15T18:08:17.355Z (over 1 year ago)
- Language: TypeScript
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ERC4337 Smart Account Development Template
This Porject provides a template for developing ERC4337 Smart Accounts. With an integrated bundler for testing.
## ๐ Quick Start
### Prerequisites
- [Docker](https://www.docker.com/) installed and running
- [Node.js](https://nodejs.org/) and npm (or [Yarn](https://yarnpkg.com/))
### Setup
0. Setup environment variables:
```bash
cp .env.example .env
```
Edit `.env` with your desired settings.
1. Start the local blockchain node and bundler:
```bash
docker compose up --build
```
2. Open a new terminal and install contract dependencies and setup environment variables (the default values should work for most users):
```bash
cd contracts && yarn && cp .env.example .env
```
## ๐งช Testing (Optional)
Run the smart contract tests:
```bash
npx hardhat test --network dev
```
### Controlling test environment
You can control the test environment by setting the `BUNDLER` environment variable to either `unsafe` or `safe`. The default is `safe`.
- `unsafe` will use the unsafe bundler which does not enforce limitations like storage access.
- `safe` will use the safe bundler which enforces limitations like storage access.
Also the `STAKE_ACCOUNT` environment variable can be set to `true` to automatically stake ETH to the email account.
This is useful for when working with the safe bundler that only works with stakes.