{"id":20293543,"url":"https://github.com/mingderwang/hardhat-ts-plugin-test","last_synced_at":"2026-05-09T11:46:47.872Z","repository":{"id":66841173,"uuid":"589079079","full_name":"mingderwang/hardhat-ts-plugin-test","owner":"mingderwang","description":"hardhat-ts-plugin-test","archived":false,"fork":false,"pushed_at":"2023-01-16T08:21:43.000Z","size":1142,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-14T09:28:26.517Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mingderwang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-01-15T01:17:38.000Z","updated_at":"2023-03-03T22:38:18.000Z","dependencies_parsed_at":"2023-02-21T09:46:15.345Z","dependency_job_id":null,"html_url":"https://github.com/mingderwang/hardhat-ts-plugin-test","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"ahmedali8/hardhat-ts-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingderwang%2Fhardhat-ts-plugin-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingderwang%2Fhardhat-ts-plugin-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingderwang%2Fhardhat-ts-plugin-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingderwang%2Fhardhat-ts-plugin-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mingderwang","download_url":"https://codeload.github.com/mingderwang/hardhat-ts-plugin-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241788554,"owners_count":20020287,"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":[],"created_at":"2024-11-14T15:24:53.261Z","updated_at":"2026-05-09T11:46:47.814Z","avatar_url":"https://github.com/mingderwang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hardhat Template (TypeScript) [![Open in Gitpod][gitpod-badge]][gitpod] [![Github Actions][gha-badge]][gha] [![Hardhat][hardhat-badge]][hardhat]\n\n[gitpod]: https://gitpod.io/#https://github.com/ahmedali8/hardhat-ts-template\n[gitpod-badge]: https://img.shields.io/badge/Gitpod-Open%20in%20Gitpod-FFB45B?logo=gitpod\n[gha]: https://github.com/ahmedali8/hardhat-ts-template/actions\n[gha-badge]: https://github.com/ahmedali8/hardhat-ts-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\nA Hardhat-based template for developing Solidity smart contracts, with sensible defaults.\n\n#### Inspiration - [Hardhat Template](https://github.com/paulrberg/hardhat-template)\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\n  contracts\n- [Ethers](https://github.com/ethers-io/ethers.js/): renowned Ethereum library and wallet\n  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\n  formatter\n\n## Getting Started\n\nClick the [`Use this template`](https://github.com/ahmedali8/hardhat-ts-template/generate) button at\nthe top of the page to create 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\nspecific features, please consult their respective documentations.\n\nFor example, for Hardhat, you can refer to the [Hardhat Tutorial](https://hardhat.org/tutorial) and\nthe [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├── .commitlintrc.yml\n├── .editorconfig\n├── .eslintignore\n├── .eslintrc.yml\n├── .gitignore\n├── .prettierignore\n├── .prettierrc.yml\n├── .solcover.js\n├── .solhintignore\n├── .solhint.json\n├── .yarnrc.yml\n└── hardhat.config.ts\n```\n\n### GitHub Actions\n\nThis template comes with GitHub Actions pre-configured. Your contracts will be linted and tested on\nevery push and pull request made to the `main` branch.\n\nNote though that by default it injects `.env.example` env variables into github action's\n`$GITHUB_ENV`.\n\nYou can edit the CI script in [.github/workflows/ci.yml](./.github/workflows/ci.yml).\n\n### Conventional Commits\n\nThis template enforces the [Conventional Commits](https://www.conventionalcommits.org/) standard for\ngit commit messages. This is a lightweight convention that creates an explicit commit history, which\nmakes it easier to write automated tools on top of.\n\n### Git Hooks\n\nThis template uses [Husky](https://github.com/typicode/husky) to run automated checks on commit\nmessages, and [Lint Staged](https://github.com/okonet/lint-staged) to automatically format the code\nwith Prettier when making a git commit.\n\n## Usage\n\n### Pre Requisites\n\nBefore running any command, you need to create a `.env` file and set all necessary environment\nvariables. Follow the example in `.env.example`. You can either use mnemonic or individual private\nkeys by setting\n\n```sh\n$ ACCOUNT_TYPE=\"MNEMONIC\" (Default)\nor\n$ ACCOUNT_TYPE=\"PRIVATE_KEYS\"\n```\n\nIf you don't already have a mnemonic, use this [mnemonic-website](https://iancoleman.io/bip39/) to\ngenerate one Or if you don't already have a private key, use this\n[privatekey-website](https://vanity-eth.tk/) to generate one.\n\nThen, proceed with installing dependencies:\n\n```sh\n$ yarn install\n```\n\n### Run a Hardhat chain\n\nTo run a local network with all your contracts in it, run the following:\n\n```\n$ yarn chain\n```\n\n### Compile\n\nCompile the smart contracts with Hardhat:\n\n```sh\n$ yarn compile\n```\n\n### TypeChain\n\nCompile the smart contracts and generate TypeChain bindings:\n\n```sh\n$ yarn typechain\n```\n\n### Test\n\nRun the tests with Hardhat:\n\n```sh\n$ yarn test\n\nor\n\n$ yarn test:gas         # shows gas report and contract size\n\nor\n\n$ yarn test:trace       # shows logs + calls\n\nor\n\n$ yarn test:fulltrace   # shows logs + calls + sloads + sstores\n```\n\nOptional:\n\n- See the actual fiat currency rates by setting your coingecko api key from\n  [here](https://coinmarketcap.com/api/pricing/) in `.env` file or command.\n\n- Set custom gas price (gwei) in `.env` file or command or let it automatically fetched by\n  ethgasstationapi.\n\n```sh\n$ GAS_PRICE=20\n$ COIN_MARKET_CAP_API_KEY=\"your_api_key\"\n```\n\n### Lint Solidity\n\nLint the Solidity code:\n\n```sh\n$ yarn lint:sol\n```\n\n### Lint TypeScript\n\nLint the TypeScript code:\n\n```sh\n$ yarn lint:ts\n```\n\n### Forking mainnet\n\nStarts a local hardhat chain with the state of the last `mainnet` block\n\n```\n$ yarn fork\n```\n\n### Coverage\n\nGenerate the code coverage report:\n\n```sh\n$ yarn coverage\n```\n\n### Clean\n\nDelete the smart contract artifacts, the coverage reports and the Hardhat cache:\n\n```sh\n$ yarn clean\n```\n\n### Deploy\n\nDeploy the contracts to Hardhat Network:\n\n```sh\n$ yarn deploy\n```\n\nDeploy the contracts to a specific network, such as the Rinkeby testnet:\n\n```sh\n$ yarn deploy:network rinkeby\n```\n\nFor more information on deploy check out repo\n[hardhat-deploy](https://github.com/wighawag/hardhat-deploy)\n\n### Generate Natspec Doc\n\nGenerate natspec documentation for your contracts by running\n\n```\n$ yarn hardhat dodoc\n```\n\nFor more information on Natspec\n[click here](https://docs.soliditylang.org/en/v0.8.12/natspec-format.html#natspec) and for dodoc\nrepo [click here](https://github.com/primitivefinance/primitive-dodoc)\n\n### View Contracts Size\n\n```\n$ yarn hardhat size-contracts\n```\n\nor turn on for every compile\n\n```\n$ CONTRACT_SIZER=true\n```\n\n## Verify Contract\n\n### Manual Verify\n\n```sh\n$ yarn hardhat verify --network \u003cnetwork\u003e DEPLOYED_CONTRACT_ADDRESS \"Constructor argument 1\" \"Constructor argument 2\"\n```\n\nFor complex arguments you can refer\n[here](https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html)\n\n```sh\n$ yarn hardhat verify --contract contracts/CONTRACT_NAME.sol:CONTRACT_NAME --network \u003cnetwork\u003e --constructor-args arguments.js DEPLOYED_CONTRACT_ADDRESS\n```\n\n### Verify Contract Programmatically\n\nVerify the contract using `verifyContract` function in [verify.ts](./utils/verify.ts)\n\nSet block explorer api key in `.env` file or using command, refer to `.env.example` for more\ninsight.\n\nExample deploy script with `verifyContract` function is\n[00_deploy_lock_contract.ts](./deploy/00_deploy_lock_contract.ts)\n\n## Syntax Highlighting\n\nIf you use VSCode, you can enjoy syntax highlighting for your Solidity code via the\n[vscode-solidity](https://github.com/juanfranblanco/vscode-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 `yarn coverage`, just click `Go Live` from the status bar\nto turn the server on/off.\n\n## Contributing\n\nContributions are always welcome! Open a PR or an issue!\n\n## Thank You!\n\n## Resources\n\n- [Hardhat Documentation](https://hardhat.org/getting-started/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingderwang%2Fhardhat-ts-plugin-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingderwang%2Fhardhat-ts-plugin-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingderwang%2Fhardhat-ts-plugin-test/lists"}