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
1
vote
0answers
7 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
7 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
10 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
12 views

How to watch for events with web3.py python

I am trying to watch for event with web3.py but I keep getting an empty list. Below is my current implementation. def handle_event(events): print(Web3.toJSON(events)) async def log_loop(...
0
votes
0answers
13 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
7 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
15 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
1answer
20 views

How to do delayed Execution 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
19 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
37 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
27 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
17 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
29 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
63 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
41 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
26 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
59 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
28 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
78 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 ...
0
votes
1answer
26 views

How to subscribe to native Ethereum transfer from Argent wallets?

I am wondering how do I subscribe to native ETH transfer events such as this one https://etherscan.io/tx/0x7357f1f0885811b2888dad7e7b1aa0f3016c7b0f8a179e37e463d5e941889bab#eventlog with topic[0]: ...
0
votes
0answers
23 views

Web3js: getPastEvents returns wrong transaction hash and blockhash

I 'd like to get all past events of a ERC20 token contract using web3js getPastEvents method. On my local testnet it worked but including some invalid values in response. Here is my JS code. var ...
1
vote
1answer
41 views

Is it possible to check if a contract has an event?

I'm iterating through different blocks with the intent of finding every block in which an nft is deployed. I plan on doing this by checking for openzepplines ERC721 event. How do I check if a contract ...
0
votes
0answers
30 views

What is 'changed' event in web3.js?

Web3.js provides a measure to create an abstraction over a smart contract, which may be used to listen to its events. There are four event types such as data, changed, error, connected. The second ...
0
votes
0answers
88 views

What are the best options to listen to smart contract events in real time using websockets with web3.py

I am currently building a dapp, it has a backend that should listen to the smart contract events to check if a transaction happened or not. To my knowledge web3.js provides a way to subscribe to ...
0
votes
0answers
13 views

Is it possible to listen for an anonymous event with 100% certainty?

Anonymous events do not contain their signature in the topics. Because of that, you cannot easily search for them. However, if you know what arguments an event takes, you can guess it - if there's ...
1
vote
1answer
160 views

How do I decode bytes32 using Ethers.js

I'm listening for an event: OrdersMatched (bytes32 buyHash, bytes32 sellHash, index_topic_1 address maker, index_topic_2 address taker, uint256 price, index_topic_3 bytes32 metadata) This is what I'm ...
0
votes
0answers
9 views

Listen events synchronously using web3js

I am listening two events like this. contractConnection.events.allEvents(options).on('data', async (data) => { if (data.event == 'AddData') { await this.storeSecondarySale(data....
0
votes
1answer
38 views

How to get list of all emitted events in truffle console?

I wrote a very simple smart contract which emits an event everytime I call one of its functions: pragma solidity ^0.8.0; contract MyContract { event Score( uint date, string ...
0
votes
1answer
227 views

Testing arguments of contract events with hardhat + chai

I'm currently using chai with hardhat and ethereum-waffle to test my smart contracts: const chai = require('chai') const hre = require('hardhat') const { solidity } = require('ethereum-waffle') chai....
0
votes
2answers
30 views

how can i send a transaction in spesific block numbers with web3Js?

I wanna know how to send the transaction in spesific block numbers with web3js ( Yes its for sniping bot ) The purpose is to avoid the tax in 1-3 blocks since liquidity is added For example : New ...
0
votes
1answer
9 views

Are events only useful for loggin purposes?

After reading a bit of documentation about events and reading some answers here, I don't really get why events are useful in solidity. Emit an "event" means to notify listeners about ...
0
votes
0answers
46 views

How do I listen to Contract Events in my Express App?

I have a Smart Contract rps. I want my express app to be able to listen to its events. My express app: require("dotenv").config(); const express = require("express"); const app = ...
2
votes
0answers
48 views

eth_getLogs and some missing logs

I have an indexing software that scans the blockchain for certain events. It works continuosly using eth_getLogs over my nodes. It works perfectly, but I'm seeing that sometimes I'm missing some ...
0
votes
0answers
17 views

getPastEvents OR filter across two parameters

Web3 allows one to filter events by indexed parameters (see here). For example: {filter: {myNumber: [12,13]}} would pull only events where “myNumber” is 12 or 13. Is it possible to filter across two ...
1
vote
1answer
25 views

Dealing with ethereum LOG1-2-3-4 opcodes: How to parse them correctly?

I'm trying to do some analysis of events from the opcodes of transactions, but I'm finding it very hard to understand how can I find the index_topics and the values returned by the event. For instance:...
0
votes
1answer
28 views

Getting specific values from Web3js getPastEvents

I would like to know how to pull the account value from returnValues: Result {} of this web3.eth.Contract This code logs to the console just fine, but I have scoured documentation on objects and on ...
1
vote
3answers
76 views

Best way to automatically update balances displayed in front end

Im trying to figure out the best way to automatically update balances in front end upon receiving and sending tokens. Ive tried creating an instance of a token in my react app, then creating an event ...
1
vote
1answer
1k views

Listen to events in the Polygon network using Web3.py

Just started looking at Web3 and I'm currently trying to listen for an event emitted by a smart contract on the Polygon network by using event_filter = contract.events.<MyEvent>.createFilter(...
1
vote
1answer
361 views

How much gas does it cost to emit an event?

How much gas does it cost to emit an event? Is there a formula for calculating how much gas the emission of an event will cost given that its parameters sum up to n bytes of data? Any info or ...
0
votes
1answer
599 views

Ethers.js transfer event filters

In my dapp I'm building I want to update the contracts' balance of an ERC20 token automatically using the transfer event from the token contract. I have created the contract object using: const ...
0
votes
0answers
117 views

How to get all addresses that have had successful transaction in the last polygon block?

I need to listen for special events on some contract addresses in Polygon/Matic blockchain; However, my provider has limitations on the number of possible subscriptions. So, I have to get all the ...
1
vote
0answers
9 views

Possible Security Issues On Web Layer Payment Request and Confirmation

This is more likely a design consultation rather than an issue. I want to introduce additional standards in ISO20022 to promote crypto payment through common payment interface to eliminate 3rd party ...
0
votes
1answer
171 views

Indexed events not returning values when decoded

I had asked this question but I omitted some info as I (wrongly) assumed that the omitted info was not part of my problem. When you emit an event like so: event ChildCreated(address indexed creator, ...
0
votes
0answers
57 views

Event not returning indexed parameters when decoded [duplicate]

EDIT: I had omitted some data from my code as I thought it was not the one causing the error turns out I was wrong. Here is the question with the appropriate data and solution. ..... Ignore the text ...
1
vote
1answer
297 views

The current provider doesn't support subscriptions: HDWalletProvider on Polygon (matic) blockchain

I use wss://rpc-mainnet.maticvigil.com/v1/MY-APP-ID as my polygon dApp provider, however I cannot subscribe on newBlockHeaders event with the following error: Error: The current provider doesn't ...
0
votes
0answers
48 views

How to Decode Anonymous MakerDAO LogNote Events using Ethers

I'm trying to decode (anonymous LogNote) transaction logs created by the MakerDAO vat contract (https://etherscan.io/address/0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B#code). // --- Logs --- event ...
0
votes
0answers
17 views

How to subscribe to events in brownie

I am having trouble subscribing to events with brownie. My interface is imported with from brownie import interface From there, I have access to the external methods but not the events. I have found ...
3
votes
3answers
241 views

Why can't smart contracts access events

Looking through posts here most refer to the doc saying that smart contracts can't access event data. The Log and its event data is not accessible from within contracts (not even from the contract ...
0
votes
0answers
106 views

How can I listen emitted events from BSC network

How can I noticed and get the results of events whenever events are emitted on BSC network. I have tried web3.on() method, but the on() method can work with WebSocketProvider and BSC network does not ...
0
votes
0answers
82 views

Detecting `accountsChanged` and `chainChanged` with ethersjs?

I'm not sure if this question makes sense or if I'm looking at things correctly but it's coming from my understanding that ethersjs is an abstraction on top of MetaMask (and other providers)... I've ...

1
2 3 4 5
14