Static Analysis
Threat Detection
Using the Detectors provided by Slither, it is possible to detect threats within the Hook. Herbicide automatically executes the following Detectors to find and warn about threats.
- Detection of the reentrancy bug. Do not report reentrancies that don't involve Ether (see,
reentrancy-no-eth)
Informational Gathering
Using the Slither-Printer, it displays critical information regarding the access control of the contract. In Herbicide, the Printer is automatically executed to extract and display.
Prints require statements in the function.
Prints modify applied to the function.
state variables and authenticationPrints require statements with
msg.sender, in the function which writes state variables.
Contract Information
info-variablePrints state variables and the functions using them.
info-inline-access-controlChecks require&assert&revert conditions.
info-inheritancePrints the contract's inheritance information.
info-libraryPrints the usage of libraries of the contract.
Semgrep-Solidity + Python
In the Simple Contract Analyzer, users can input contract to receive processed key information according to predefined Semgrep rules by Herbicide. This lets users easily review details about functions and storage variables declared in
Threat Detection
info-layer2-assigneeChecks storage re-used while double-initializing the hook.
low-callChecks if the hook is low-calling to other addresses.
getSlot0-checkChecks if the hook is calling
getSlot0function, as it is dangerous if the hook operates as an oracle, returning thegetSlot0value as the price of the pool.
missing-token-transfer-while-burntChecks if the hook is not transfer the underlying token while the token is burnt.
missing-onlyPoolManager-modifierChecks if
onlyPoolManagermodifier is not applied to the hook functions.
misconfigured-hookChecks if the hook functions are not yet implemented, while the function flag of
getHookPermissionsreturnstrue.
Last updated