diff --git a/README.md b/README.md index 1a82a43..7f76a24 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,8 @@ docker exec -it -w /rustle rustle bash * `tg_dir`: Path to the contract build target. Defaults to be same as `src_dir`. * `detector`: The detector list. It can be used to pass multiple *detectors* or *groups* separated by `,`. Defaults to `all`. * pass `all` *group* to enable all detectors. - * pass `high`, `medium`, `low` and `info` *groups* to enable detector groups with different severity + * pass `high`, `medium`, `low` and `info` *groups* to enable detector groups with different severity (refer to [Detectors](#detectors)) + * pass `nep-ft`, `nep-storage` and `nep-nft` *groups* to enable detectors implemented for specified NEP (refer to [NEP detector groups](#nep-detector-groups)) * pass *detector ids* in the [table](#detectors) to enable those detectors * `output`: Path where audit reports will be generated in. Defaults to `./audit-result`. @@ -123,6 +124,16 @@ All vulnerabilities **Rustle** can find. | `transfer` | [find all transfer actions](docs/detectors/transfer.md) | Info | | `public-interface` | [find all public interfaces](docs/detectors/public-interface.md) | Info | +### NEP detector groups + +Apart from the groups by severity level, **Rustle** provides some detector groups by corresponding NEP. Currently, **Rustle** supports the following groups. + +| Detector-Group Id | Included Detectors | +| ----------------- | ------------------------------------------------------------ | +| `nep-ft` | `nep141-interface`, `self-transfer`, `unregistered-receiver` | +| `nep-storage` | `nep145-interface`, `unclaimed-storage-fee` | +| `nep-nft` | `nep171-interface`, `nft-approval-check`, `nft-owner-check` | + ## Add new detector 1. Fork this repo to your account. diff --git a/rustle b/rustle index 76cb295..8d9c566 100755 --- a/rustle +++ b/rustle @@ -174,6 +174,14 @@ _arg_detector=$(echo $_arg_detector | sed 's/\blow\b/prepaid-gas,non-callback-pr _arg_detector=$(echo $_arg_detector | sed 's/\binfo\b/inconsistency,timestamp,ext-call,promise-result,transfer,complex-loop,public-interface/g') _arg_detector=$(echo $_arg_detector | sed 's/\bnep-interface\b/nep141-interface,nep145-interface,nep148-interface,nep171-interface,nep177-interface,nep178-interface,nep181-interface,nep245-interface/g') +# expand by NEP type +## NEP141 +_arg_detector=$(echo $_arg_detector | sed 's/\bnep-ft\b/nep141-interface,self-transfer,unregistered-receiver/g') +## NEP145 +_arg_detector=$(echo $_arg_detector | sed 's/\bnep-storage\b/nep145-interface,unclaimed-storage-fee/g') +## NEP171,NEP178 +_arg_detector=$(echo $_arg_detector | sed 's/\bnep-nft\b/nep171-interface,nft-approval-check,nft-owner-check/g') + # run audit make -C $TOP clean_tmp