https://github.com/ankitchiplunkar/nft_games
https://github.com/ankitchiplunkar/nft_games
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ankitchiplunkar/nft_games
- Owner: ankitchiplunkar
- License: mit
- Created: 2022-07-30T06:45:56.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-31T10:24:29.000Z (almost 3 years ago)
- Last Synced: 2023-03-11T08:33:54.516Z (about 2 years ago)
- Language: Solidity
- Size: 1.35 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Hardhat Template [![Github Actions][gha-badge]][gha] [![Hardhat][hardhat-badge]][hardhat] [![License: MIT][license-badge]][license]
[gha]: https://github.com/paulrberg/hardhat-template/actions
[gha-badge]: https://github.com/paulrberg/hardhat-template/actions/workflows/ci.yml/badge.svg
[hardhat]: https://hardhat.org/
[hardhat-badge]: https://img.shields.io/badge/Built%20with-Hardhat-FFDB1C.svg
[license]: https://opensource.org/licenses/MIT
[license-badge]: https://img.shields.io/badge/License-MIT-blue.svgA Hardhat-based template for developing Solidity smart contracts, with sensible defaults.
- [Hardhat](https://github.com/nomiclabs/hardhat): compile, run and test smart contracts
- [TypeChain](https://github.com/ethereum-ts/TypeChain): generate TypeScript bindings for smart contracts
- [Ethers](https://github.com/ethers-io/ethers.js/): renowned Ethereum library and wallet implementation
- [Solhint](https://github.com/protofire/solhint): code linter
- [Solcover](https://github.com/sc-forks/solidity-coverage): code coverage
- [Prettier Plugin Solidity](https://github.com/prettier-solidity/prettier-plugin-solidity): code formatter## Getting Started
Click the [`Use this template`](https://github.com/paulrberg/hardhat-template/generate) button at the top of the page to
create a new repository with this repo as the initial state.## Features
This template builds upon the frameworks and libraries mentioned above, so for details about their specific features, please consult their respective documentations.
For example, for Hardhat, you can refer to the [Hardhat Tutorial](https://hardhat.org/tutorial) and the [Hardhat
Docs](https://hardhat.org/docs). You might be in particular interested in reading the [Testing Contracts](https://hardhat.org/tutorial/testing-contracts) section.### Sensible Defaults
This template comes with sensible default configurations in the following files:
```text
├── .commitlintrc.yml
├── .editorconfig
├── .eslintignore
├── .eslintrc.yml
├── .gitignore
├── .prettierignore
├── .prettierrc.yml
├── .solcover.js
├── .solhintignore
├── .solhint.json
├── .yarnrc.yml
└── hardhat.config.ts
```### GitHub Actions
This template comes with GitHub Actions pre-configured. Your contracts will be linted and tested on every push and pull
request made to the `main` branch.Note though that to make this work, you must se your `INFURA_API_KEY` and your `MNEMONIC` as GitHub secrets.
You can edit the CI script in [.github/workflows/ci.yml](./.github/workflows/ci.yml).
### Conventional Commits
This template enforces the [Conventional Commits](https://www.conventionalcommits.org/) standard for git commit messages.
This is a lightweight convention that creates an explicit commit history, which makes it easier to write automated
tools on top of.### Git Hooks
This template uses [Husky](https://github.com/typicode/husky) to run automated checks on commit messages, and [Lint Staged](https://github.com/okonet/lint-staged) to automatically format the code with Prettier when making a git commit.
## Usage
### Pre Requisites
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](https://iancoleman.io/bip39/) to generate one.Then, proceed with installing dependencies:
```sh
$ yarn install
```### Compile
Compile the smart contracts with Hardhat:
```sh
$ yarn compile
```### TypeChain
Compile the smart contracts and generate TypeChain bindings:
```sh
$ yarn typechain
```### Test
Run the tests with Hardhat:
```sh
$ yarn test
```### Lint Solidity
Lint the Solidity code:
```sh
$ yarn lint:sol
```### Lint TypeScript
Lint the TypeScript code:
```sh
$ yarn lint:ts
```### Coverage
Generate the code coverage report:
```sh
$ yarn coverage
```### Report Gas
See the gas usage per unit test and average gas per method call:
```sh
$ REPORT_GAS=true yarn test
```### Clean
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
```sh
$ yarn clean
```### Deploy
Deploy the contracts to Hardhat Network:
```sh
$ yarn deploy --greeting "Bonjour, le monde!"
```## Tips
### Syntax Highlighting
If you use VSCode, you can get Solidity syntax highlighting with the [hardhat-solidity](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity) extension.
## License
[MIT](./LICENSE.md) © Paul Razvan Berg