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