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