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
1answer
18 views

In a dapp application who listens to events?

In a dapp application who listens to events? the geth node or my node.js component (backend component? How can I implement the listen function in web3.js?
1
vote
1answer
45 views

Which component sends a transaction and which component subscribes to an event?

I am working on an ethereum project but I have some doubts. I have a backend that connects to the blockchain via web3.js. To connect to the blockchain I use a geth node. I understand that the sequence ...
0
votes
0answers
22 views

Listening for events on real time with Web3

I want to update UI elements of an app based on contract events. My problem is, that I do not receive any events that happen after the site has been loaded (seems like the subscription does not work). ...
0
votes
0answers
6 views

How to test if a transaction create a specific event using the trace api?

I need to frontrun a transaction on a specific contract only if does a specific thing which is fired as an event once included in a block. So how to get the event based on current contract state of an ...
0
votes
0answers
22 views

Python Web3 get all events

I am using web3 5.14.0 and Infura I am trying to get all transfer event for link chain token like the following: from web3 import Web3 ABI_REQUEST_ENDPOINT = 'https://api.etherscan.io/api?module=...
0
votes
1answer
27 views

What is the oracle component?

I'm trying to build my own oracle for a project (so I don't use chainlink or oraclize) and I've read this https://medium.com/@robinagist/building-an-ethereum-oracle-with-web3-js-1-0-1272b59cfc31. In ...
0
votes
0answers
12 views

Events and callback

I can't quite understand how events work with web3.js. Events work asynchronously and callbacks are executed when the result returns. These callbacks are already defined or I have to write them myself....
0
votes
1answer
14 views

Is there a way to see events in failed transactions

Let's suppose this solidity function: function myfunction() external { emit myevent("hello"); ... revert(); } As you can see, the function fires an event. In some ...
0
votes
1answer
38 views

How does myContract.events.MyEvent ([options] [, callback]) work?

I'm trying to understand how events work. My contract emits an event which is captured by the node (I'm using web3js). I need to extract the submitted parameters (msg.sender, id_, location_). I need ...
1
vote
0answers
38 views

interaction between the oracle smart contract and the oracle service [closed]

I want to modify this code to recover the temperature. the oracle smart contract issues a RequestWeather event with the city I need to know the temperature. The oracle node captures the RequestWeather ...
0
votes
1answer
47 views

myContract.events.MyEvent() vs web3.eth.subscribe('logs', …);

I'm confused about the difference between myContract.events.MyEvent() and web3.eth.subscribe('logs', ...); Both are subscriptions to events, correct?
1
vote
1answer
33 views

Retrieving very old events

While working with Infura in the past, if I remember correctly, I had troubles with retrieving events from old (non-recent) blocks. Does the trouble (not only with Infura but with other popular ...
0
votes
0answers
16 views

How to catch a solidity event from Java

I am trying to make a decentralized android application. It is an online two player Tic-Tac-Toe game. I have implemented the back-end with solidity and a part of the front-end in android studio. ...
0
votes
2answers
23 views

Is it possible to emit a mapping?

I have a mapping in my code that maps an address of a recycler to a plastic bottle address as below. mapping (address => address)plasticBale; Is there a way I could emit this mapping? or do I ...
0
votes
1answer
69 views

Ethers.js filters events (Only new events)

I have an event set up in the Contract. Contact Packages emit Spend(msg.sender, msg); function sendPackage(msg) external payable returns(bool) { require( msg.value == price, '...
2
votes
0answers
39 views

events and relationships between smart contracts and oracle smart contracts [closed]

How to subscribe a web3j client node to a smart Oracle contract event? Do I need the Oracle contract address?
1
vote
0answers
15 views

How can i get the name of an emitted event through the event abi (log entry, topics) of solidity?

I want to get the name of an emitted event from my contract using the event abi and web3j. This is the contract i'm using as an example for this question: pragma solidity ^0.5.7; contract ...
0
votes
0answers
20 views

Approval notification

Is there a simple way that I can be notified (or check easily) when my address (an EOA) is approved by some other address (EOA, not contract) for an allowance of x amount of any ERC-20 token? It seems ...
0
votes
0answers
18 views

Web3 - OR condition between multiple filters in getPastEvents

Take as an example the event PairCreated(address indexed token0, address indexed token1, address pair, uint); defined in UniswapV2Factory's contract. Let's say that I want to fetch all the past events ...
1
vote
0answers
19 views

Ethereum transaction events listener with AWS lambda

We are using ERC20 tokens in our application for our transactions. We are having a hard time as to how to keep track of pending transactions and users token balance. Ideally, we want to notify user as ...
0
votes
0answers
16 views

How can I access data of transaction topic?

I need to access the data from topic 2 below (see image): With this code I can render the topic hash, but not the topic data: contract .getPastEvents('allEvents', { fromBlock: START_BLOCK, ...
0
votes
1answer
19 views

Will event be emitted on failed transaction?

require(address(0) != address) _mint(address, 1) emit(address, some_other_info) If any part fails and transaction fails in general, will the event be emitted? Can the same event be emitted multiple ...
0
votes
0answers
121 views

Infura-Like caching layer to store all Events in local nodes for fast retrieve

Anyone who has tried to use a local Ethereum node to run any complex DApp will have realized that it is impossible to do so because there is a huge problem of slowness in the retrievement of large ...
0
votes
1answer
24 views

Solidity Event Handling

I have been trying to listen to the event of my smart contract; however, I receive the error. MyContract.events.myEvent( function(error, event){ if(!error){ $("#instructor")....
0
votes
1answer
43 views

How to handle a Solidity return value/event in JavaScript test? [duplicate]

I'm trying to create a basic ERC721 NFT, using OpenZeppelin contarct. I started with something similar to their example code: //SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; ...
0
votes
1answer
29 views

Event / Emit naming Convention

When I deploy the exact same contract on Rinkeby, other than the name of the event, Rinkeby behaves differently. When the Event's name is OwnerSet I can see that on https://rinkeby.etherscan.io/. ...
-1
votes
2answers
33 views

ERC-20 without events

I have created a non-compliant ERC-20 token that does not emit any events. I do not want to fix this bug, because fixing it produces other troubles. So, an ERC-20 token with this bug (not emitting ...
1
vote
0answers
39 views

How to watch/wait for events in JavaScript + Truffle?

I'm learning to develop Oracles, and, like all of us, I've encountered a dated article. After fixing all the Solidity changes (version, adding emit to fire an event, changing constructor function to ...
0
votes
1answer
19 views

ERC-1155 events for approval

ERC-1155: function approve(address _spender, uint256 _id, uint256 _currentValue, uint256 _value) external; /** @dev Allow other accounts/contracts to spend tokens on behalf of msg....
0
votes
0answers
12 views

Referencing events of interfaces in libraries

When writing a contract and using an interface, events that are part of the interface do not need to be declared in the contract. Can this be avoided when not writing a library and emitting events ...
0
votes
1answer
61 views

myContract.getPastEvents returns undefined event

I am using Web3 1.3.0. Connecting using Node. Also if I try to enter the name of my Event I get an error saying that event does not exist. This is what I get, shouldn't event have a value ? I am using ...
0
votes
1answer
37 views

High level tool (autogenerated UI) to obtain all the events emitted by the contract?

I'm pretty sure something like this exists, saw it somewhere in the wild, my Google skills need some StackOverflow boost... I would like to provide two data points: contract address name of the event ...
1
vote
1answer
62 views

How to use `topics` as an argument in `getPastEvents()`

I am currently attempting to collect data on token transfers. In order to accomplish this, I am collecting data using getPastEvents() and I am passing a filter object as an argument to collect ...
1
vote
1answer
25 views

Divide or not to divide in a smart contract?

I need my contract to create a ratio of two big integers (prices) output in an event. Which of two variants is better: divide in the contract using a math library; output two integers and let the ...
0
votes
1answer
84 views

How can I view pending events, without much delay?

I can view pending events like so: pending_events_filter = my_contract.events.TestEvent.createFilter(fromBlock='pending', toBlock='pending') pending_events_filter.get_new_entries() But the events are ...
0
votes
0answers
40 views

Read transaction logs of another Smart Contract

I have to track user activity in DEX smart contract and do some validation/operation based on that information. DEX itself does not API to retrieve that info, but emit events, so is there any way to ...
1
vote
1answer
172 views

how to decode log event of my transaction log?

I receive a transaction event in my log of my Ethereum transaction. .on('receipt', function(receipt){ console.log("address: " + receipt.logs[0].address); ...
3
votes
1answer
630 views

How to listen to contract events using ethers.js?

I need to listen to the specific contract events and do some task once the event is emitted. I didn't find proper docs on ethers.js documentation. Can anybody tell me how can I keep listening to my ...
1
vote
1answer
10 views

When an Ethereum transaction event occurs, is there a case when it was not included in the main chain later due to a fork?

I know Ethereum is a POW blockchain where forks take place. The transaction event is issued after executing the transaction on the node. If a fork occurs, is there a possibility that the transaction ...
1
vote
1answer
29 views

Events declared in library are missed in contract ABI

DYDX contract SoloMargin is firing events like LogTrade, LogSell but they are not provided in ABI. SoloMargin contract: https://etherscan.io/address/0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e#code ...
0
votes
0answers
39 views

Does Infura support Event Filters?

Does Infura support creating filters to Listen to events ? I have a dapp with many events, and would like to test it in Ropsten testnet and python web3.py, but it seems infura does not support filters....
1
vote
0answers
46 views

Can not run more than 1 event in Infura

I am trying to listening to many events from infura but it is not working. Only one filter work, when I add the second filter, this message appear: RuntimeError: cannot call recv while another ...
0
votes
0answers
42 views

Duplicate events from get_new_entries using web3.py

I'm struggling to understand how to properly poll events emitted from contracts. The provider I'm using is Infura. My code boils down to the following: filter = target_event.createFilter(fromBlock='...
1
vote
1answer
20 views

When to use indexed on events

Looking at the newer smart contract I rarely see "indexed" on events. Sometimes even event emiting is scarce, I would assume its to save gas on contract execution. So question is when would ...
0
votes
1answer
30 views

Recording Event Logs in a DB from a Smart-Contract

I have created a smart-contract and deployed to the Rinkeby Network, it has a client-side application which has been established with React. Now, I would like to observe and audit every transaction or ...
0
votes
0answers
39 views

How to display formatted transaction information in Remix IDE from web3.eth.getTransactionReceipt()?

tl,dr: Remix shows a formatted transaction summary for transactions that are initiated within the Remix IDE. Is it possible to display the same output for an arbitrary transaction hash? Sorry if this ...
0
votes
0answers
34 views

Subscribing to new blocks doesn´t work [ROPSTEN]

I'm trying to subscribe to newBlockHeaders on the ropsten network, but it does not seem to work. The following code works for mainnet but not ropsten. Any ideas? const Web3 = require('web3') const ...
1
vote
0answers
24 views

Events stop triggering after a while

I created a script that subscribes to PairCreated event on Uniswap using Web3 and Infura API. The event works for a few minutes but stops working after a while (timeouts?). How can I make it watch the ...
1
vote
1answer
210 views

ethers.js Why aren't logs filtering? (query returned more than 10000 results)

I'm building an API to scrape events from a contract suite deployed to Rinkeby. Here's an example function with some context: const network = getNetwork(parseInt(`${process.env.CHAIN_ID}`)); const ...
0
votes
0answers
10 views

Event listener works correctly from outside of the machine but not from inside the machine

I have created an event listener for my application. When I run the event listener from outside of the machine it listens correctly to all the events but when I run the same event listener (with ...

1
2 3 4 5
12