./contracts/
├── ECDSAVerificator.sol
└── PaymentsSolDec082022.sol
This project was built on top of Paul Berg's awesome hardhat template.
- Hardhat: compile, run and test smart contracts
- TypeChain: generate TypeScript bindings for smart contracts
- Ethers: renowned Ethereum library and wallet implementation
- Solhint: code linter
- Solcover: code coverage
- Prettier Plugin Solidity: code formatter
NOTE: There are sensible default configurations in the following files:
├── .commitlintrc.yml
├── .editorconfig
├── .eslintignore
├── .eslintrc.yml
├── .gitignore
├── .prettierignore
├── .prettierrc.yml
├── .solcover.js
├── .solhintignore
├── .solhint.json
├── .yarnrc.yml
└── hardhat.config.ts
Contracts | Libraries | Interfaces | Abstract |
---|---|---|---|
1 | 1 | 0 | 0 |
Public | Payable | External |
---|---|---|
10 | 2 | 7 |
Internal | Private | Pure | View |
---|---|---|---|
12 | 3 | 4 | 4 |
Total | Public |
---|---|
13 | 0 |
>=0.8.0 <0.9.0
; >=0.7.0 <0.9.0
.
- Able to receive funds
- Uses EVM Assembly calls
- Contains hash functions
- Able to transfer ETH
- Uses ECRecover
- Contains call failure handling (try/catch)
- Able to create new contracts (Create/Create2)
- Uses unchecked arithmetics
- Contains suicidal/destroyable contracts
- Contains low-level calls
- Contains delegatecalls
NOTE: In-depth per-method analysis can be found in docs.
You can automate all steps (setting your configs, installing the project, compiling with type generation, running unit tests on Mainnet fork) by running this script and properly filling in the prompted fields:
$ ./init.sh
Or do it all manually:
- Before installing, create a
.env
file and set a BIP-39 compatible mnemonic and other env criteria as in.env.example
.- Then, proceed with installing dependencies:
$ yarn install
Compile the smart contracts with Hardhat:
$ yarn compile
NOTE: TypeChain artifacts generated at compile time.
Deploy the contracts to a specified network:
$ yarn deploy
--daily-withdrawal-limit "{INSERT_VAL}"
--public-key "{INSERT_VAL}"
--network {INSERT_NETWORK_NAME}
Run the tests with Hardhat:
- Don't forget to add an Alchemy API Key to your
.env
in order to be able to run unit tests against an Ethereum Mainnet fork.
$ yarn test
NOTE: See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true yarn test
Generate the code coverage report:
$ yarn coverage
NOTE: To view the coverage report generated by
yarn coverage
, just click Go Live
from the status bar to
turn the server on/off.
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ yarn clean