This code is from the YouTube channel: https://www.youtube.com/@cryptojesperk
This repository provides various examples demonstrating the use of function selectors in Solidity and Yul. Function selectors are crucial for identifying and invoking functions within Ethereum smart contracts. The examples include basic usage, advanced scenarios, hash collision handling, low-level calls, and interfaces. Additionally, a Python script is provided to compute function selectors for given function signatures. These examples aim to educate developers on the practical applications and nuances of function selectors in smart contract development.
-
Clone the repository:
git clone https://github.com/jesperkristensen58/FunctionSelectorEthereum.git cd FunctionSelectorEthereum
-
Compile and deploy the contracts using your preferred Ethereum development environment (e.g., Remix, Hardhat, Truffle).
-
Interact with the contracts:
- Use the provided Solidity examples to understand function selectors and their applications.
- Run the Python script to compute function selectors for your own function signatures.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
- Ethereum Foundation for their extensive documentation
- The Solidity team for their work on compiler optimizations
- Community contributors who have helped refine these concepts