diff --git a/lib/rules/naming/func-named-parameters.js b/lib/rules/naming/func-named-parameters.js index 8d57f757..3f821f84 100644 --- a/lib/rules/naming/func-named-parameters.js +++ b/lib/rules/naming/func-named-parameters.js @@ -36,6 +36,10 @@ const meta = { description: 'Function call with four NAMED parameters', code: 'functionName({ sender: _senderAddress, amount: 1e18, token: _tokenAddress, receiver: _receiverAddress })', }, + { + description: 'abi.encodeX call with four UNNAMED parameters', + code: 'abi.encodePacked(_senderAddress, 1e18, _tokenAddress, _receiverAddress )', + }, ], bad: [ { @@ -67,12 +71,24 @@ class FunctionNamedParametersChecker extends BaseChecker { const qtyNamed = node.names.length const qtyArgs = node.arguments.length - if (qtyArgs !== 0) { - if (qtyNamed === 0 && qtyArgs > this.maxUnnamedArguments) { - this.error( - node, - `Named parameters missing. MIN unnamed arguments is ${this.maxUnnamedArguments}` - ) + if (!this.isAbiCall(node)) { + if (qtyArgs !== 0) { + if (qtyNamed === 0 && qtyArgs > this.maxUnnamedArguments) { + this.error( + node, + `Named parameters missing. MIN unnamed arguments is ${this.maxUnnamedArguments}` + ) + } + } + } + } + + isAbiCall(node) { + if (node.expression.type === 'MemberAccess') { + if (node.expression.expression.type === 'Identifier') { + if (node.expression.expression.name === 'abi') { + return true + } } } }