[TOC]
This part describe the list of libraries present in the file package.json
.
This section concerns the packages installed in the section devDependencies
of package.json
Chai Library used for the tests
Coveralls It is used to perform a code coverage
Hardhat plugin for integration with TruffleContract from Truffle 5. This allows tests and scripts written for Truffle to work with Hardhat.
This plugin integrates Web3.js 1.x
into Hardhat.
Hardhat plugin for integration with ethers.js
Output Solidity contract sizes with Hardhat.
eth-gas-reporter plugin for hardhat.
This package adds functions to your Hardhat scripts so you can deploy and upgrade proxies for your contracts
Assertion library for Ethereum smart contract testing
eslint JavaScript static analyzer, and the following plugins:
-
eslint-config-standard Shareable configs designed to work with the extends feature of .eslintrc files.
-
eslint-plugin-import Plugin to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.
-
eslint-plugin-node Additional ESLint's rules for Node.js
-
eslint-plugin-promise Enforcement best practices for JavaScript promises.
Ethlint Solidity static analyzer.
ethereumjs-util Collection of utility functions for Ethereum (account, address, signature, etc.).
ethjs-abi Encode and decode method and event from the smart contract ABI. Warning: marked as experimental package on 22.08.2022.
A Mocha reporter for Ethereum test suites (Truffle)
Eth-Sig-Util A collection of Ethereum signing functions.
Warning :
- Deprecated in favor of : @metamask/eth-sig-util
- It was not possible to use the new version of the library because the test "MetaTxModule.test.js" doesn't work with this one. The check of the signature fails.
A wrapper for the keccak
library to compute 256 bit keccak hash in JavaScript.
Use by openzeppelin-contracts-upgradeable/test/helpers/eip712
imported in `MetaTxModuleCommon.js
solc JavaScript bindings for the Solidity compiler.
Generate UML for smart contracts
Code coverage for Solidity smart-contracts
Program that extracts documentation for a Solidity project.
Utility tool for smart contract systems.
dotenv Loads environment variables from a .env file
This section concerns the packages installed in the section dependencies
of package.json
OpenZeppelin Contracts Upgradeable Upgradeable variant of OpenZeppelin Contracts, meant for use in upgradeable contracts. The version of the library used is available in the file USAGE.md
Warning:
- Submodules are not automatically updated when the host repository is updated.
- Only update the module to a specific version, not an intermediary commit.
Generate UML for smart contracts
You can generate UML for smart contracts by running the following command:
npm run-script uml
Warning:
From the version v2.3.0, this command is not working and generates the following error
RangeError: Maximum call stack size exceeded
Description | Command |
---|---|
Generate UML for all modules | npm run-script uml-all |
Generate UML for the interfaces EIP1404 | npm run-script uml-i-eip1404 |
Generate UML for the contracts CMTAT_STANDALONE, CMTAT_PROXY && CMTAT_BASE | npm run-script uml-partial |
Generate UML for core modules | npm run-script uml-modules-mandatory |
Generate UML for extensions modules | npm run-script uml-modules-optional |
Generate UML for security modules | npm run-script uml-modules-security |
Generate UML for mocks | npm run-script uml-mocks |
To generate documentation with surya, you can call the three bash scripts in doc/script
Task | Script | Command exemple |
---|---|---|
Generate graph | script_surya_graph.sh | npx surya graph -i contracts/**/*.sol npx surya graph contracts/modules/CMTAT_BASE.sol |
Generate inheritance | script_surya_inheritance.sh | npx surya inheritance contracts/modules/CMTAT_BASE.sol -i npx surya inheritance contracts/modules/CMTAT_BASE.sol |
Generate report | script_surya_report.sh | npx surya mdreport -i surya_report.md contracts/modules/CMTAT_BASE.sol npx surya mdreport surya_report.md contracts/modules/CMTAT_BASE.sol |
In the report, the path for the different files are indicated in absolute. You have to remove the part which correspond to your local filesystem.
Code coverage for Solidity smart-contracts, installed as a hardhat plugin
npm run-script coverage
Slither is a Solidity static analysis framework written in Python3
slither . --checklist --filter-paths "openzeppelin-contracts-upgradeable|openzeppelin-contracts|@openzeppelin|test" > slither-report.md
- Standalone
myth analyze contracts/CMTAT_STANDALONE.sol --solc-json solc_setting.json > myth_standalone_report.md
- With proxy
myth analyze contracts/CMTAT_PROXY.sol --solc-json solc_setting.json > myth_proxy_report.md
File path for solc
is configured in solc_setting.json