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
0answers
18 views

How is Etherscan Token Tracker Feature Built

How is the Etherscan ERC-20 Token Address page built (different from address Page)? My understanding is that ERC-20 only logs (emits) the events 'Transfer' and 'Aprove', so we are limited to these ...
1
vote
2answers
26 views
+50

What are the pros and cons of emitting events vs return statements?

According to this answer the return data of a smart contract function call can be accessed, however the same return data can be collated into an event to emit, so when should either method of ...
0
votes
0answers
10 views

Is there a way to make sure I don't miss an emitted event?

I'm trying to listen for Transfer events emitted by an ERC721 contract. I have tried using infura as a provider but it does have some problems and I can easily miss some events (which is crucial not ...
1
vote
1answer
19 views

Websocket listener returns no response

I am trying to listen to a UniSwap v3 Swap event but I get no response from the network. I am connected to polygon network via websocket and after firing up the listener I get no callbacks even though ...
0
votes
0answers
7 views

how do i get the last block of different erc20 tokens using etherscan and web3js

I'm trying to build my first application where I want to see the last block number and its price of various erc20 tokens. First I tried using the last transaction of the tokens and using the ...
0
votes
0answers
32 views

Missed events when using ethersjs contract.on in a nodejs backend

I am using a default ethersjs provider with Infura and etherscan API keys to listen for a contract events with contract.on(event, listener) in a nodejs backend. It misses some of the events (let's say ...
0
votes
0answers
7 views

Can't get event logs with web3, got empty list

I have a simple contract that emits events on payment // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract ThisBalance { event TestEvent(string text); receive() external payable {...
0
votes
0answers
7 views

Contract.on(filter, (result) => { console.log(result)}) doesn't return anything

campaignFactory.on(getDeployedCampaign, (result) => { console.log("result is: ", result); }); This block is not returning anything const { expect } = require("chai"); const { ...
0
votes
1answer
15 views

Call function in event callback

I have a contract that sends an event when the transaction is done. In my React/Web3 application, I'm listening to this event and when it's triggered I would like to run another function. My code ...
0
votes
0answers
32 views

filter specific event by address web3js

I'm creating a betting dapp, in the smart contracts I've made an event "betPlaced" triggered every time someone is placing a bet. event betPlaced(address indexed bettor, Side indexed bets, ...
0
votes
0answers
16 views

Problem with events catching in web3js

So I have a function "mint" and also I have a backend code that is listening to the contract's events. The weirdest thing is that I can catch the event "TransferSingle", but I can'...
0
votes
1answer
26 views

Is there a way to listen to events that involves a specific contract?

I would like to do something when an NFT from my contract gets transferred to another user. Can I listen to events like this? If not, what would be the best way to get around this?
0
votes
0answers
6 views

Should I replace public variable calls with event listeners?

I am writing a contract that has an array or entrants. Currently, in web3, when a user enters I call contract.methods.enter().send(..) and it updates this array. I then call contract.methods....
0
votes
0answers
9 views

Filter out mint and burn Transfers from Transfer events (web3.js)

In web.js Library Is there a way to filter out the Transfers events generated by the mint and burn function so as to ignore all the Transfer events generated by the mint or burn function. I know we ...
1
vote
1answer
34 views

Why does CryptoPunks does not use the Wyvern contract on OpenSea?

Almost all NFT transactions on OpenSea are handled using the wyvern contract which creates an OrdersMatched event for the NFT sale. However, I noticed that on sales for CryptoPunks there is no ...
0
votes
0answers
16 views

How to parse event logs (ERC-20 Transfer) from trace_call

I'm trying to get the event logs of a transaction (simulating transaction without actually adding it to blockchain). From trace_call, I am able to get vmTrace and a sample entry looks like this { &...
0
votes
0answers
22 views

web3.py No matching entries for 'tuple' in decoder registry

Version: master (6a90a26ea12e5a789834c9cd6a7ae6d302648f88) Python: 3.9 OS: osx pip freeze https://gist.github.com/Th0rgal/bb866886af6224af5e89bd64ba0b99bf What was wrong? It seems I am not able to ...
1
vote
1answer
33 views

How to gather historical events emitted by any contract

I am trying to gather all events of a specific type on the entire chain, regardless of what contract emitted them. When trying to find solutions online, I came across code like the following (source): ...
0
votes
0answers
31 views

How to find which fields in an event are indexed?-or How to get topics & data fields together in receipt in the order they appear in event signature?

Consider the first log in this transaction. We see that etherscan is unable to parse the topic[0] = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. I am able to find this topic on ...
1
vote
0answers
31 views

How to listen to smart contract emitted events using C#

I have to add/update some data in a database when specific events are emitted by a solidity smart contract. When using web3.js there is a simple method called watch(), but I didn't find anything like ...
0
votes
1answer
34 views

Ethers.js event firing question

I've got a simple contract that fires an event when a method is called. On my ethers.js client in an html page I've got the following code executed when the page is loaded: voterContract.on(&...
1
vote
1answer
36 views

Event not being captured in web3js

I have the following (very simple) oracle contract. All I want it to do is manage data on the chain that is returned by an open source API - I'll use this data in another contract. I am able to call ...
0
votes
0answers
31 views

web3 subscribe 'on' events seem to do nothing

I'm trying to learn web3 subscribe events so I've written a simple event listener referencing the web3js docs. In my case the subscribe callback successfully logs to the console when a new transaction ...
0
votes
0answers
35 views

Why Does My Ethereum ".on" Event Listener Stop Firing?

I have a node.js server where I am listening for an event that is emitted from a Solidity smart contract deployed on the Mumbai Polygon testnet. First, I'm using the "web3-providers-ws" node ...
1
vote
1answer
85 views

Unable to get events in Polygon's test network

I want to get the address of an event for a contract I created in mumbai test network, but I get the following error Error: Internal JSON-RPC error. { "message": "Blockheight too far ...
1
vote
1answer
62 views

Recognizing anonymous events in logs

Is there any way to recognize if a log contains an anonymous topic? From what I can tell is that anonymous events are represented in a log without the signature on the first index. Giving the option ...
1
vote
2answers
54 views

Are pure functions and events verifiable/guaranteed

I am very new to solidity so please forgive me if I'm mistaken, but it seems that pure and view functions are not really run on chain if I access them with web3 (but they are if I access within a ...
0
votes
2answers
17 views

Get latest log of Event with web3

I have read all the other answers, but it doesnt seem to really work for me. At first I thought it worked but then I noticed it didnt. What is the best way to retrieve the value of the last event that ...
0
votes
0answers
14 views

web3.js returning object that's not a proper JSON

I have the following call: const data = await contract.methods.function().send(); "data" returns logs like this: { address: '0xdd006C746E0b62d1db050Fda654c69c527b15de2', blockHash: '...
1
vote
1answer
12 views

Can a pruned node do contract.getPastEvents("Transfer", { fromBlock: startBlock})

Is it possible for a pruned Ethereum node to return data when calling the getPastEvents() function on a contract?
1
vote
1answer
48 views

How To Specify ChainID

I am interacting with the Harmony testnet using web3j, but since Harmony has 4 shards i also have to specify the chainID, otherwise it throw an error. When writing to the blockchain i was able of ...
0
votes
1answer
44 views

How to identify a smart contract transaction

Apologies if this is a bit of a noob question. But I have a bit of trouble understanding a concept. I am designing a Smart Contract where I need to send data for the same transaction from multiple ...
1
vote
0answers
13 views

What's the best way to be as up to date with the network as possible

I am trying to create a fast responding system based on event logs. After getting into testing the system I ran across multiple issues from the public providers I am using. I started getting errors ...
0
votes
0answers
15 views

Has anyone spammed the Bloom Filter?

I've seen a (hypothetical) threat scenario where a malicious actor could spam LOG operations to populate the Bloom filter (making it harder for external services to index events). I also read about ...
0
votes
0answers
11 views

Event is being fired but no logs can be seen when mined

I'm new to development in solidity I have an issue where an Event is being fired but no logs are coming through in the mined transaction I am getting a log but I'm not getting any of the parameters ...
0
votes
0answers
21 views

Using array of addresses in web3.eth.subscribe()

Referencing Thread I want to clarify the usage of the subscribe(). I'm wondering if I'm able to use an array of addresses that shall be subscribed. As mentioned in the documentation a list of strings ...
0
votes
0answers
22 views

Parsing events in ethers.js

Is there a good way to parse events in transaction receipts/blocks? Looking for a way to check if an nft has minted in a certain txn/block
0
votes
0answers
31 views

Event handler for a web3 app

Hey I am having trouble adding an event handlers from this tutorial I been practicing on. Heres the link to the tutorial https://www.dappuniversity.com/articles/the-ultimate-ethereum-dapp-tutorial The ...
1
vote
2answers
51 views

How to do call a smart contract at intervals on the matic network?

I'm trying to write a smart contract to farm tokens. I would like to make an auto-compounding solution similar to beefy.finance or polycats. My contract can deposit funds or liquidity into LP mining, ...
3
votes
1answer
31 views

Chai closeTo on Ethereum Events

I know that we can use closeTo chai matcher like this: expect(BigNumber.from(100)).to.be.closeTo(BigNumber.from(101), 10); And we can test whether a transaction emits an event with specific arguments ...
0
votes
1answer
63 views

Is there any way to listen smart contract events from nodejs-expressjs server?

I am developing a smart contract project and I need to listen events on my expressjs-server. Is it possible to listen events from there?
0
votes
2answers
30 views

Be notified when an Ethereum event occurs

I recently asked another question, but I deleted that one because I can narrow down my question to something simpler. Suppose an ethereum ERC-20 token contract can emit the following event: event ...
0
votes
0answers
24 views

Securely determining what tokens have been minted?

I am working on a ERC721 based application that is related to an offchain web app. I am trying to figure out how to have the DAPP securely tell the web app when a token is minted. My original (simple) ...
0
votes
0answers
76 views

Event listener firing multiple times

In my Next.js project, in the app.jsx file, I've set up a websocket and listeners for our 4 events. However, when one of these events fires, it logs in Discord 3 or more times and I can't seem to ...
0
votes
0answers
125 views

web3.py " filter not found "

im using web3.py v5.19 in my project and we are on BSC mainnet also i use bsc urls recommended in site to connect to nodes this is my code to get events : block_filter1 = contract.events....
0
votes
0answers
133 views

Event Listener using web3py (for stateless node providers)

I am trying to make an event listener, I came across this code and it works fine for infura nodes, however, when I use another type of node, specifically from ankr, it gives the the error ValueError: {...
0
votes
1answer
51 views

In web3.js is it possible not to duplicate emitting of connection error events?

My smart contract has several events to listen for, and my dapp normally interacts with the contract through a wrap provided by the contract Web3.js abstraction. It would be nice for me to logically ...
0
votes
0answers
126 views

Filter event ethers.js sample code not working

I've been trying to follow the Listening to Events sample code and make a filter that detects when a specific address receives BUSD instead of DAI. However, it doesn't seem to do any filtering and ...
0
votes
0answers
54 views

Web3 Contract events not working on Ropsten testnet

Despite assuring that all event subscriptions are done through a websocket web3 provider instead of https, I still cannot get an event to return an info with " .on('data' ", however " ....
0
votes
1answer
138 views

Event logs vs Storage in Solidity

In my ethereum smart contract, I have a function that registers a user (by adding a user object to a mapping). I am also triggering an event after successful registration to notify the user about the ...

1
2 3 4 5
15