Questions tagged [events]

Solidity events and logging problems. Events allow the convenient usage of the EVM logging facilities, which in turn can be used to “call” JavaScript callbacks in the user interface of a dapp, which listen for these events.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

What do the to/from fields in a swap event mean?

Im parsing swap log events from web3 and was reading the to and from addresses from the topic but sometimes the from/to address is the same, and other times its different. It doesn't seem to ever be ...
BAR's user avatar
  • 125
0 votes
0 answers
11 views

Python Event Listener

I am trying to listen events from smart contract from python backend offchain code part. I tried different code parts such as below where MemberAdded is the name of the Solidity event. event_filter ...
Ferda-Ozdemir-Sonmez's user avatar
0 votes
0 answers
9 views

Not able to dynamically assign values to array

I am testing the correct emission of NFTMintedAll event on the following function, using hardhat: event NFTMintedAll( uint256 requestId, address indexed owner, uint256[] ...
Falcon Stakepool's user avatar
1 vote
1 answer
33 views

How do you "fake" the signature of a Solidity event?

The Note for the official Solidity documentation on Events says that "it is possible to “fake” the signature of another event using an anonymous event", without going into details of the ...
Iaroslav's user avatar
  • 259
1 vote
1 answer
20 views

Is it possible to know if a NFT was sold in OpenSea?

Is it possible to detect, by looking at the transfer events, whether a NFT was sold from a Marketplace or not? Basically I want to know if, in these cases, the safeTransferFrom method notifies the ...
Falcon Stakepool's user avatar
0 votes
0 answers
27 views

Listen to transfer event on any ERC721 compliant contract (ethers.rs)

I am trying to make a program that, given a ERC721 contract address, will listen to all transfer events done on this contract until a certain point. I am not yet very familiar with how Ethereum works, ...
Nathan's user avatar
  • 101
0 votes
1 answer
19 views

Can't catch all the events using ethers

Can't catch all the events. Why? I try to listen to events for several contracts and it is ok. But the more contracts I listen to, the more events are missed? Is there any way to prevent this and why ...
byggy's user avatar
  • 1
0 votes
0 answers
22 views

Scalable way to listen dynamically added contracts in web3j

Consider I need to listen to the event logs for a Uniswap's Swap method, which works perfect for a single CA, or even to many if they are known to the time of creation of filter: web3j.ethLogFlowable(...
0xMixer's user avatar
1 vote
0 answers
36 views

WEBSOCKETS Provider url for binance smart chain

I have a contract deployed in Binance smart chain. I have written a script that will help me read the events logs from the Blockchain. currently, I tested that with the local hardhat network itself, ...
Bappa Banerjee's user avatar
2 votes
2 answers
112 views

Reading events from layer 2 blockchains

I'm planning to query a tx using a tx hash on Ethereum and get the events/logs to find out the recipient and sender of the ETH. Is it possible to do so for L2 blockchains like Optimism, ZkSync, ...
att's user avatar
  • 155
1 vote
1 answer
21 views

FilterException when creating an EthFilter in web3j

I'm using web3j to create a filter to listen to events. Specifically, I want to listen to events of a specific contract between a certain block number and now. This is my code: Web3j web3j = ... ...
Michael's user avatar
  • 215
2 votes
1 answer
59 views

Why is Alchemy eth_getLogs not finding event logs for AaveV3 Supply events?

I have created a Node project that connects to Alchemy via ethers. I am trying to capture all Supply events for AaveV3 However, when I use the getLogs function, and use the contract address as the ...
Oscar Chambers's user avatar
1 vote
1 answer
17 views

before all" hook for "should allow a purchase" error - Chainshot

I am completing series of tutorials on chainshot. Now I am on events 4. - Sale and I am getting an error "before all" hook for "should allow a purchase" and I don't have an idea ...
rad2's user avatar
  • 11
2 votes
1 answer
106 views

How can I decode the emitted event data field using Foundry Cast in Ethereum?

I'm trying to extract relevant information from the event but I'm not sure how to decode the emitted event data using cast. Any tips or resources would be greatly appreciated. Thank you!" E.g for ...
Surbhi Audichya's user avatar
1 vote
0 answers
24 views

What is wrong with this function that is supposed to listen to an event from a smart contract?

I am essentially just trying to create a simple API that listens to this one event on a smart contract I created but for some reason the function doesn't output anything. I am pretty sure it has ...
Naander's user avatar
  • 11
1 vote
1 answer
19 views

Etherjs "contract.on" method in Reactjs to read events not loading on console

I am trying to display the events that are emitted from a function in my smart contract to the front end of my dApp, and I feel like I am missing a step in the connection process with my dApp. I've ...
OhItsPM's user avatar
  • 55
0 votes
2 answers
40 views

If no event is triggered with normal transaction, how do one listen to "transfer activities"?

This question is a follow up question based on the answer I got to the question How many transfer events are there in Ethereum? The answer mentioned that: There is no event emitted when an account ...
Finlay Weber's user avatar
2 votes
1 answer
28 views

Is it possible to track marketplace sales for an ERC721?

I know I can track events for smart contracts, such as Transfer and Approval for ERC20 and ERC721 or even ApprovalForAll for ERC721. I also know that I can track my own defined events for any smart ...
Falcon Stakepool's user avatar
2 votes
1 answer
20 views

Why do events with arguments of custom types appear fully-encoded in Tx Logs?

You can observe the behavior via the following contract which I've deployed to Polygon Mumbai at 0x33c059160280a45725d9509c120c6b30a44a61a4: pragma solidity ^0.8.19; contract EventWithCustomTypeArg { ...
Iaroslav's user avatar
  • 259
2 votes
1 answer
68 views

ERC20 - Approve/TransferFrom vs listening to Transfer events

I've been learning about the ERC20 standard and I've seen in several places statements like If a smart contract want to detect when it receives a transfer of ERC20 tokens the standard approach is for ...
Adham's user avatar
  • 61
0 votes
0 answers
28 views

TrroubleShooting "events" (event.arg) with smart contracts, ethers js, and deploy scripts?

I am getting the following error message in regards to my script below. Please keep in mind the deploy scripts have already been successfully run and the addresses successfully exported and saved in ...
Blockpain's user avatar
  • 133
0 votes
0 answers
47 views

How does an event listener work in real time?

My frontend is watching/listening for a contract event. When an event is emitted after the contract is called, how is a listener notified in real time? If it is done through JSON-RPC polling using ...
sinoTrinity's user avatar
0 votes
0 answers
20 views

Problem with recognizing an event (testing)

I'm doing this as a part of a solidity course by Free code camp (PatrickAlphaC). Here is my repo: https://github.com/Sosiaalinen/Raffle In my understanding, it should recognize the event, since it's ...
Sosiaalinen's user avatar
0 votes
0 answers
45 views

Is eth_subscribe always sending logs in the right order

I am using eth_subscribe to log for all token transfer events that are happening on the blockchain. Here is my code: import asyncio import json from secret_config import RPC_ENDPOINT from websockets ...
Lockface's user avatar
0 votes
0 answers
28 views

How can I retrieve the event emitted from a function call of another contract?

I notice when I have a function calling another function from another contract, the events emitted aren't captured by ethersjs. In my case, I want to retrieve the event emitted from ContractA even ...
xenon's user avatar
  • 388
0 votes
1 answer
25 views

Is it 100% guaranteed that a process that listens to blockchain events will receive them if they get emitted?

When a smart contract emits an event, if I am listening to them for example with an application that stores all events from that smart contract into a database, do I have the certainty that I won't ...
Falcon Stakepool's user avatar
1 vote
0 answers
23 views

Library package helps interact with Blockchain on the Ethereum platform (ETH, BSC, Polygon...) more simple and minimized

I am a Blockchain engineer and after 3 years of working with the EVM-platform I used many different libraries such as web3, ethers, ethereumjs-tx,... I realized they are so distributed and complex to ...
Khiem Nguyen's user avatar
0 votes
1 answer
71 views

Is it possible to set up an event listener that will catch all ERC20 tokens

Is it possible to set up an event listener in such a way that it will trigger for all token transfers? I am using web3.rs at the moment which is an implementation of web3.js in Rust. So anything that ...
John5544's user avatar
3 votes
2 answers
29 views

When should a protocol should emit an event?

I understand that a protocol can emit events for any of the following reasons: Make it easier to do a data migration in the future (ie, copy-pasting storage mappings is much easier with events) Store ...
Patrick Collins's user avatar
0 votes
0 answers
11 views

Getting the value of a event topic with Go ethereum [duplicate]

I have an event that has two indexed arguments, a uint256 and a string. I am successfully able to get the Hex value of the event topics i am looking for but I am having trouble to decode the string ...
DevEth1797's user avatar
1 vote
1 answer
200 views

Decoding logs of Approval event with web3js results in error

I am trying to decode the Approval event of an ERC721 contract. I fetch the logs for the contract with the alchemy API and then try to decode them with web3js. The code looks like this: const logs = ...
rajohs's user avatar
  • 161
3 votes
1 answer
180 views

How to parse event args: struct of custom internalType

Question: How does one parse the contents of a custom struct emitted as an indexed parameter with a contract event? Or, is it even possible to emit and then parse a custom struct from the event args? ...
w0nd3r.eth's user avatar
2 votes
1 answer
191 views

Get ABI code for an ethereum contract event

How can I construct the ABI code for a contract event? I don't need the whole contract ABI. Example: transferFrom(address,address,uint256) executeMetaTransaction(address,bytes,bytes32,bytes32,uint8) ...
jinsley8's user avatar
1 vote
0 answers
22 views

Uncaught (in promise) TypeError: ProposalsRegistrationEndedEvent.watch is not a function

I was following an old Ethereum dapp tutorial to make a voting dapp. It uses truffle contract, web3js and ganache and when i access the pages via localhost i get the following error in the console: ...
Frenzied2498's user avatar
0 votes
1 answer
33 views

Accessing the network throught light sync node

I'm trying to create an application that will track balance changes at specified addresses. I want to catch new block validation events and see if there are transactions associated with my addresses. ...
Galaxy773's user avatar
0 votes
1 answer
112 views

Subgraph indexing error, mapping aborted with ethereum value is not an address

Subgraph indexing failing due to mapping abortion with reason - ethereum value is not an address, from one of the handlers. I understand the issue if from the handlePaymentExpenseCreated() function ...
Gokul's user avatar
  • 3
2 votes
1 answer
511 views

Reading and listening to Solidity events via Web3.py and websocket

Recently I have been solving a problem of how to listen to and read Solidity events in Web3.py via websocket rather than constant HTTP calling. You may be familiar with this algorythm which can be ...
f22daniel's user avatar
  • 183
0 votes
1 answer
21 views

Retrive data from chainlink node

in APIConsumer contract on chainlink docs (Any API) // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol"; import "@...
noro meb's user avatar
  • 298
1 vote
2 answers
140 views

Does Hardhat node not support emitting events?

So I am running this code that is the standard code for logging events to the ReactJS App UI, but I cannot understand why it does not work. I am not getting any errors either. import React, { useState ...
sunsakis's user avatar
0 votes
1 answer
36 views

Could not find corresponding event log from 0x aggregator contract

Looking at the event log from the 0x Protocol aggregator contract ("0xdef1c0ded9bec7f1a1670819833240f027b25eff"), I could not find corresponding event to the following log topics0 "...
Shigami's user avatar
  • 26
1 vote
2 answers
68 views

Listening to multiple smart contracts

Is there an "optimal" way to listen to multiple smart contracts? For example, listening to an event emitted by one smart contract in a useEffect: useEffect(() => { const ...
alpo's user avatar
  • 144
1 vote
0 answers
139 views

web3.eth.subscribe not working properly

import Web3 from "web3"; const web3 = new Web3(new Web3.providers.WebsocketProvider("url")); const addr = web3.utils.toChecksumAddress("...
Vishant Mittal's user avatar
1 vote
1 answer
32 views

Number of events in Solidity code vs on Etherscan

Hey guys I have a simple Solidity code, which emits events shown in the code bellow. What I don't understand however is that on Etherscan I get many sections with events that I have never coded. Why ...
f22daniel's user avatar
  • 183
0 votes
0 answers
44 views

Solidity Events are not emitting properly, even with the successfull transaction!

Solidity Events are not emitting properly. This is the code "Nftfactory.sol": // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../MPContractFactory/Interfaces/...
A Maajith's user avatar
0 votes
0 answers
106 views

Web3.js event listener keeps reconnecting

I have a websocket set up listening to an event of a particular contract. However, I have noticed that the .on('connect') event keeps getting triggered intermittently leading me to believe that I am ...
scapegoat17's user avatar
0 votes
1 answer
57 views

Same event triggering action more than once using useEffect and Ethers.js

I am trying to listen to a smart contract event, but my event listener is getting triggered more than once per event. The event is being emitted and returns two strings. The event is declared as event ...
Fabio Benjovengo's user avatar
1 vote
1 answer
31 views

Replace storage with the use of events. Considerations, risks?

I'm testing to not use state variables and relay on events and an external service to know the latest state and history of, in the simple example above, a Document. You can think about Document as a ...
mtabasco's user avatar
0 votes
1 answer
40 views

How to track for certain all addresses affected by a transaction?

So I am asking this question because I recently learnt about what is called "Internal Transactions". I was actually reading the answer here and from this I understand that a transaction ...
Finlay Weber's user avatar
0 votes
2 answers
141 views

How can I parse an Ethereum block-level logsBloom?

I have been downloading blocks from EVM-based blockchains via the JSON-RPC API via eth_getBlockByNumber. In the block there is a logsBloom element which, if I understand this correctly, is an ...
Michael C's user avatar
0 votes
1 answer
272 views

Problems reading emitted events with string data with ethers.js

I have a smart contract that produces NFTs and emits an event when contract is created. The definition of the event is: event NewBKNFT(address indexed contractAddress, address indexed publisherAddress,...
GGizmos's user avatar
  • 651

1
2 3 4 5
17