Skip to content

zkemail/solidity-template

Repository files navigation

Solidity Template

Template for Solidity projects with a suite of useful tools pre-installed.

Tools used

Note: Make sure foundry and yarn are installed before proceeding

Recommended VSCode extensions

Github Actions

CI is preconfigured to:

  1. check formatting and linting
  2. build smart contracts
  3. run tests
  4. check test coverage percentage

Installing Dependencies

While Foundry typically uses Git submodules to manage dependencies, this template opts for Node.js packages for better scalability.

To install dependencies:

  1. Install an npm dependency:
yarn add dependency-name
  1. Install a GitHub dependency:
yarn add github:username/repo-name#tag-branch-or-hash
  1. Add the dependency to remappings.txt:
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
forge-std/=node_modules/forge-std/src/
dependency-name=node_modules/dependency-name

Note: OpenZeppelin Contracts is pre-installed. You can follow its example for other dependencies.

Useful commands

Build smart contracts:

yarn build

Clean build artifacts and cache :

yarn clean

Generate test coverage:

yarn coverage

Format files:

yarn fmt

Lint files:

yarn lint

Run tests:

yarn test

Inspiration

This template is inspired by the following repositories:

License

This project is licensed under MIT.

About

Template for Solidity projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published