1

I am trying to decode some transactions logs and have hit a problem with one of the entries. In the event log for 0x1c50c336329a7ee41f722ce5d848ebd066b72bf44a1eaafcaa92e8c0282049d2 the first three events are a transfer, a deposit, and a transfer. The fourth one (# 488) refers to the UniswapV3Pool contract 0xf4ad61db72f114be877e87d62dc5e7bd52df4d9b, for which I can't retrieve the ABI information. When I try it via the Etherscan API, I get back:

{
    status: "0",
    message: "NOTOK",
    result: "Contract source code not verified"
}

Since the Etherscan.io summary provides sane data in respect of this entry, I assume that Etherscan had some way of getting the ABI information?

I am obviously missing something!

Any help is appreciated.

1 Answer 1

2

The four entry has topic 0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67.

Using the Ethereum Signature Database we get it refers to the event

Swap(address,address,int256,int256,uint160,uint128,int24)

Looking at the verified source on Etherscan it is declared as

/// @notice Emitted by the pool for any swaps between token0 and token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the output of the swap
/// @param amount0 The delta of the token0 balance of the pool
/// @param amount1 The delta of the token1 balance of the pool
/// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
/// @param liquidity The liquidity of the pool after the swap
/// @param tick The log base 1.0001 of price of the pool after the swap
event Swap(
    address indexed sender,
    address indexed recipient,
    int256 amount0,
    int256 amount1,
    uint160 sqrtPriceX96,
    uint128 liquidity,
    int24 tick
);

To read from 4bytes directory

curl -X GET https://www.4byte.directory/api/v1/event-signatures/?hex_signature=0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67
3
  • Thanks @Ismael. Apologies for being a bit slow with this but I can't seem to get the lookup to work. My understanding is that I should be able to get the signature by providing the topic as follows: 4byte.directory/api/v1/signatures/?hex_signature=0xc42079f9 Likewise, I should be able to go the other way and generate the topic as follows: 4byte.directory/api/v1/signatures/… However, neither works. Can you advise the URL you used to lookup the hex signature? Dec 11, 2021 at 12:32
  • 1
    @user3115148 I've added the curl command that can be used to retrieve the event signature. Events signatures are 32 bytes in length.
    – Ismael
    Dec 11, 2021 at 15:55
  • event-signatures, not just “signature” in your url will fix it Dec 11, 2021 at 15:59

Your Answer

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

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