[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
Hardhat plugin for integration with Foundry
Foundry forge fmt Solidity code formatter integrated with the Foundry toolchain.
Foundry forge lint Solidity linter integrated with the Foundry toolchain.
Generate UML for smart contracts
Program that extracts documentation for a Solidity project.
Utility tool for smart contract systems.
OpenZeppelin Contracts OpenZeppelin Contracts The version of the library used is available in the README
Warning:
- Submodules are not automatically updated when the host repository is updated.
- Only update the module to a specific version, not an intermediary commit.
The current tested baseline is:
Solidity-docgen is a program that extracts documentation for a Solidity project.
npx hardhat docgen
Generate UML for smart contracts
You can generate UML for smart contracts by running the following command:
npm run-script uml
npm run-script uml:testOr only specified contracts
npx sol2uml class -i -c src/RuleEngine.sol
The related component can be installed with npm install (see package.json).
To avoid the error "Maximum call stack size exceeded", you can flatten the contract before
forge flatten src/RuleEngine.sol > RuleEngineFlatten.sol
To generate documentation with surya, you can call the three bash scripts in doc/script
| Task | Script |
|---|---|
| Generate graph | script_surya_graph.sh |
| Generate inheritance | script_surya_inheritance.sh |
| Generate report | script_surya_report.sh |
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.
To generate graphs with Surya, you can run the following command
npm run-script surya:graphnpx surya graph src/RuleEngine.sol | dot -Tpng > surya_graph_RuleEngine.pngnpm run-script surya:reportSlither is a Solidity static analysis framework written in Python3
slither . --checklist --filter-paths "openzeppelin-contracts|test|mocks|CMTAT|forge-std" > slither-report.mdaderyn -x mocks --output aderyn-report.mdWe use the following Foundry tools to ensure consistent coding style:
forge fmt — Solidity formatter
# Format all files
forge fmt
# Check formatting without modifying files
forge fmt --checkforge lint — Solidity linter
# Run linter on all files
forge lint