The {“extends”: “solhint:recommended”} property in a configuration file enables this rule.
Require or revert statement must have a reason string and check that each reason string is at most N characters long.
This rule accepts an array of options:
Index | Description | Default Value |
---|---|---|
0 | Rule severity. Must be one of “error”, “warn”, “off”. | warn |
1 | A JSON object with a single property “maxLength” specifying the max number of characters per reason string. | {“maxLength”:32} |
{
"rules": {
"reason-string": ["warn",{"maxLength":32}]
}
}
pragma solidity 0.4.4;
contract A {
function b() public {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
role.bearer[account] = true;
}
}
pragma solidity 0.4.4;
contract A {
function b() public {
require(!has(role, account));
role.bearer[account] = true;
role.bearer[account] = true;
}
}
This rule was introduced in Solhint 2.3.1