Skip to content
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

Update cheatsheet.rst #15064

Merged
merged 1 commit into from May 2, 2024
Merged

Commits on Apr 27, 2024

  1. Update cheatsheet.rst

    The documentation currently says:
    
    ````
    ``abi.encodeCall(function functionPointer, (...)) returns (bytes memory)``: ABI-encodes a call to ``functionPointer`` with the arguments found in the
      tuple. Performs a full type-check, ensuring the types match the function signature. Result equals ``abi.encodeWithSelector(functionPointer.selector, (...))``
    ````
    
    However, this is not correct.
    
    `abi.encodeWithSelector` does not take a tuple as a second argument, instead, it takes an unended list of arguments. Saying these two are identical, is then not correct:
    
    - `abi.encodeCall(function functionPointer, (...)) `
    - `abi.encodeWithSelector(functionPointer.selector, (...))`
    
    It should be that these two are identical:
    
    - `abi.encodeCall(function functionPointer, (...)) `
    - `abi.encodeWithSelector(functionPointer.selector, ...)`
    
    subtle, but maybe there is a clearly way to say that `encodeWithSelector` is the same as the unpacked tuple from `encodeCall`.
    PatrickAlphaC committed Apr 27, 2024
    Configuration menu
    Copy the full SHA
    61ced0d View commit details
    Browse the repository at this point in the history