|
3 سال پیش | |
---|---|---|
.husky | 4 سال پیش | |
.yarn | 3 سال پیش | |
contracts | 3 سال پیش | |
src | 3 سال پیش | |
tasks | 3 سال پیش | |
test | 3 سال پیش | |
.commitlintrc.yml | 3 سال پیش | |
.czrc | 4 سال پیش | |
.editorconfig | 5 سال پیش | |
.env.example | 3 سال پیش | |
.eslintignore | 3 سال پیش | |
.eslintrc.yml | 3 سال پیش | |
.gitignore | 3 سال پیش | |
.lintstagedrc | 3 سال پیش | |
.prettierignore | 3 سال پیش | |
.prettierrc.yml | 3 سال پیش | |
.solcover.js | 3 سال پیش | |
.solhint.json | 4 سال پیش | |
.solhintignore | 3 سال پیش | |
.yarnrc.yml | 3 سال پیش | |
LICENSE.md | 3 سال پیش | |
README.md | 3 سال پیش | |
hardhat.config.ts | 3 سال پیش | |
package.json | 3 سال پیش | |
tsconfig.json | 3 سال پیش | |
yarn.lock | 3 سال پیش |
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.