Skip to content

fix(es/29_Selector): pass address literal (not string) to abi.encodeWithSelector - #956

Open
auyua9 wants to merge 1 commit into
AmazingAng:mainfrom
auyua9:fix/es-29-selector-abi-encodewithselector-address-literal
Open

auyua9 wants to merge 1 commit into
AmazingAng:mainfrom
auyua9:fix/es-29-selector-abi-encodewithselector-address-literal

Conversation

@auyua9

@auyua9 auyua9 commented Sep 9, 2026

Copy link
Copy Markdown

The Spanish tutorial sample Languages/es/29_Selector_es/Selector.sol passes the address argument to abi.encodeWithSelector wrapped in double quotes, turning it into a string literal. Because the target selector is mint(address), the example does not match the expected selector layout when compiled.

This change removes the quotes so the parameter is passed as an address literal, matching the mint(address) signature and the call output shown in the README (0x6a6278420000000000000000000000002c44...).

The same bug exists in the English counterpart Languages/en/29_Selector_en/Selector.sol; this PR intentionally fixes only the Spanish file per the task scope.

…in 29_Selector_es

The Selector.sol example for the Spanish tutorial wrapped the address
parameter in double quotes, making it a string literal. The mint function
expects an address, so the example would not match the expected selector
layout. Pass the 0x2c44... literal as an address (no quotes) so the sample
matches the mint(address) signature and is directly compilable.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Spanish tutorial README still contains the incorrect string-literal example, so the tutorial remains inconsistent and copy/paste instructions are still wrong.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes the Spanish Selector tutorial’s calldata encoding example so abi.encodeWithSelector receives an address-typed argument (rather than a string literal), aligning the encoded payload with the mint(address) signature.

Changes:

  • Replace the quoted "0x..." string argument with an address hex literal in Selector.sol for the mint(address) selector example.
File summaries
File Description
Languages/es/29_Selector_es/Selector.sol Fixes the tutorial’s abi.encodeWithSelector example to pass an address literal for correct mint(address) calldata encoding.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 24 to 28
(bool success, bytes memory data) = address(this).call(
abi.encodeWithSelector(
0x6a627842,
"0x2c44b726ADF1963cA47Af88B284C06f30380fC78"
0x2c44b726ADF1963cA47Af88B284C06f30380fC78
)
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.

2 participants