Skip to content

Conversation

@0x4tl4nt
Copy link
Contributor

@0x4tl4nt 0x4tl4nt commented Jan 27, 2026

Description

Fixed issues in the ERC-20 transfer example regarding the generation of the function selector:

  • The original example used the incorrect syntax [0..4] in JavaScript. It has been corrected to use .slice(0, 10) to correctly extract the first 4 bytes of the hash plus the 0x prefix.

  • The example incorrectly used the Transfer event as if it were a function for sending tokens. Transfer is an ERC-20 event, not a function, and cannot be called directly. The example has been updated to generate the selector for the correct transfer(to,value) function.


Note

Updates the ERC-20 "Send transactions" example to correctly derive the transfer(address,uint256) function selector.

  • Replaces deprecated/incorrect web3.sha3("Transfer(address, address, uint256)")[0..4] with web3.utils.sha3("transfer(address,uint256)").slice(0, 10) for proper 4-byte selector extraction

Written by Cursor Bugbot for commit f2e14a8. This will update automatically on new commits. Configure here.

@0x4tl4nt 0x4tl4nt requested review from a team as code owners January 27, 2026 11:04
@vercel
Copy link

vercel bot commented Jan 27, 2026

@0x4tl4nt is attempting to deploy a commit to the Consensys Team on Vercel.

A member of the Team first needs to authorize it.

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