Skip to content

Latest commit

 

History

History
191 lines (110 loc) · 6.7 KB

TOOLCHAIN.md

File metadata and controls

191 lines (110 loc) · 6.7 KB

TOOLCHAIN

[TOC]

Node.JS package

This part describe the list of libraries present in the file package.json.

Dev

This section concerns the packages installed in the section devDependencies of package.json

Test

Chai Library used for the tests

Coveralls It is used to perform a code coverage

Truffle

Truffle A development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM).

Truffle Flattener Concats solidity files from Truffle projects with all of their dependencies.

Nomiclabs - Hardhat

hardhat-truffle5

Hardhat plugin for integration with TruffleContract from Truffle 5. This allows tests and scripts written for Truffle to work with Hardhat.

hardhat-web3

This plugin integrates Web3.js 1.x into Hardhat.

Linter

eslint JavaScript static analyzer, and the following plugins:

Ethlint Solidity static analyzer.

Ethereum / Solidity

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.

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.

solc JavaScript bindings for the Solidity compiler.

Web3 Ethereum JavaScript API.

Documentation

sol2uml

Generate UML for smart contracts

solidity-coverage

Code coverage for Solidity smart-contracts

solidity-docgen

Program that extracts documentation for a Solidity project.

Surya

Utility tool for smart contract systems.

solidity-coverage

Others

dotenv Loads environment variables from a .env file

Production

This section concerns the packages installed in the section dependencies of package.json

ethereumjs-wallet A wallet implementation

Submodule

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 documentation

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 2.3, this command is not working and generates the following error

Failed to convert dot to SVG. Error: lost 31 26 edge

Description Command
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 mandatory modules npm run-script uml-modules-mandatory
Generate UML for optional 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|test" > slither-report.md