Giter Club home page Giter Club logo

solidity-foundry-boilerplate's Introduction

wonderland banner


Start your next Solidity project with Foundry in seconds
A highly scalable foundation focused on DX and best practices

Features

Sample contracts
Basic Greeter contract with an external interface.
Foundry setup
Foundry configuration with multiple custom profiles and remappings.
Deployment scripts
Sample scripts to deploy contracts on both mainnet and testnet.
Sample e2e & unit tests
Example tests showcasing mocking, assertions and configuration for mainnet forking. As well it includes everything needed in order to check code coverage.
Linter
Simple and fast solidity linting thanks to forge fmt.
Github workflows CI
Run all tests and see the coverage as you push your changes.

Setup

  1. Install Foundry by following the instructions from their repository.
  2. Copy the .env.example file to .env and fill in the variables.
  3. Install the dependencies by running: yarn install. In case there is an error with the commands, run foundryup and try them again.

Build

The default way to build the code is suboptimal but fast, you can run it via:

yarn build

In order to build a more optimized code (via IR), run:

yarn build:optimized

Running tests

Unit tests should be isolated from any externalities, while E2E usually run in a fork of the blockchain. In this boilerplate you will find example of both.

In order to run both unit and E2E tests, run:

yarn test

In order to just run unit tests, run:

yarn test:unit

In order to run unit tests and run way more fuzzing than usual (5x), run:

yarn test:unit:deep

In order to just run e2e tests, run:

yarn test:e2e

In order to check your current code coverage, run:

yarn coverage

Deploy & verify

Setup

Configure the .env variables.

Goerli

yarn deploy:goerli

Mainnet

yarn deploy:mainnet

The deployments are stored in ./broadcast

See the Foundry Book for available options.

solidity-foundry-boilerplate's People

Contributors

gas1cent avatar 0xgorilla avatar eugenioclrc avatar drgorillamd avatar 0xdiscotech avatar 0xraccoon avatar turtlemoji avatar wei3erhase 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.