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
4
votes
2answers
625 views

Web3 Event Filtering timeout

This is the code I use to get all events from a certain contract. Solidity: event NewEvent(address indexed contractAddress, address newBOPAddress, address payer, uint commitThreshold, bool ...
0
votes
0answers
7 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
12 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
1answer
50 views

Filter topic across multiple contracts

Is there something I could add to my contract which allows my application to filter for all the deployed contracts which also included this topic/identifier? The only other option to manage this I ...
1
vote
1answer
46 views

Accessing the Ethereum State Variables using web3js (Java Script)

I'm trying to run the below code to get the state variables using the getIdBytes method of the Smart Contract, and assign it to a java script array variable, but it doesn't seem to work. All I can ...
2
votes
1answer
113 views

Parity warp sync doesn't return event logs

Our Dapp uses events as a form of storage. For connection to blockchain we use local Parity node. A couple of days ago I needed to resync it after the server failure. After the resync all methods ...
0
votes
1answer
48 views

getting the latest holders address:balance for a smart contract

I managed to get all the transfer events from any given smart contract, but now I need to reduce that to current holder any idea how I would do this? Here is my code so far: import ERC20ABI from './...
0
votes
1answer
105 views

getPastEvents on localhost is not a function error

Now, I'm working on an Ethereum Blockchain project to transfer the ownership of stored devices by using local web3 provider at the truffle environment. Truffle v5.0.27 (core: 5.0.27) Solidity v0.5....
0
votes
2answers
581 views

Events with string argument not working (not indexed)

I am trying to listen to an event on rinkeby test which I run locally. Every thing works fine when my argument is int such as event EventTester(int values); When I change the event argument to string ...
1
vote
1answer
51 views

how to be notified about incoming transactions instantly?

I'm creating a platform which users are able to receive ETH on their own wallets (addresses). They will give the addresses to others, but the question is how can I be notified that new transactions ...
0
votes
0answers
9 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 ...
0
votes
0answers
12 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 ...
1
vote
1answer
391 views

Call `getPastEvents` with Drizzle raise error: “getPastEvents is not a function”

Calling getPastEvents with Drizzle will cause the exception: TypeError: this.drizzle.contracts.Contract.getPastEvents is not a function How to get all the past events in an array (in-one-shot) ...
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 ...
0
votes
1answer
145 views

In node.js event is not fired

I am using web socket to get event. sending transaction works fine. but event is not fired. also I referred Web3 events not working but it does not work, too. I used eventemitter also. but it did ...
0
votes
1answer
282 views

Web3js - Internal Transaction Data (Event Logs): Token Transfers, Contract Creations, & Internal ETH Transfers

I'm currently recording transaction data via Web3js, while directly connected to a local Geth full archive node via IPC, and I was wondering if there was a more elegant way to record internal ...
0
votes
1answer
47 views

Web3 event listener - timing issue when immediately retrieving contract values

I'd like to be able to immediately get a struct value from a mapping after calling a function that updates the struct, however, when testing with Ganache, sometimes the event arrives to the listener ...
2
votes
1answer
53 views

Unable to print event without JSONstringify

I am trying to understand the difference among following cases while printing the event: At web3.js listenToEvent: function(){ Contract.deployed().then(function(instance){ instance....
0
votes
2answers
36 views

Can events always be called directly by user accounts? Is there a way to make them internal?

I am using events to fire an order, basically using them as a vehicle for a master/slave connection with an IoT device, through the blockchain. Ideally i want to always verify the right msg.sender is ...
0
votes
1answer
66 views

Smart Contract Transfer Event Log Data & transfer _value [Rust]

I'd like to have a better understanding of events and logs data, more specifically when it comes to interacting with ERC20 tokens smart contracts and their Transfer events. I'm looking for a way to ...
1
vote
2answers
27 views

Is Ethereum fast sync feasible to get logs

I want to get the logs of an contract address by filtering the even with transfer Event. I cant use Infura for its restrictions and limits. So i want to sync my own ethereum node for myself. Since my ...
0
votes
1answer
61 views

A common error at time of using web3 options

When i use some web3 options as follows, I receive a common error i.e. TypeError: web3.[option] is not a function For example : TypeError: web3.toAscii is not a function web3.toAscii(...
0
votes
1answer
154 views

Viewing transaction events by using web3 on geth console

According to https://web3py.readthedocs.io/en/stable/contracts.html#web3.contract.ContractEvents.myEvent web3 allows to extract the pertinent logs from a transaction receipt: tx_hash = contract....
0
votes
1answer
23 views

Is there some possibility to listen MakerDAO's LogNote events?

I wonder is there some possibility to listen MakerDAO's LogNote events, like we able to do with standard events. What I managed to research: I saw that LogNote was listed as an event from contract ...
1
vote
1answer
259 views

About getPastLogs usage

"getPastLogs" can get past event log. I check the web3 documentation: fromBlock - Number|String: The number of the earliest block ("latest" may be given to mean the most recent and "pending" ...
0
votes
0answers
17 views

How to find a specific event if it has no indexed params

I understand that I can filter for logs with indexed events like so: event Transfer(address indexed src, address indexed dst, uint wad); whereby, I can search for all Transfer events with src=...
7
votes
2answers
11k views

How to listen to events using Web3 v1.0?

I have a problem when listening for events from my contract. Code js : var Web3 = require('web3'); var abi = '...'; var contractAddress = '0x62e7Dd1Af52d5A08D401b1e156cC4CB1d2f89d57'; var eventName =...
0
votes
1answer
34 views

Storing name values off-chain in events and web3.js

Somewhere I read the advice to store name (title, geographical name, people name, etc.) value off-chain in events. But if a value is stored in an event, is there an efficient way to retrieve its ...
2
votes
1answer
76 views

event not returning expected data

When I start my app I listen for posts from the latest block. After a post has been made I'm supposed to return author (address), title (string) and an id (uint). But what I get in the author and id ...
1
vote
1answer
41 views

Subscribe to events using local geth in light mode?

I've followed this guide to subscribe to events. I succesfully subscribed to the new block headers using Infura provider. But when I try to use local geth node syncing in light mode, it connects, but ...
0
votes
1answer
16 views

Functions that are used for token transfers for ERC20 and ERC721 tokens

Let's suppose there is a contract address A of an erc721 token B. If I want to monitor all of its transfers from A to another address say C then should I only filter the Transfer function or should I ...
6
votes
1answer
2k views

Etherscan: Effectively paginate `Event Logs` result

I am using Etherscan API for various Ethereum details. I need to find out the tokens transferred from a token original contract (let's say A) address to a particular address(let's say B). For this ...
1
vote
3answers
185 views

Reading the result of a function that change state by using events in Solidity

I would like to get the result of a function by listening its emitted event. These are two pieces of code of my contrats CONTRACT 1: function createTradeableContract() public stopInEmergency ...
0
votes
1answer
286 views

How to listen contract event in Python

The test contract is pragma solidity ^0.5.0; contract Test{ event Here(uint256 indexed a); uint256 public a; function add() public returns (uint256){ a += 1; emit Here(...
4
votes
3answers
3k views

How to expose Enum in Solidity contract?

If you create a contract with a function like: contract MyContract { enum MyEnum { Foo, Bar } event ThingHappened(MyEnum indexed _e) function foo(MyEnum _e) { // Code, code code... } } ...
0
votes
1answer
86 views

Can not see Solidity events

I can see events in a private net, but when I connect to "real" net, I can not see them. Meaning .watch(function(err, result) is never called. My theory is I am using lightning, and it probably means ...
2
votes
1answer
212 views

Alternatives to listen Events contract with web3.py?

I'm facing some issue/bug on web3.py, I need to listen my event contract, but event logs are always empty. I know the following issue on Ganach-CLI but may be there is other alternative. I already ...
0
votes
1answer
26 views

Array lenght and data miss match while storing data of events

Can someone help me in finding what is wrong here a why the length of task info is 0 even the taskInfo has some data. I'm using events to fill the taskinfo array. I'm stuck at this place for almost 2 ...
0
votes
1answer
31 views

Does variables inside Event gets stored in blockchain?

Hey I have following event event Submitted(bytes32 indexed docHash); The event is called by a function function submitHash(bytes32 docHash) public onlyOwner() { Submitted(docHash); } It ...
2
votes
1answer
131 views

Is it possible to have indexed bytes32 argument in an event?

I have an event with two indexed arguments orderId and status. Filtering works fine when I filter the event on orderId which is uint. I am not able to filter the events on the second argument (status)...
0
votes
2answers
264 views

Solidity event function not appearing in web3

I have a contract with the following event (using 0.4.24): event UpdateProgress(bool _gameInProgress); I am registering the contract like this: import Web3 from 'web3'; import address from './...
0
votes
1answer
324 views

Web3.js event.get not firing, whereas event.watch gives correct values

I am trying to do a simple test for events. Following is solidity code. Values received from chgEvent.watch are always correct. But in chgEvent.get, results1 is empty. chgEvent.get does not get ...
2
votes
1answer
223 views

Reliable way of listening to events on frontend

I make a web application, that needs the events from my contract to initialize it's state. I was using infura websocket provider, but it seems to lag a lot and close the connections unexpectedly ...
1
vote
1answer
267 views

Event unique identifier

The web3.js (1.0) docs helpfully list the return values from a contract event subscription. I've noticed that there is an additional return value id that isn't listed there but is returned with the ...
0
votes
0answers
26 views

Which Ethereum library is the one to use nowadays? Contract events on mobile must work

I used drizzle in our dApp and contract events work fine on Desktop browsers with MetaMask. However, on mobile (tested with Rinkeby deployment on MetaMask and Status on Android) the contract events ...
0
votes
1answer
22 views

How to use truffle-assertions to verify parameters of an emit?

I have not been able to find any resources with usage instruction besides github and blog post by the author On github an example is show as such: truffleAssert.eventEmitted(result, 'TestEvent', (...
1
vote
1answer
24 views

Correct approach of replicating smart contract balances

We are storing user balances on smart contract and as well as on our local db, so that we dont always have to query blockchain for user balance. For this we use contract events to update balances ...
0
votes
1answer
21 views

Why eth_getLogs returns empty result for Ethereum account address?

I'm developing an Ethereum platform and need to fetch the events log of a desired address. I found a code like this: curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics":...
1
vote
1answer
150 views

Solidity triggered event that shows a message to everyone who is currently in the site

Just a small question regarding how solidity event works. Let's say I have a function buyCandy(). At the end of the function I attached event: emit LogBuyCandy(msg.sender); event LogBuyCandy(address ...
0
votes
0answers
28 views

How to listen for contract creation, or all block events?

I'm building a web app with web3 where users can deploy a certain contract and assign some people to it. Inside the constructor of that contract I also output a certain event. I want these assigned ...

1
2 3 4 5
12