Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
1answer
135 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 ...
1
vote
3answers
1k views

Find topic[0], topic[1], topic[2]

As suggest in What is topics[0] in Event logs? I am trying to find out 'Event hash' but it's not matching the output for below transaction. Input Data Function: transfer(address _to, uint256 _value)...
1
vote
1answer
75 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 ...
3
votes
2answers
208 views

What is the difference between getPastEvents() vs events.MyEvent({ fromBlock: 0})?

What is the difference between using myContract.getPastEvents() to get past events and using myContract.events.MyEvent({ fromBlock: 0, }) ? Also, if I pass to fromBlock a block number that has not ...
0
votes
1answer
7 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) ...
3
votes
1answer
92 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
1answer
84 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 ...
0
votes
0answers
5 views

drizzle not updating events properly - duplicate events

I'm facing a peculiar problem while rendering event values in a component using drizzle. When a new event is created and is updated in the events array of drizzle (drizzleState.contracts.MyContract....
1
vote
3answers
79 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 ...
1
vote
2answers
65 views

Events loading too slow

I have a dapp running on rinkeby at the moment, you can try it now on cryptogol.io, but I am facing a problem when reading events from the Blockchain. For example, yesterday I make the events happens, ...
0
votes
0answers
13 views

How to handle events using drizzle?

strange that after much searching, i havent found even one piece of info out there which clearly elaborates on how the events are manipulated in drizzle. From what i understand, the event names (and ...
0
votes
1answer
82 views

How to get EVENT name from event signature hash?

I fount that some developers can get event_signature_hash for a event's name MyEvent(uint256) by using bellow code: event_signature_hash = w3.sha3(text='MyEvent(uint256)').hex() But vice versa, I ...
27
votes
1answer
8k views

What are event topics?

I know that indexed arguments index the values for those arguments so that filtering will be faster. But what are topics? And what are they used for? I know that signature of an event is a topic. ...
0
votes
1answer
34 views

why several Draw event logs when there is actually one?

I'm looking into the event logs of makerdao's CDP operation, and I'm confused why there are several event logs for 1 cdp operation, like this tx: https://etherscan.io/tx/...
1
vote
2answers
327 views

Solidity event listener

This web3js event listener is part of a Voting Dapp. The listener listens for a transactions and re-renders the page to show updates. listenForEvents: function() { App.contracts.Election.deployed()....
0
votes
2answers
337 views

Do Etherscan stores all the events and transaction history?

To get the history of a transactions for an account, we have to traverse the whole chain everytime, but etherscan provides the entire history of all the accounts instantly. Similarly it does the same ...
1
vote
1answer
99 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 ...
1
vote
1answer
106 views

How to stop listening to all events of contract

I am using the JavaScript API in my truffle tests to get the events from the contract: https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-allevents const allEvents = instance....
1
vote
0answers
43 views

using events in private blockchain raises leveldb not found error

i'm getting { [Error: Node error: {"code":-32000,"message":"leveldb: not found"}] when trying to use events on a private eth blockhain. What might be the problem? (I've installed Leveldb with brew) ...
1
vote
1answer
113 views

Getting all ERC721 transactions by an account

My approach here was to listen for Transfer event for a contract (e.g. Cryptokitties) filtered by the indexed from account. var contract = new web3.eth.Contract(kittyABI, kittyContractAddress, {from:...
0
votes
1answer
28 views

Recover solidity funcion event in web3j

EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName.LATEST, userContract.getContractAddress().substring(2)); I am trying to recover the event response that ...
2
votes
1answer
39 views

Ethereum smart contract update, transactions and events

I have a question about versioning of smart contracts in Ethereum. Lots of articles have been written about how to decouple your logic and data, how to use interfaces when referencing other contracts, ...
2
votes
1answer
123 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 ...
2
votes
0answers
15 views

Accessing the network through light node

I've been trying, unsuccessfully, to make a web3.py app that needs to catch events, with the use of filters. After hours and hours of testing it appeared the problem was that Infura, which is the ...
0
votes
2answers
32 views

How to get events emitted by a transaction with web3.js

I'm writing a user interface in Javascript and I'm using the web3.js library. I have the transaction hash of a confirmed transaction. I would like to get an array of all events emitted by that ...
1
vote
1answer
126 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
117 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 ...
3
votes
2answers
57 views

Do logs/events last forever?

https://thegraph.com/ seems to rely on the assumption that events will last forever. But this post: https://www.reddit.com/r/ethereum/comments/a2ocy6/full_notes_from_fridays_eth_1x_sync_call/ seems ...
0
votes
1answer
21 views

Who Receives An Event?

I have a smart contract that emits an event, and I've set-up a listener in my client-side app that can register this event. But I'm curious, who receives this event? If say 20 different people from ...
0
votes
1answer
123 views

Iterating through events

I have events (fired some time ago by the contract) containing numbers. I need to load them all, and then to draw a chart. What I do: contract.getInitBlock(function(error, value) { var ...
1
vote
2answers
133 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
130 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://...
0
votes
1answer
124 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(...
3
votes
2answers
675 views

How to Listen to Contract Events in Drizzle

Let's take the example of the SimpleStorage contract that comes with the truffle box drizzle-box How can we listen to the event StorageSet and console.log it to the JS console? drizzleOptions.js ...
0
votes
1answer
481 views

watching for events in web3 v1.x.x

I deployed a contract and would like to watch for events on that contract. var access_manager_erc20_abi = require('./AccessManagerERC20_abi.js'); //To read the abi. //In this js file i export abi ...
3
votes
0answers
117 views

Problem with multiple event listeners, duplicated event triggers

In my app i have multiple listeners (watchers) on different events of same contract. Nothing complicated. let songAddedEvent = instance.SongAdded({}, { fromBlock: 'latest', toBlock: '...
0
votes
0answers
14 views

Get the entries of an event by an event filter in web3.py

here is my Solidity Contract: # Solidity source code contract_source_code = ''' pragma solidity ^0.4.1; contract Identities { event ExistProduction(bool); address private owner; mapping(address =&...
2
votes
0answers
23 views

Truffle test to verify events can be queried by the address of the signing user?

I'm trying to write a test which verifies I can query a given type of events by the user/address which sign them. I would like to apply TDD (relevant to say I haven't made the implementation for this ...
0
votes
1answer
21 views

How to interact with events from a smart contract?

can we get access to watch the event and get logged data from them and use it for processing in a smart contract? Like matching an state variable with the data logged by an event .
4
votes
1answer
124 views

List holders and tokens for an ERC-721 contract

Given a contract, I want to map the holders to their token ids. For example, the contract 0xFBeef911Dc5821886e1dda71586d90eD28174B7d is an ERC-721 contract for KnownOriginDigitalAsset. Etherscan ...
0
votes
1answer
165 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 : ...
0
votes
1answer
196 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" });
1
vote
1answer
166 views

How to read “allevents” using Python web3 (there's capability in web3.js)?

Is there a mechanism to create a listener for all events being emitted from a smart contract for the python web3 library. There is a way to do it in web3.js: myContract.events.allEvents([options][, ...
0
votes
0answers
56 views

Indexed event parameter only returns 1st character in address

pragma solidity ^0.4.13; contract OwnedI { /** * Event emitted when a new owner has been set. * @param previousOwner The previous owner, who happened to effect the change. * @param ...
0
votes
0answers
428 views

Truffle Test Sell Event Assertion Error

When I test my selling event in truffle.So, the following error comes:- The solidity code is :- event Sell(address _buyer, uint256 _amount); // Buy token function buyTokens(uint256 _numberOfTokens) ...
2
votes
1answer
190 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
1answer
199 views

How to see event name in etherscan.io transaction event log?

In etherscan.io, I want to be able to see the event name (signature) in the transaction page event log, like here. Currently, I don't see it here. I'll note that the transaction is indeed sent to a ...
4
votes
2answers
45 views

My contract is not emitting events

This is my contract: pragma solidity ^0.4.22; contract Test { event Deposit( address indexed from, uint amt ); event Withdrawal( address indexed to, uint amt ); address owner; constructor()...
2
votes
2answers
221 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
2
votes
1answer
200 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 ...