-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude abi.encodeX()
calls from func-named-parameters
#584
Comments
hello @0xCLARITY thanks a lot for posting and for making a PR |
So, it's not "failing" for me - I just think that all Here's an example from some code I'm writing: // Encoding for an EIP712 digest
abi.encode(CHANGE_USERNAME_TYPEHASH, id, username, _useNonce(custody), deadline))
However... it seems nonsensical to attempt to pass named parameters to an Having to disable this rule with a line comment above every (let me know if that explanation / reasoning makes sense!) |
@0xCLARITY I understand what you mean now. And see also if there are others cases similar to this one to avoid this behavior |
I read through the ABI functions and checked their signatures. They are: abi.decode(bytes memory encodedData, (...)) returns (...);
abi.encode(...) returns (bytes memory);
abi.encodePacked(...) returns (bytes memory);
abi.encodeWithSelector(bytes4 selector, ...) returns (bytes memory);
abi.encodeCall(function functionPointer, (...)) returns (bytes memory);
abi.encodeWithSignature(string memory signature, ...) returns (bytes memory); While there are occasional named parameters (like I also checked the rest of the Solidity built-in functions to see if any of them also had I think all that is needed is excluding |
@0xCLARITY great one Your help is much appreciated! |
new release with this feature launched |
Solhint regularly complains about the
func-named-parameters
rule when all I'm doing is throwing a bunch of data intoabi.encode()
orabi.encodePacked()
.Rather than annotating every single
abi.encodeX()
call with a//solhint-disable
- I think it makes more sense to excludeabi.encodeX()
calls from this rule at the rule implementation.Implementation here: #583
The text was updated successfully, but these errors were encountered: