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
1
vote
2answers
791 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
959 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
86 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.
5
votes
1answer
258 views

Cannot catch every event (logs) from contract - catch a couple of random events instead

My contract has a transaction which fires an event. I was able to catch every event when I was sending transactions manually. But now I'm sending 100 transactions in cycle and get only 2..5 events. ...
3
votes
1answer
272 views

Using new operator and TypeError: Cannot read property 'event' of undefined

Here's the code: I compile these two contracts together and deploy Bar contract. After deploying it I have a contract account address where it has been deployed on the blockchain: ...
1
vote
1answer
414 views

How to watch for a transaction send by Node A from another Node B?

What I am struggling to achieve is the following: Node A sends a transaction. Node B starts watching for this transaction. When Node B sees the transaction in the latest block (ie not as a pending ...
7
votes
1answer
1k views

Event result parameters and arguments in console

I read about using events from this source http://solidity.readthedocs.io/en/latest/contracts.html#events I used a simple multiply contract: contract test1{ uint a; event event_res(string msg,...
2
votes
2answers
746 views

How to access events logs in ethereumJ ( java )

Accessing event logs from javascript is easy and straight forward, however I am trying to access the logs from the Java client. Any example code would help
7
votes
1answer
3k views

Current methods to send encrypted messages from contracts

I am trying to understand if there currently exists a method to send a message from a contract to another contract or a private address? What would the Solidity code for this look like? Perhaps events ...
7
votes
2answers
2k views

How to write transaction logs into a text file in geth?

I have made a contract which generates a public event on blockchain that will notify client about a transaction. To listen to the event I have written following snippet in geth console: var event = ...
2
votes
1answer
390 views

Any way to execute a Windows/Linux command from geth?

I am watching an event from a contract in geth, using the callback function, such as: MyEvent.watch(function(err,result),{...}) Once the event is detected, I would like to execute an external ...
6
votes
1answer
295 views

What are the benefits of using events over dedicated indexed variable?

Good day. I'm trying to grasp the concept of events in the EVM and I just can't understand what is the incentive of using events. Why not just use a dedicated public index that will hold information? ...
6
votes
2answers
2k views

How can I use “eth_sendTransaction” to invoke a contract and get logs?

I have deployed: contract test { function multiply(uint a) returns(uint d) { return a * 7; } } I can call the contract with "eth_call" : mpsp@ubuntu-slave2:~$ curl http:...
3
votes
0answers
25 views

No event after a struct push in solidity [duplicate]

I am testing a contract with Truffle, which code is : Contribution[] public contributions; struct Contribution { address participantAddress; string name; uint timestamp; uint amount;...
6
votes
1answer
395 views

Are events emitted from a contract synchronously?

Does anyone know how events emitted from a contract? I can't seem to find an authoritative answer while googling and I am kind of worried that they are synchronous.
2
votes
1answer
221 views

Can a contract that receives a token know the origin of the tokens?

Can a contract that receives a token know the origin of the tokens? (Assuming the token follows the token standard.)
11
votes
2answers
3k views

Ethereum event log maximum size

I'm thinking of storing some data in logs by emitting events but I cannot easily find the answers to the following questions: What is the total size limit of one event? Can I store lots of string32 ...
4
votes
0answers
474 views

sendTransaction and events not working in NodeJS app

I have a contract deployed on the testnet, I can do the following within geth: reference.transfer.sendTransaction(bob, 467, {from:me}) However I can't do this within my node console (with web3 etc. ...
8
votes
1answer
378 views

Cheapest way to store a hash for proof of publication

Can someone help me how to use events/logs for proof of publication? The way I understand it, I send a transaction with the metadata I want "proof of publication" for, to a contract. The contract does ...
9
votes
2answers
333 views

Why do I get serialization errors in calling events?

I have put some events in my contracts like this event TokenTransfer(address indexed sender,address indexed receiver,uint32 indexed num_tokens); event ExceptionEvent(uint16 indexed retcode,address ...
6
votes
1answer
1k views

How can i setup a web3 webservice that listens for events from my smart contract?

I have a smart contract that broadcasts events to web3 clients, upon each event being broadcast, the listening client makes a tx call to my contract. I would like to set up an 'always on' event ...
25
votes
1answer
2k views

Is searching data stored in event logs prohibitively slow?

Augur uses event logs to store data that never needs to be accessed on-contract, since it is about 10x cheaper than on-contract storage. However, I've noticed that retrieving event logs (e.g., using ...
3
votes
1answer
752 views

How to read responses from calls to contract methods made using web3.js?

I have built a contract which provides a simple method for storing some data in a property of my contract on the blockchain. I can interface with my contract using web3.js and I have no issue doing ...
10
votes
1answer
668 views

Given a contract address, can I determine when the contract was deployed?

Ideally the solution would use web3, but other solutions are acceptable. Motivation: Event lookups can be passed fromBlock field. If I know the block a contract was created, I can more accurately do ...
6
votes
1answer
285 views

Do events only work on an instance of a contract?

Does a contract address have to specified to watch for an event? Or, can I register an event handler for every time contracts of a certain type are transacted?
2
votes
2answers
514 views

How can I program my DApp to tell my user that their action/transaction has been confirmed?

Take an example of a voting DApp. A user clicks on a vote button, then behind the scenes the transaction containing the vote gets mined on the blockchain. The DApp then wants to alert('You have ...