A set of useful Smart Contracts for Ethereum
npm install @knobs/contracts[![NPM][npm-version-shield]][npm-version-url]
[![Build][build-shield]][build-url]
[![License][license-shield]][license-url]
[![Stars][github-stars-shield]][github-stars-url]
[![Twitter][twitter-shield]][twitter-url]
Hardhat + Solidity + Typescript + Solidity Coverage
Install the npm package or copy our contract interface
* npm
``sh`
npm install @knobs/contracts@latest
Import the contract or the interface you need
`solidity`
import "@knobs/contracts/[contract_name]/[contract_name].sol";
- [x] Release Merkleproof Indexed library
- [x] Release ShuffledIds library
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature'
3. Commit your Changes ()git push origin feature/AmazingFeature
4. Push to the Branch ()
5. Open a Pull Request
Distributed under the MIT License. See the LICENSE file for more information.
Your Name - @KnobsBlockchain - info@knobs.it
Project Link: https://github.com/knobs-dev/contracts
* Coffee Cup Vectors by Vecteezy
[npm-version-shield]: https://img.shields.io/npm/v/@knobs/contracts
[npm-version-url]: https://www.npmjs.com/package/@knobs/contracts
[build-shield]: https://img.shields.io/github/workflow/status/knobs-dev/contracts/Test%20and%20Publish
[build-url]: https://www.npmjs.com/package/@knobs/contracts
[github-stars-shield]: https://img.shields.io/github/stars/knobs-dev?style=social
[github-stars-url]: https://github.com/knobs-dev/contracts
[license-shield]: https://img.shields.io/github/license/knobs-dev/contracts
[license-url]: https://github.com/knobs-dev/contracts/blob/master/LICENSE
[twitter-shield]: https://img.shields.io/twitter/follow/KnobsBlockchain?style=social
[twitter-url]: https://twitter.com/KnobsBlockchain
Try running some of the following tasks:
`shell`
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
npx hardhat help
REPORT_GAS=true npx hardhat test
npx hardhat coverage
npx hardhat run scripts/deploy.ts
TS_NODE_FILES=true npx ts-node scripts/deploy.ts
npx eslint '*/.{js,ts}'
npx eslint '*/.{js,ts}' --fix
npx prettier '*/.{json,sol,md}' --check
npx prettier '*/.{json,sol,md}' --write
npx solhint 'contracts/*/.sol'
npx solhint 'contracts/*/.sol' --fix
To try out Etherscan verification, you first need to deploy a contract to an Ethereum network that's supported by Etherscan, such as Ropsten.
In this project, copy the .env.example file to a file named .env, and then edit it to fill in the details. Enter your Etherscan API key, your Ropsten node URL (eg from Alchemy), and the private key of the account which will send the deployment transaction. With a valid .env file in place, first deploy your contract:
`shell`
hardhat run --network ropsten scripts/sample-script.ts
Then, copy the deployment address and paste it in to replace DEPLOYED_CONTRACT_ADDRESS in this command:
`shell`
npx hardhat verify --network ropsten DEPLOYED_CONTRACT_ADDRESS "Hello, Hardhat!"
For faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable TS_NODE_TRANSPILE_ONLY to 1` in hardhat's environment. For more details see the documentation.