Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Latest commit

 

History

History

plugins

Plugins

Experimental plugins, modules, components for use with ERC-4337 (v0.7.0) compatible smart contract accounts. Most are currently built on top of Safe. These plugins are in a pre-alpha state and are not ready for production use. They are intended for experimentation.

This package is a hybrid Foundry & Hardhat project. Foundry is used for unit & integration testing, with Hardhat for end-to-end testing & examples of using a plugin in JavaScript/TypeScript runtime.

When you should use this package

  • If you are building a ERC-4337 plugin, module, or component and want end-to-end tooling & testing harnesses to make sure your it is compatible within the ERC-4337/Ethereum AA ecosystem. These can include but are not limited to:
    • Validation
    • Account Recovery
    • Paymasters
  • If you are building a module for an ERC-4437 Safe.
  • If you are interested in experimenting with calldata compression. See also the compression package.
  • If you have an interesting idea to integrate a novel cryptographic primitive or zero knowledge proof into the Ethereum AA ecosystem and want a place to start.

When you shouldn't use this package

If you are developing a plugin/module for use with an ERC-4337 module spec, such as:

Getting Started

  1. cd packages/plugins
  2. Run yarn submodules to initialize git submodules
  3. Run yarn to install hardhat dependencies
  4. Run forge install to install foundry dependencies
  5. Run cp .env.example .env to create an .env file with the values from .env.example

Build & generate Typechain definitions

yarn build

Forge tests

forge test --no-match-path test/unit/safe/SafeZkEmailRecoveryPlugin.t.sol -vvv

Hardhat tests

To run the hardhat tests, you'll need to run a geth node & bundler as some of them are integration tests:

  1. Start a geth node, fund accounts, deploy Safe contracts, and start a bundler:
# Note: This uses geth. There is also start-hardhat.sh for using hardhat. See
# docs inside each script for more information.
./script/start.sh
  1. Run the plugin tests:
yarn hardhat test

Things to keep in mind