Giter Club home page Giter Club logo

contracts-erc-4337's Introduction

Getting Started

Smart contracts for ERC-4337 account and paymaster implementations.

Table of contents

Repository structure

This repository builds upon the following frameworks and libraries:

Git Clone

The account-abstraction directory in this repository uses git submodules to include eth-infinitism/account-abstraction as a workspace. Make sure to include the --recurse-submodules flag in your git clone command.

git clone --recurse-submodules https://github.com/stackup-wallet/contracts.git

Sensible Defaults

This repository comes with sensible default configurations in the following files:

├── .editorconfig
├── .eslintignore
├── .eslintrc.yml
├── .gitignore
├── .prettierignore
├── .prettierrc.yml
├── .solcover.js
├── .solhint.json
└── hardhat.config.ts

VSCode Integration

This repository is IDE agnostic, but for the best user experience, you may want to use it in VSCode alongside Nomic Foundation's Solidity extension.

GitHub Actions

All contracts will be linted and tested on every push and pull request made to the main branch.

Usage

Below are some useful commands for development.

Pre Requisites

Before being able to run any command, you need to create a .env file and set a BIP-39 compatible mnemonic as an environment variable. You can follow the example in .env.example. If you don't already have a mnemonic, you can use this website to generate one.

cp .env.example .env

Then, proceed with installing dependencies:

yarn install

Compile

Compile the smart contracts with Hardhat:

yarn run compile

TypeChain

Compile the smart contracts and generate TypeChain bindings:

yarn run typechain

Test

Run the tests with Hardhat:

yarn run test

Lint Solidity

Lint the Solidity code:

yarn run lint:sol

Lint TypeScript

Lint the TypeScript code:

yarn run lint:ts

Coverage

Generate the code coverage report:

yarn run coverage

Report Gas

See the gas usage per unit test and average gas per method call:

REPORT_GAS=true yarn run test

Clean

Delete the smart contract artifacts, the coverage reports and the Hardhat cache:

yarn run clean

Deploy

Deploy the contracts to Hardhat Network:

yarn run deploy:VerifyingPaymaster

License

Distributed under the GPL-3.0 License. See LICENSE for more information.

Contact

Feel free to direct any technical related questions to the dev-hub channel in the Stackup Discord.

contracts-erc-4337's People

Contributors

hazim-j avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.