Etherscan is able to decode event data from unverified contracts, even without an exposed ABI. Below is an example screenshot. No signature available for this event. I've been able to replicate the filtering by topic0, but I'm unable to separate and decode the values in the returned data, which looks like this for the same kind of event:


Any ideas how to decode that like Etherscan does? The code I used to filter and log anon events is the following (Ethers 5.7):

import { ethers } from 'ethers'
const CONTRACT_ADDR = '0x-----insert-your-contract-event-emitting-address----'

function App() {
  const provider = ethers.providers.getDefaultProvider();
  async function yo() {
    const blockNumber = await provider.getBlockNumber()
    const logs = await provider.getLogs({ 
      topics: ["0x----------insert-your-topic0-signature------"],
      address: CONTRACT_ADDR,
      fromBlock: Number(blockNumber)-50,
      toBlock: blockNumber,


enter image description here

  • I’m voting to close this question because Etherescan is a proprietary product and how they decode unverified events is a support question for Etherscan team. Public does not have insight into Etherscan's internal product development. Mar 11 at 8:14

3 Answers 3


Divide the resulting log by 32 bytes:

0x0000000000000000000000000000000000000000000000000000000000000032 //hex to dec = 50
0x0000000000000000000000000000000000000000000000000000000000000046 // 70
0x000000000000000000000000000000000000000000eaef915630f8a56831c000 // 284019968367857035417600000
0x0000000000000000000000000000000000000000000000000000000065ee513b // 1710117179 (timestamp) => GMT: Monday, 11 March 2024 г., 0:32:59
0x00000000000000000000000000000000000000000000000000000000664a9a3b // 1716165179 => GMT: Monday, 20 May 2024 г., 0:32:59
0x00000000000000000000000000000000000000000000000000000000012f0b15 // 19860245 YYYYMMDD ???
0x000000000000000000000000000000000000000000000000000000000097b74a // 9942858
0x000000000000000000000000000000000000000000000000016345785d8a0000 // 100000000000000000 (wei?)
  • 1
    That's exactly what I'm trying to achieve. I was looking for a method to do that. ^_^'
    – user130657
    Mar 11 at 9:57

Found it! I managed to use hexDataSlice() from ethers.js https://docs.ethers.org/v5/api/utils/bytes/#utils-hexDataSlice and Javascript parseInt():

const result = (logs[0].data)
const size = result.length
const decodedValues = new Array
for(let i=0; i<size; i+=32) {
  let slice = ethers.utils.hexDataSlice(result,i,(i+32))
  let decoded = parseInt(slice,16)

Events in the EVM are encoded using the Contract ABI specification.


Given an event name and series of event parameters, we split them into two sub-series: those which are indexed and those which are not. Those which are indexed, which may number up to 3 (for non-anonymous events) or 4 (for anonymous ones), are used alongside the Keccak hash of the event signature to form the topics of the log entry. Those which are not indexed form the byte array of the event.

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.