Hi there. When we have example method funcName(address), the raw call includes 4 bytes for func signature plus address converted to 32 bytes so sum is 36 bytes. That's how it works and is clear to me. However what happens when we have method funcName(bytes) (note it's not bytes32 but bytes). Request is to send bytes(0) so the call in the code would be funcName(bytes(0)).

I need to understand what raw call would look like here. What bytes(0) would look like in the raw call? Would it be 32 bytes of zeros or maybe just 1 byte of zeros or maybe just a "0" or empty? I know the question may not be directly related to the Solidity but thought that someone of you may know the answer.

Nov 24, 2021, 10:54 AM
If anyone interested, bytes(0) will be converted to the number decimal 128 as 1x 32 bytes plus another 1x 32 bytes with zeros only. So bytes(0) in a raw call is additional 64 bytes.
Nov 24, 2021, 1:29 PM

© 2024 Draquery.com All rights reserved.