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