In the following example:


should we pad the parameters values to 32 bytes? Because I have seen code like

if (!addressOfA.call(bytes4(keccak256("f1(bool,uint256)")), true, 3)) {

but according to the ABI specification, "true" and "3" should be padded, where clearly in the example are not.

  • 1
    There should be no space between your parameter values in the string that you hash: keccak256("f1(bool,uint256)") instead of keccak256("f1(bool, uint256)")
    – SCBuergel
    Feb 11, 2018 at 15:42
  • Thanks for pointing it out. But this is a minor detail. The question is still open. Feb 11, 2018 at 16:26

1 Answer 1


The padding is not needed, from the solidity documentation:

  • call, callcode and delegatecall

Furthermore, to interface with contracts that do not adhere to the ABI, the function call is provided which takes an arbitrary number of arguments of any type. These arguments are padded to 32 bytes and concatenated. One exception is the case where the first argument is encoded to exactly four bytes. In this case, it is not padded to allow the use of function signatures here

  • Didn't read that part in the documentation. Thanks Feb 13, 2018 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.