|
|
3 tahun lalu | |
|---|---|---|
| .github | 4 tahun lalu | |
| .husky | 4 tahun lalu | |
| .yarn | 3 tahun lalu | |
| contracts | 3 tahun lalu | |
| src | 3 tahun lalu | |
| tasks | 3 tahun lalu | |
| test | 3 tahun lalu | |
| .commitlintrc.yaml | 4 tahun lalu | |
| .czrc | 4 tahun lalu | |
| .editorconfig | 5 tahun lalu | |
| .env.example | 3 tahun lalu | |
| .eslintignore | 4 tahun lalu | |
| .eslintrc.yaml | 4 tahun lalu | |
| .gitignore | 3 tahun lalu | |
| .lintstagedrc | 4 tahun lalu | |
| .prettierignore | 4 tahun lalu | |
| .prettierrc.yaml | 3 tahun lalu | |
| .solcover.js | 4 tahun lalu | |
| .solhint.json | 4 tahun lalu | |
| .solhintignore | 4 tahun lalu | |
| .yarnrc.yml | 3 tahun lalu | |
| LICENSE.md | 3 tahun lalu | |
| README.md | 3 tahun lalu | |
| hardhat.config.ts | 3 tahun lalu | |
| package.json | 3 tahun lalu | |
| tsconfig.json | 3 tahun lalu | |
| yarn.lock | 3 tahun lalu |
My favorite setup for writing Solidity smart contracts.
This repo is a GitHub template, so to start using it, click the "Use this template" button at the top of the page.
Before running any command, you need to create a .env file and set a BIP-39 compatible mnemonic as an environment
variable. Follow the example in .env.example. If you don't already have a mnemonic, use this website to generate one.
Then, proceed with installing dependencies:
$ yarn install
Compile the smart contracts with Hardhat:
$ yarn compile
Compile the smart contracts and generate TypeChain artifacts:
$ yarn typechain
Lint the Solidity code:
$ yarn lint:sol
Lint the TypeScript code:
$ yarn lint:ts
Run the Mocha tests:
$ yarn test
Generate the code coverage report:
$ yarn coverage
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true yarn test
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ yarn clean
Deploy the contracts to Hardhat Network:
$ yarn deploy --greeting "Bonjour, le monde!"
If you use VSCode, you can get Solidity syntax highlighting via the vscode-solidity extension.
If you can't get the Waffle matchers to work, try to
make your ethers package version match the version used by the @ethereum-waffle/chai package. Seem
#111 for more details.