2

I have noticed some contract calls only contain the function signature in the 1st byte of the input data. For example: 0x01672d7b3333d0f069a28b73a268bc6eaec65f2e1a6af1becb78701f5919adb6f6932965abe4547763... where the "01" is the function signature and the rest the parameters for the function. I know that since the contract calls always start with either 0x00 or 0x01. Does this require yul/assembly to convert to standard signature? I believe this is done to save gas, so you only push 1 byte to the stack instead of 4, but how does it work?

WhiteHat
  • 87
  • 5
  • Interesting. That sounds like a custom ABI (see my note in https://ethereum.stackexchange.com/questions/234/what-is-an-abi-and-why-is-it-needed-to-interact-with-contracts/1171#1171). If it is, then the contract bytecode is by hand rather than Solidity compiler. https://ethereum.stackexchange.com/questions/7602/how-does-the-evm-find-the-entry-of-a-called-function may also help as it gives a very rough idea of what the Solidity compiler does. I think people will also be interested on address of this contract? – eth Jun 19 '21 at 05:55

0 Answers0