solhint 规则列表

Security Rules

Rule IDErrorOptions
reentrancyPossible reentrancy vulnerabilities. Avoid state changes after transfer.default
avoid-sha3Use “keccak256” instead of deprecated “sha3”default
avoid-suicideUse “selfdestruct” instead of deprecated “suicide”default
avoid-throw“throw” is deprecated, avoid to use itdefault
func-visibilityExplicitly mark visibility in functiondefault
state-visibilityExplicitly mark visibility of statedefault
check-send-resultCheck result of “send” calldefault
avoid-call-valueAvoid to use “.call.value()()”default
compiler-fixedCompiler version must be fixeddefault
compiler-gt-0_4Use at least ‘0.4’ compiler versiondefault
no-complex-fallbackFallback function must be simpledefault
mark-callable-contractsExplicitly mark all external contracts as trusted or untrusteddefault
multiple-sendsAvoid multiple calls of “send” method in single transactiondefault
no-simple-event-func-nameEvent and function names must be differentdefault
avoid-tx-originAvoid to use tx.origindefault
no-inline-assemblyAvoid to use inline assembly. It is acceptable only in rare casesdefault
not-rely-on-block-hashDo not rely on “block.blockhash”. Miners can influence its value.default
avoid-low-level-callsAvoid to use low level calls.default

* - All security rules implemented according ConsenSys Guide for Smart Contracts

Style Guide Rules

Rule IDErrorOptions
func-name-mixedcaseFunction name must be in camelCasedefault
func-param-name-mixedcaseFunction param name must be in mixedCasedefault
var-name-mixedcaseVariable name must be in mixedCasedefault
event-name-camelcaseEvent name must be in CamelCasedefault
const-name-snakecaseConstant name must be in capitalized SNAKE_CASEdefault
modifier-name-mixedcaseModifier name must be in mixedCasedefault
contract-name-camelcaseContract name must be in CamelCasedefault
use-forbidden-nameAvoid to use letters ‘I’, ‘l’, ‘O’ as identifiersdefault
visibility-modifier-orderVisibility modifier must be first in list of modifiersdefault
imports-on-topImport statements must be on topdefault
two-lines-top-level-separatorDefinition must be surrounded with two blank line indentdefault
func-orderFunction order is incorrectdefault
quotesUse double quotes for string literals. Default quotes values is “double”. Values must be ‘single’ or ‘double’.[\<default>, \<quotes>]
no-mix-tabs-and-spacesMixed tabs and spacesdefault
indentIndentation is incorrect[\<default>\

Best Practise Rules

Rule IDErrorOptions
max-line-lengthLine length must be no more than maxlen.[\<default>\] Default maxlen is 120.
payable-fallbackWhen fallback is not payable you will not be able to receive ethersdefault
no-empty-blocksCode contains empty blockdefault
no-unused-varsVariable “name” is unuseddefault
function-max-linesFunction body contains “count” lines but allowed no more than maxlines.[\<default>\] Default maxlines is 45.
code-complexityFunction has cyclomatic complexity “current” but allowed no more than maxcompl.[\<default>\] Default maxcompl is 7.
max-states-countContract has “some count” states declarations but allowed no more than maxstates[\<default>\] Default maxstates is 15.
智能合约漏洞检测工具是用于检测智能合约中潜在漏洞的软件工具。目前市场上有多种智能合约漏洞检测工具,包括但不限于:Mythril、SmartCheck、Securify、Oyente、Solhint、Slither等。下面对这些工具进行简要分析和比较: 1. Mythril:一种基于Python的智能合约漏洞检测工具,可以自动检测以太坊智能合约中的漏洞。Mythril使用静态分析技术来检测合约中的漏洞,并支持多种漏洞类型的检测。 2. SmartCheck:一种基于Solidity的智能合约漏洞检测工具,使用了一种基于符号执行的技术来检测合约中的漏洞。SmartCheck还支持自定义规则和插件。 3. Securify:一种基于静态分析的智能合约漏洞检测工具,支持检测多种漏洞类型。Securify使用了一种基于抽象解释的方法来检测合约中的漏洞。 4. Oyente:一种基于Python的智能合约漏洞检测工具,使用了一种基于符号执行的技术来检测合约中的漏洞。Oyente支持多种漏洞类型的检测,并提供了一种基于可视化的方式来展示检测结果。 5. Solhint:一种用于Solidity代码规范检查的工具,可以检查合约中的代码是否符合Solidity代码规范。Solhint支持多种代码规范,并可以自定义规范。 6. Slither:一种基于静态分析的智能合约漏洞检测工具,支持多种漏洞类型的检测。Slither使用了一种基于数据流分析的方法来检测合约中的漏洞。 综上所述,不同的智能合约漏洞检测工具使用了不同的技术和方法来检测合约中的漏洞,每种工具都有其独特的优势和劣势。在选择合适的工具时,需要根据具体的需求和场景进行选择。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值