Skip to content

A preconfigured project template for Ethereum smart contracts (Hardhat)

License

Notifications You must be signed in to change notification settings

CoinbaseStablecoin/contract-template-hardhat

Repository files navigation

contract-template-hardhat

A pre-configured starter template for smart contracts using HardHat, and TypeScript.

If you want to use Truffle instead, check out this template.

Setup

Requirements:

  • Node >= v12
  • Yarn
$ npm i -g yarn       # Install yarn if you don't already have it
$ yarn install        # Install dependencies
$ yarn setup          # Setup Git hooks

Linting and Formatting

To check code for problems:

$ yarn typecheck      # Type-check TypeScript code
$ yarn lint           # Check JavaScript and TypeScript code
$ yarn lint --fix     # Fix problems where possible
$ yarn solhint        # Check Solidity code

To auto-format code:

$ yarn fmt

TypeScript type definition files for the contracts

To generate type definitions:

$ yarn compile && yarn typechain

Testing

First, make sure Ganache is running.

$ yarn ganache

Run all tests:

$ yarn test

To run tests in a specific file, run:

$ yarn test [path/to/file]

To run tests and generate test coverage, run:

$ yarn coverage

MIT License

About

A preconfigured project template for Ethereum smart contracts (Hardhat)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published