When I call the same function twice, first through a direct call an event logs the exact parameters, second through a delegateCall from another contract, it returns the same parameters but the format is wrong, here are the logs from both calls:

Direct call:

"topics": [

Delegate call:

"topics": [

Thanks in advance for your help


1 Answer 1


When you call function of contract A from contract B via normal CALL opcode, the events logged by the bytecode of contract A appear in transaction receipt as if they originate from the address of contract A. As long as structures of these events are described in A's ABI, the contract wrapper generated by Web3 API for contract A is able to decode these events.

When you call the same function of contract A from contract B via DELEGATECALL opcode, the very same events will look like they originate from the address of contract B, but there is no description for these events in B's ABI. So wrapper generated for contract B will not know how to decode these events, and will show them in raw format. Thus the difference.

To fix the problem you need either to add declarations of events logged by contract A to the source code of contract B; or to create a wrapper based on A's ABI for the address of contract B, and use this wrapper to query events. In the latter case make sure you do not use this wrapper for calling any methods, because this would lead to undefined behavior.

  • Very informative, thank you @Mikhail
    – Arsalen
    Oct 27, 2019 at 14:58
  • This explains the 2nd and 3rd values, not the first, no? Oct 28, 2019 at 9:57
  • First value in the second case is keccak256 of the following string: Mint(address,address,uint256). I believe wrapper replaced this hash with index of the event type inside myContract.events array. Oct 28, 2019 at 10:27

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.