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
1answer
2k views

How do I filter an event by the hash of the transaction that generated the event?

I read the following in Andreas Olofsson's answer: Events can also be filtered by the hash of the transaction that generated the event Would someone please post an example of how to do this with ...
10
votes
4answers
496 views

How to watch log for all instances of a specific type of contract?

Attaching a watcher for every instance of a contract is not a good idea in terms of memory and CPU. So is there a way to watch for events from all instances of a contract i.e., by registering a single ...
1
vote
0answers
18 views

How to read all the logs [duplicate]

I am wondering is it possible for me to read the event log of any contract in the blockchain? if yes how to do it? using web3js is there any snippet code to perform such task?
4
votes
1answer
166 views

Paging through log of events

I'm trying to use log events to show the transactions from newest to oldest. The problem is that line like this contractHandle.allEvents({ fromBlock: startingBlock, toBlock: 'latest' }) ...
5
votes
3answers
833 views

How can I read log/events that have been triggered in the past?

I have a smart contract with an event. event NewContractCreated(address _callerAddress, address _newContractAddress); I know how to actively listen for new events: var newContractEvent = ...
0
votes
1answer
56 views

Send 1% of Ethereum sold by one account to another

I made an arrangement with a friend in which he agreed to give me 1% of all the Ethereum that he sells at the time of sale. So he owns 100 Ether today; in 1 year he goes to sell 10 Ether, I would be ...
5
votes
1answer
355 views

Filtering logs for entries greater than a specific value

I know that you can filter logs in web3 by topic using: web3.eth.filter({ topics: ["0x00..."] }).watch(console.log) Is it possible to filter for a topic value greater than a given value?
3
votes
1answer
1k views

How to extract all event logs from the blockchain?

I'm trying to extract all event logs from the blockchain, this is how I called an Event in the smart contract. function rateBook(uint id, uint rating, string comments) onlyMember { if (id > ...
16
votes
2answers
2k views

How do I retrieve the Voted events from TheDAO?

This question was asked by @Pablo Yabo in the comment section of the question How can I view The DAO proposals including the current voting status?.
1
vote
1answer
760 views

How can I log an event with indexed fields in Remix?

As you can see below, the indexed field is ignored, and the last field is set to zero: contract MyContract { event MyWorkingEvent( address thing4, address thing5, address ...
7
votes
2answers
1k views

Problem accessing array inside struct

Dealing with the code below: contract myContract { struct myStruct{ bytes32 name; bool active; uint[] changes; } myStruct[2] myStr; uint[] steps; Event ...
2
votes
1answer
647 views

Calling a smart contract in response to an external event

I am trying to log all access operations on a file storage in Ethereum. The access operations are read, write, update and delete. Every time, a user does any of these operations on the file storage, I ...
5
votes
2answers
2k views

Alternative to filter.watch()

Here's a scenario: Dapp backend connects to a remote Ethereum node using external HTTP RPC: const web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/janNFDJkMgDfan")); Dapp ...
2
votes
1answer
397 views

Pushing a struct to an array prevents logging

I'm getting a strange error in Solidity. I have the following public function: struct Bid { address bidder; uint amount; /* in wei */ bool home; /* true=home, false=away */ int64 line;...
1
vote
0answers
38 views

Date-Span in Event Filter

Want to provide an interface on my page to show filter based event data. Haven't come across a proper working example to fetch event data by providing a date span. So it will be helpful if one could ...
4
votes
1answer
631 views

web3: are event/filter results guaranteed to be sorted by block number?

I see that the results of past events which I get via MyContract.MyEvent({}, { fromBlock: 0, toBlock: 'latest' }).get((error, results) => { console.log(JSON.stringify(results)); }); are ...
0
votes
0answers
702 views

Regarding Event Generation Cost

Lets say events are invoked from all the methods of a contract. Each event is storing some data. The methods where only computation or data fetching logic is applied will it cost ether if any event is ...
22
votes
3answers
13k views

What does the Web3 “BigNumber not a base 16 number Error” mean

Is there a known problem with parsing events containing strings in Truffle/Web3? I'm using truffle with the following simple contract contract Board { string foo; event Shout(); event ...
1
vote
2answers
319 views

Managing complex smart contracts using events only

I have a question about how one can deal with complex smart contracts in ethereum. Let's assume i have to deploy and interact with a smart contract that has a lot of functions, and each call to a ...
3
votes
1answer
1k views

Printing into console: Events TypeError - 'watch' is not a function

Printing into console I need to print out values like these green lines: 1) Tried returning When I call a function that returns a string, the hexa transaction address gets printed instead of the ...
1
vote
3answers
75 views

Contract not getting deployed when event traces are added

I am not able to deploy the contract when event traces are added. Please help me figure out what is going wrong here. When I remove trial event() , I can deploy the contract. pragma solidity 0.4.8; ...
3
votes
2answers
3k views

How do you get events from a function in another contract?

I have two contracts : // contract #1 contract eXample { // intizializer function eXample{ ..... } //creating the Event event MyEvent(uint x,uint y,uint z); function doSomething{ ........
4
votes
1answer
954 views

web3: Do I need to `get` past events and `watch` future events separately?

As discussed before I managed to get past events via myContract.myEvent({}, { fromBlock: 0, toBlock: 'latest' }).get((error, results) => { But it seems that for future events I need to watch for ...
1
vote
1answer
1k views

What is the function event? [duplicate]

can some please explain what is event in solidium...what we can do with event in our contract...it will be nice if you kindly explain with some code....u can use the following code to explain with ...
6
votes
2answers
1k views

How to access contract events through RPC?

I'm trying to figure out how to log events happening in a contract at a private Ethereum network. It looks like Events are the way to go. However, I can't seem to find any good example of how to ...
1
vote
0answers
757 views

How to continue to watch the `Events` from the point `geth` was closed?

I have a private Ethereum network. The bootnode(main node)'s goal is to watch Events and if a new Event is generated than trigger a contract's function that I want to run. The key point is triggered ...
3
votes
1answer
343 views

How to improve events watching?

Happy new year to everyone. Watching my contract events is quite time consuming (more than 15 sec to find the first event). I'm using this kind of command in my geth console : mEvents = myContract....
3
votes
0answers
777 views

ERC20 Transfer Event error or intended?

I'm trying to get an Event "Transfer" for the ERC20 Token with web3 function getTransactionReceipt event Transfer(address indexed _from, address indexed _to, uint256 _value) You can see the term ...
3
votes
2answers
137 views

Why does having multiple functions with events prevent proper execution?

I am relatively new to Ethereum, so I apologize if there is an obvious answer to this question. I am running a private blockchain to test contracts on. I have a very simple one, where there is one ...
3
votes
1answer
444 views

Is it possible to use events to implement server-like functionality?

In the documentation and suggested links and this question, it is mentioned that events are bound to methods and fire when a method is called (via a transaction). There is an example of a contract: ...
4
votes
2answers
1k views

Monitoring events from multiple contracts

I'm working on a project that allows users to automatically deploy a specific contract that I created. It's important for the system to be able to listen to specific events (for example, new ...
4
votes
1answer
62 views

Can client updates / upgrades be pushed over the ETH network?

Is it possible for ETH clients to securely receive a live push notification/version update like the way OSX, MacOS does? What are the pros and cons? : ) There could be a contract filter to gain ...
5
votes
1answer
1k views

How do geth and parity handle notifying clients of events after reorgs?

If you set up an event listener with Geth (I assume also with Parity) you get notifications when a particular event shows up in the event logs. Sometimes a reorg will happen, and the block where that ...
3
votes
0answers
120 views

Contract works fine in Solidity-browser but not against private node

I have been testing a contract using the Solidity Browser, but when I deploy the same contract on my private node, it doesn't seem to work the same as in the Solidity Browser. I have tried manually ...
1
vote
0answers
41 views

Are all events registered forever in the blockchain? [duplicate]

Are all events registered forever in the blockchain? If I build a client may I see all the events that have ever occurred using web3.js?
3
votes
1answer
380 views

Why cannot catch events retrospectively using filter (eth_newFilter)?

I've put the same filter with eth_newFilter before and after a set of transactions. The one which is installed after transactions catched 0 events. Is it how events work? Is there any other way to ...
8
votes
1answer
3k views

Why use filters - eth_getLogs vs eth_newFilter

It seems to me eth_getLogs is much simpler than eth_newFilter + eth_getFilterLogs. eth_getLogs has no need for installation, got same parameters, catches events retrospectively. What are use cases ...
1
vote
1answer
70 views

Why isn't my array kept in storage

I'm a newbie at ethereum development (which I'm very enthusiastic about) and I'm trying very hard to create my first smart contract. It's a test contract to bet on horses race. I'm currently facing ...
5
votes
1answer
114 views

Getting event history takes a really long time or doesn't work at all

I'm having trouble getting a history of events. I'm unsure if I am misunderstanding how events work, if I'm coding wrong, or if it has anything to do with the recent Ethereum attacks slowing down the ...
8
votes
1answer
689 views

Will I be able to get past contract events through rpc if I use geth --fast?

Or in other words, will geth --fast download the events logs?
4
votes
2answers
242 views

Logging errors in the fallback function

In the code I return any Ether sent by mistake to contract C with the throw; statement inside the fallback function. I also want to make a log of this occasion. The following code doesn't work(throw; ...
2
votes
1answer
263 views

Is there a way to view all events on all blocks for Eris Blockchain?

is there a way to view all events on all blocks for Eris Blockchain? Currently I've managed to just subscribe a particular event Contract contract IdisContractsFTW { uint storedData; string name;...
3
votes
0answers
77 views

Can a solidity event be logged successfully before a throw? [duplicate]

If I have the following code in a solidity contract function: event_logEvent(); throw; Does the event get logged correctly into the blockchain or does the throw also revert all the events?
1
vote
0answers
437 views

Need help understanding Events

Here's an example from solidity docs: [SOLIDITY] contract ClientReceipt { event Deposit( address indexed _from, bytes32 indexed _id, uint _value ); function ...
3
votes
1answer
309 views

How to reduce eth.filter.watch delay?

I have a test contract that emits events. I'd like to create a web app that shows a list of all created events + new ones as they arrive. I'm using Meteor app connected to geth 1.4.10 through rpc. The ...
2
votes
1answer
388 views

monitoring deposit or withdraw using web3js

I know I can send ether to another account using web3.eth.sendTransactions. I also want to get confirmation when a transaction has been successfully broadcasted to the ethereum network, or when an ...
4
votes
2answers
496 views

Is it possible for a function to wait for another users approval?

I have a simple function in contract x that subtracts a value from contract y, is it possible to have contract x send a message to the user of contract y and set a condition that untill user confirms ...
1
vote
2answers
875 views

Events called in constructor function

how to watch events in web3.js when the event is fired from inside the constructor functionof a contract? Eg: contract A{ event Invoked(string); function A(){ Invoked("constructor invoked!");...
2
votes
1answer
1k views

Event result documentation

The current documentation does not go into detail about the structure of the result returned by an event. In this thread and this question, there are mentions about the fields of the result returned ...
1
vote
1answer
91 views

How do I retrieve the event data related to the creation and transfer of The DAO tokens?

How do I retrieve the data related to the creation and transfer of The DAO tokens? This data will be useful to trace the movements in The DAO balances.

1
8 9 10
11
12