Smart contracts for ERC-4337 account and paymaster implementations.
This repository builds upon the following frameworks and libraries:
- Hardhat: compile, run and test smart contracts
- TypeChain: generate TypeScript bindings for smart contracts
- Ethers: renowned Ethereum library and wallet implementation
- Solhint: code linter
- Solcover: code coverage
- Prettier Plugin Solidity: code formatter
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
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.
All contracts will be linted and tested on every push and pull request made to the main branch.
Below are some useful commands for development.
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 .envThen, proceed with installing dependencies:
yarn run installCompile the smart contracts with Hardhat:
yarn run compileCompile the smart contracts and generate TypeChain bindings:
yarn run typechainRun the tests with Hardhat:
yarn run testLint the Solidity code:
yarn run lint:solLint the TypeScript code:
yarn run lint:tsGenerate the code coverage report:
yarn run coverageSee the gas usage per unit test and average gas per method call:
REPORT_GAS=true yarn run testDelete the smart contract artifacts, the coverage reports and the Hardhat cache:
yarn run cleanDeploy the contracts to Hardhat Network:
yarn run deploy --greeting 'Bonjour, le monde!'Distributed under the GPL-3.0 License. See LICENSE for more information.
Feel free to direct any technical related questions to the dev-hub channel in the
Stackup Discord.
