Skip to content

fix(Languages/{es,en}/29_Selector): pass address, not string, to abi.encodeWithSelector - #915

Open
vuyua9 wants to merge 1 commit into
AmazingAng:mainfrom
vuyua9:fix/29-selector-abi-address-type-es-en
Open

fix(Languages/{es,en}/29_Selector): pass address, not string, to abi.encodeWithSelector#915
vuyua9 wants to merge 1 commit into
AmazingAng:mainfrom
vuyua9:fix/29-selector-abi-address-type-es-en

Conversation

@vuyua9

@vuyua9 vuyua9 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What & Why

The Spanish and English localizations of 29_Selector pass the mint(address) argument to abi.encodeWithSelector as a string literal instead of an address literal:

abi.encodeWithSelector(0x6a627842, "0x2c44b726ADF1963cA47Af88B284C06f30380fC78")

The selector 0x6a627842 is mint(address), so abi.encodeWithSelector expects an address argument. Passing a string produces a completely different calldata encoding (string offset + length + bytes payload) than the 4-byte selector + 32-byte left-padded address the chapter itself documents just above the example:

0x6a6278420000000000000000000000002c44b726adf1963ca47af88b284c06f30380fc78

The pt-br localization already passes the argument correctly as an address literal (no quotes). This PR brings es and en in line with pt-br and with the documented calldata.

Files

  • Languages/es/29_Selector_es/Selector.sol
  • Languages/es/29_Selector_es/readme.md
  • Languages/en/29_Selector_en/Selector.sol
  • Languages/en/29_Selector_en/readme.md

Four single-line edits, +4 / -4. Each change is exactly:

-                "0x2c44b726ADF1963cA47Af88B284C06f30380fC78"
+                0x2c44b726ADF1963cA47Af88B284C06f30380fC78

Type of PR

  • Typo(勘误)
  • BUG(程序错误)
  • Improvement(提升)
  • Feature(新特性)

Cross-reference

The pt-br version (Languages/pt-br/29_Selector/Selector.sol) was used as the canonical correct pattern.

…encodeWithSelector

The Spanish and English localizations of 29_Selector pass the mint(address)
argument as a string literal instead of an address literal:

    abi.encodeWithSelector(0x6a627842, "0x2c44b726ADF1963cA47Af88B284C06f30380fC78")

The selector 0x6a627842 is mint(address), so abi.encodeWithSelector expects an
address argument. Passing a string produces a different calldata encoding
(string offset + length + bytes payload) than the address encoding the chapter
documents (4-byte selector + 32-byte left-padded address):

    0x6a6278420000000000000000000000002c44b726adf1963ca47af88b284c06f30380fc78

The pt-br localization already passes the argument as an address literal
(without quotes); this PR brings es and en in line with pt-br and with the
calldata documented in the same chapter.

Files changed:
- Languages/es/29_Selector_es/Selector.sol
- Languages/es/29_Selector_es/readme.md
- Languages/en/29_Selector_en/Selector.sol
- Languages/en/29_Selector_en/readme.md

Four single-line edits, +4/-4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant