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
15 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
10k 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 ...
4
votes
2answers
620 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 ...
1
vote
1answer
38 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
15 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
177 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
255 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(...
2
votes
1answer
111 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 ...
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
211 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
25 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
30 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
318 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
222 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
263 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
24 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
21 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
19 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
148 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
26 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 ...
2
votes
1answer
358 views

Healtcheck on Websocket

I've looked through the documentation and haven't found that to be helpful. I would like to know the best way to do a healthcheck on my websocket connection to geth (Yesterday, I found out that I did ...
0
votes
1answer
335 views

Filters object not working for web3.eth.contract getPastEvents() method

I have referred, Web3 Events, but filters object is not working for me, I've got the same result for events before and after applying filter object. Here's the code: instance.getPastEvents( "...
0
votes
0answers
21 views

How to filter an indexed event parameter using web3j?

I am planning to use ethereum logs as a data storage on my private blockchain. I have defined event in my contract like this: event logDomainFilter(uint128 indexed _campaignId, uint128 indexed ...
0
votes
0answers
12 views

In EtherJs how to find account number of balance change event?

I am creating Ethereum Wallet application & I am using EtherJs for Web wallet development. When I try to listen for Balance Change event for multiple accounts then How do I find account number ...
0
votes
1answer
156 views

How do I watch Events from multiple contracts

I wrote a script that is able to read events from one contract address and then paste it into a .csv. Now I would like to extend that script listening watching/reading the same event of several ...
0
votes
1answer
144 views

Watching for events returns 0 blocknumber

I am trying to listen for recently mined events from a live smartcontract(EtherDelta). //https://github.com/praneethmendu/ethualizer/blob/master/backnd.js tradeEvent = contractIns.Trade({}...
1
vote
1answer
190 views

Remote geth node failing to retrieve past events

I have set up a remote geth node on AWS as a web3 provider for my DApp. The geth node is initialized with the following command (for testnet) as a daemon service: [Unit] Description=Ethereum go ...
0
votes
1answer
467 views

How to get only past 2 days events using getPastEvents everytime?

How can the following query be modified to only fetch the past two days worth of events: const events= await MyContract.getPastEvents("eventName", { fromBlock: 0, toBlock: "latest" });
0
votes
0answers
13 views

How can I listen for Truffle Actions such as TX_BROADCASTED, TX_ERROR via the Drizzle Vue Plugin?

In my Vue JS Dapp, which uses Drizzle Vue Plugin, I listen for contract events using $drizzleEvents like so: this.$drizzleEvents.$on('drizzle/contractEvent', (payload) => { this....
2
votes
1answer
287 views

Can we call two contracts in web3.eth.filter method?

I have two contract address and I want to check events on both in one call. I mean, can we pass two contract address in one option param like i do below? let web3 = new Web3(); web3.setProvider(...
1
vote
1answer
32 views

Watching for events

How come sometimes events show up on block explorers in hex and sometimes to you can see the actual string name of the event in the logs. I ask because my event watchers on my front end only pick up ...
0
votes
0answers
17 views

Ethereum Logs since Beginning of Time

I can subscribe to all events in ethereum network (logs, pendingTransaction etc) so I can get only newly generated events (while I am subscribed). For my analysis I need to retrieve all logs from ...
1
vote
3answers
485 views

Not able to export to csv all transfer events of a specific contract on Ethplorer.io

I'm able to use the Export to csv function, but it's only giving me the most recent 1000 events. Any suggestions on how to get ALL (2100+) of the events in a csv file? https://ethplorer.io/address/...
0
votes
1answer
321 views

How to prevent callback event occur twice?

Hi this is my web3 code events.watch(function (error,result){ if (error) { console.log('Error:'+JSON.stringify(error)); res.send({'status':0,'message':...
0
votes
1answer
14 views

How is data sent to the front-end by a View function?

I am required to send some data from a view-only function to the front-end. I tried using the standard approach by emitting an event with the required fields. However, when the emit call is placed ...
0
votes
1answer
363 views

Why myContract.events.MyEvent([options][, callback]) does not return “data” and “logs”?

We have an event as follows : event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner); This event is called in following function : ...
2
votes
1answer
180 views

Indexed arguments can't be retrieved, why?

Indexed arguments will not be stored themselves. You can only search for the values, but it is impossible to retrieve the values themselves. This is a quote from the following docs: http://...
1
vote
2answers
208 views

How to include the named of the called contract in Event Log

in my code I am using events in order to log some date. I would like to include the name of the contracts I am calling out of my main contract into this event log. Does anyone have an idea how to do ...
2
votes
1answer
286 views

How to filter indexed events and watch callback return value using Web3.py

For example, I have an event where using clusterAddress as key, I want to find the other arguments (storageID, desc, etc.), only having the clusterAddress indexed. I added the indexed keyword for the ...
0
votes
2answers
47 views

Subscribing to multiple Transfer events of various ERC20s

I need to suscribe to Transfer events of couple of different ERC20s in order to catch transfers to my contract. And here is the question: to catch all those events I need to create instance of each ...
1
vote
0answers
29 views

What is the maximum size of ABI in real world contracts?

To monitor my contracts during development and test in a private blockchain I’ve written an event explorer that encodes beside other parameter the ABI in an URL parameter. The ABI will be compressed ...
1
vote
1answer
793 views

Web3 Solidity events do not work any more in Chrome?

Ok, it seems like this issue is only present in chrome browser I am working with Version 64.0.3282.140 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit) Actually I had some ...
0
votes
1answer
722 views

Proper way of using allEvents()

I'm trying to get all events for a contract: let events = token.allEvents({fromBlock: creationBlock, toBlock: 'latest'}, (err, res) => { try { let result = events.get(); ...

1
2 3 4 5
11