{"id":13712660,"url":"https://github.com/paulrberg/hardhat-template","last_synced_at":"2025-05-14T04:07:30.611Z","repository":{"id":38533960,"uuid":"277660991","full_name":"PaulRBerg/hardhat-template","owner":"PaulRBerg","description":"Hardhat-based template for developing Solidity smart contracts","archived":false,"fork":false,"pushed_at":"2025-03-25T13:13:25.000Z","size":8970,"stargazers_count":1976,"open_issues_count":2,"forks_count":564,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-04-11T14:17:15.381Z","etag":null,"topics":["blockchain","ethereum","ethers","hardhat","smart-contracts","solidity","template","typechain","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaulRBerg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://3cities.xyz/#/pay?c=CAESFAKY9DMuOFdjE4Wzl2YyUFipPiSfIgICATICCAJaFURvbmF0aW9uIHRvIFBhdWwgQmVyZw","github":"PaulRBerg"}},"created_at":"2020-07-06T22:23:42.000Z","updated_at":"2025-04-09T10:10:17.000Z","dependencies_parsed_at":"2023-12-31T10:23:31.990Z","dependency_job_id":"d154ae7e-2af5-4859-9860-e1366f39fa47","html_url":"https://github.com/PaulRBerg/hardhat-template","commit_stats":{"total_commits":289,"total_committers":24,"mean_commits":"12.041666666666666","dds":0.3044982698961938,"last_synced_commit":"00bcdf8b63a827a801c2f7a6b829524d5723d41d"},"previous_names":["paulrberg/solidity-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulRBerg%2Fhardhat-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulRBerg%2Fhardhat-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulRBerg%2Fhardhat-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulRBerg%2Fhardhat-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaulRBerg","download_url":"https://codeload.github.com/PaulRBerg/hardhat-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069489,"owners_count":22009557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","ethereum","ethers","hardhat","smart-contracts","solidity","template","typechain","typescript"],"created_at":"2024-08-02T23:01:21.067Z","updated_at":"2025-05-14T04:07:30.591Z","avatar_url":"https://github.com/PaulRBerg.png","language":"TypeScript","funding_links":["https://3cities.xyz/#/pay?c=CAESFAKY9DMuOFdjE4Wzl2YyUFipPiSfIgICATICCAJaFURvbmF0aW9uIHRvIFBhdWwgQmVyZw","https://github.com/sponsors/PaulRBerg"],"categories":["Project Starter","dApps directory"],"sub_categories":["Smart Contract Tools"],"readme":"# Hardhat Template [![Open in Gitpod][gitpod-badge]][gitpod] [![Github Actions][gha-badge]][gha] [![Hardhat][hardhat-badge]][hardhat] [![License: MIT][license-badge]][license]\n\n[gitpod]: https://gitpod.io/#https://github.com/paulrberg/hardhat-template\n[gitpod-badge]: https://img.shields.io/badge/Gitpod-Open%20in%20Gitpod-FFB45B?logo=gitpod\n[gha]: https://github.com/paulrberg/hardhat-template/actions\n[gha-badge]: https://github.com/paulrberg/hardhat-template/actions/workflows/ci.yml/badge.svg\n[hardhat]: https://hardhat.org/\n[hardhat-badge]: https://img.shields.io/badge/Built%20with-Hardhat-FFDB1C.svg\n[license]: https://opensource.org/licenses/MIT\n[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg\n\nA Hardhat-based template for developing Solidity smart contracts, with sensible defaults.\n\n- [Hardhat](https://github.com/nomiclabs/hardhat): compile, run and test smart contracts\n- [TypeChain](https://github.com/ethereum-ts/TypeChain): generate TypeScript bindings for smart contracts\n- [Ethers](https://github.com/ethers-io/ethers.js/): renowned Ethereum library and wallet implementation\n- [Solhint](https://github.com/protofire/solhint): code linter\n- [Solcover](https://github.com/sc-forks/solidity-coverage): code coverage\n- [Prettier Plugin Solidity](https://github.com/prettier-solidity/prettier-plugin-solidity): code formatter\n\n## Getting Started\n\nClick the [`Use this template`](https://github.com/paulrberg/hardhat-template/generate) button at the top of the page to\ncreate a new repository with this repo as the initial state.\n\n## Features\n\nThis template builds upon the frameworks and libraries mentioned above, so for details about their specific features,\nplease consult their respective documentations.\n\nFor example, for Hardhat, you can refer to the [Hardhat Tutorial](https://hardhat.org/tutorial) and the\n[Hardhat Docs](https://hardhat.org/docs). You might be in particular interested in reading the\n[Testing Contracts](https://hardhat.org/tutorial/testing-contracts) section.\n\n### Sensible Defaults\n\nThis template comes with sensible default configurations in the following files:\n\n```text\n├── .editorconfig\n├── .eslintignore\n├── .eslintrc.yml\n├── .gitignore\n├── .prettierignore\n├── .prettierrc.yml\n├── .solcover.js\n├── .solhint.json\n└── hardhat.config.ts\n```\n\n### VSCode Integration\n\nThis template is IDE agnostic, but for the best user experience, you may want to use it in VSCode alongside Nomic\nFoundation's [Solidity extension](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity).\n\n### GitHub Actions\n\nThis template comes with GitHub Actions pre-configured. Your contracts will be linted and tested on every push and pull\nrequest made to the `main` branch.\n\nNote though that to make this work, you must use your `INFURA_API_KEY` and your `MNEMONIC` as GitHub secrets.\n\nFor more information on how to set up GitHub secrets, check out the\n[docs](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).\n\nYou can edit the CI script in [.github/workflows/ci.yml](./.github/workflows/ci.yml).\n\n## Usage\n\n### Pre Requisites\n\nFirst, you need to install the dependencies:\n\n```sh\nbun install\n```\n\nThen, you need to set up all the required\n[Hardhat Configuration Variables](https://hardhat.org/hardhat-runner/docs/guides/configuration-variables). You might\nalso want to install some that are optional.\n\nTo assist with the setup process, run `bunx hardhat vars setup`. To set a particular value, such as a BIP-39 mnemonic\nvariable, execute this:\n\n```sh\nbunx hardhat vars set MNEMONIC\n? Enter value: ‣ here is where your twelve words mnemonic should be put my friend\n```\n\nIf you do not already have a mnemonic, you can generate one using this [website](https://iancoleman.io/bip39/).\n\n### Compile\n\nCompile the smart contracts with Hardhat:\n\n```sh\nbun run compile\n```\n\n### TypeChain\n\nCompile the smart contracts and generate TypeChain bindings:\n\n```sh\nbun run typechain\n```\n\n### Test\n\nRun the tests with Hardhat:\n\n```sh\nbun run test\n```\n\n### Lint Solidity\n\nLint the Solidity code:\n\n```sh\nbun run lint:sol\n```\n\n### Lint TypeScript\n\nLint the TypeScript code:\n\n```sh\nbun run lint:ts\n```\n\n### Coverage\n\nGenerate the code coverage report:\n\n```sh\nbun run coverage\n```\n\n### Report Gas\n\nSee the gas usage per unit test and average gas per method call:\n\n```sh\nREPORT_GAS=true bun run test\n```\n\n### Clean\n\nDelete the smart contract artifacts, the coverage reports and the Hardhat cache:\n\n```sh\nbun run clean\n```\n\n### Deploy\n\nDeploy the contracts to Hardhat Network:\n\n```sh\nbun run deploy:contracts\n```\n\n### Tasks\n\n#### Deploy Lock\n\nDeploy a new instance of the Lock contract via a task:\n\n```sh\nbun run task:deployLock --unlock 100 --value 0.1\n```\n\n### Syntax Highlighting\n\nIf you use VSCode, you can get Solidity syntax highlighting with the\n[hardhat-solidity](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity) extension.\n\n## Using GitPod\n\n[GitPod](https://www.gitpod.io/) is an open-source developer platform for remote development.\n\nTo view the coverage report generated by `bun run coverage`, just click `Go Live` from the status bar to turn the server\non/off.\n\n## Local development with Ganache\n\n### Install Ganache\n\n```sh\nnpm i -g ganache\n```\n\n### Run a Development Blockchain\n\n```sh\nganache -s test\n```\n\n\u003e The `-s test` passes a seed to the local chain and makes it deterministic\n\nMake sure to set the mnemonic in your `.env` file to that of the instance running with Ganache.\n\n## License\n\nThis project is licensed under MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulrberg%2Fhardhat-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulrberg%2Fhardhat-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulrberg%2Fhardhat-template/lists"}