Skip to content

Latest commit

 

History

History
137 lines (91 loc) · 2.93 KB

README.md

File metadata and controls

137 lines (91 loc) · 2.93 KB

DeFive Token and Staking Contracts

A Hardhat-based project for developing Solidity smart contracts, with sensible defaults.

Sensible Defaults

This template 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 template is IDE agnostic, but for the best user experience, you may want to use it in VSCode alongside Nomic Foundation's Solidity extension.

If you use VSCode, you can get Solidity syntax highlighting with the hardhat-solidity extension.

Usage

Pre Requisites

First, you need to install the dependencies:

bun install

Then, you need to set up all the required Hardhat Configuration Variables. You might also want to install some that are optional.

To assist with the setup process, run bunx hardhat vars setup. To set a particular value, such as a BIP-39 mnemonic variable, execute this:

bunx hardhat vars set MNEMONIC
? Enter value: ‣ here is where your twelve words mnemonic should be put my friend

If you do not already have a mnemonic, you can generate one using this website.

Compile

Compile the smart contracts with Hardhat:

bun run compile

TypeChain

Compile the smart contracts and generate TypeChain bindings:

bun run typechain

Test

Run the tests with Hardhat:

bun run test

Lint Solidity

Lint the Solidity code:

bun run lint:sol

Lint TypeScript

Lint the TypeScript code:

bun run lint:ts

Coverage

Generate the code coverage report:

bun run coverage

Report Gas

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

REPORT_GAS=true bun run test

Clean

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

bun run clean

Deploy

Deploy the contracts to Hardhat Network:

bun run deploy

## License

This project is licensed under MIT.