Mahima Thacker pfp
Mahima Thacker
@mahimathacker
Hey, #devs! Did you know when you turn your Solidity code into bytecode, the names of your functions don't actually show up in the assembly output? Instead, what ends up in the Ethereum network is something like a secret code, called function selectors.
0 reply
0 recast
0 reaction

Mahima Thacker pfp
Mahima Thacker
@mahimathacker
Here's a cool fact 👀 Function selectors are made by taking the first four bytes of the hash of the function's signature.
0 reply
0 recast
0 reaction

Mahima Thacker pfp
Mahima Thacker
@mahimathacker
For example, if you have a function called doNothing(), when it's compiled, you won't see "doNothing" in the assembly OPCODE. You'll see something like 46aad107 – a short form made from the function's name.
0 reply
0 recast
0 reaction

Mahima Thacker pfp
Mahima Thacker
@mahimathacker
These selectors help the Ethereum Virtual Machine understand which function you want to run without keeping the whole name. It's a smart way to save space and make things run faster! 😃
0 reply
0 recast
0 reaction