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

Is there any point in adding msg.sender to an event?

I am asked to provide the value of msg.sender as part of an event emitted in a function. It is something like: contract MyContract { event MyEvent(address indexed sender, uint256 input, uint256 ...
2
votes
2answers
92 views

assertEventEmitted from new contract construction call

At present there is no way I can see or is documented to be able to easily use something like this with the truffle framework: So using chai and writing a test to deploy a contract with something ...
2
votes
3answers
386 views

Event firing before data is actually set

Let's say this is my smartcontract: event NewUser( address userAddress, uint amount ); function addUser() public payable{ require(msg.value <= maxValue && msg.value > ...
2
votes
1answer
67 views

How do events influence a transaction's gas?

Since events are stored in the transaction receipts trie they should influence the gas a transaction costs since storage costs, right?
2
votes
2answers
189 views

Event not found in Contract

I am trying to access an event from my contract to observe in Javascript. I expect to get c.QuantumPilotKeyPurchased but that is undefined var web3 = new Web3(new Web3.providers.HttpProvider("http://...
2
votes
2answers
1k views

How to get only latest log from my event?

I currently am using Oraclize in my contract and I make a call to a contract function from my front-end and don't want to continue onto the next call until the Oraclize function has returned. So I ...
2
votes
1answer
939 views

Best way to track block transactions as they happen

I found this repo, which retrieves recent gas prices using web3: https://github.com/ethgasstation/gasstation-express-oracle/blob/master/gasExpress.py I'd like to write a similar script that would ...
2
votes
3answers
1k views

can not receive the event?

My web3 version is web3@1.0.0-beta.26, I am deploying the contract on the localhost:8545. Here is my contract example. pragma solidity ^0.4.18; contract LocalEthereum { address public owner; ...
2
votes
2answers
385 views

The quickest method to receive new blocks

Please excuse my lack of knowledge on some aspects of how Ethereum works. I'm creating a DAPP that uses web3 to communicate with the blockchain. I have the need to receive events from a certain ...
2
votes
1answer
4k views

Web3.js Filter Events

My Dapp needs to dynamically deploy contracts. As such, I need to store the addresses of these contracts somewhere and opted for the following solution: Log creation event Retrieve contracts based on ...
2
votes
1answer
638 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 ...
2
votes
1answer
101 views

Are events only useful for real-time listening by dapps?

Why would I need to use events when I can access a contract's variables through the automatic accessor functions? Please explain the use of and/or need for events.
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;...
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 ...
2
votes
2answers
795 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
2
votes
1answer
229 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.)
2
votes
2answers
556 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 ...
2
votes
1answer
44 views

web3.js: call event handler after N confirmations

web3.js seems to call the event handler of an event directly upon confirmation. I would like to know if it is possible to call an event handler only after e.g. 5 confirmations using web3.js. Is that ...
2
votes
1answer
160 views

Error trying to get events in web3.py via Infura

I was trying to get all events from my smart contract (in Ropsten) via Infura node. The problem is that I know that Infura does no support creating filters, but I don't know how to get events by ...
2
votes
1answer
262 views

How to listen for events at a specific contract

I am new to the world of web3 and trying to learn how to listen for events. I've been googling and reading for a while and can't seem to get something working. I'm able to subscribe to ...
2
votes
1answer
33 views

Event and method different address type

This is my contract pragma solidity ^'0.5.2'; contract MyContract { address[] public contracts; event ContractCreated(address newAddress); constructor() public { } function ...
2
votes
1answer
147 views

How to handle require/revert/assert errors properly

I'm trying to find an easy pattern to revert/rollback a write transaction. The first idea was to log a GenericErrorEvent but then I noticed that it will never be emited if any require/revert/assert ...
2
votes
1answer
2k views

How can we parse and deal with BigNumber (BN) args in Solidity events?

In the past, web3 events published numeric events like so: BigNumber { s: 1, e: 17, c: [ 1000 ] } } Now with web3.js 1.0, big numbers come down as objects like this: <BN: de0b6b3a7640000> ...
2
votes
1answer
38 views

Can ethereum logs be present while transaction is being mined, then disappear later?

Question about the ethereum blockchain: If I walk the blockchain like so: for block in blockchain: for transaction in block: receipt = getTransactionReceipt(transaction) for log ...
2
votes
1answer
141 views

Deploy contract with truffle, how to call in Nethereum?

I am currently deploying my ChangeManager contract in truffle and I want to call the contract later in Nethereum. For this I need the contract address in Nethereum. I figured I could just create an ...
2
votes
1answer
255 views

It's possible to listen contract event without knowing contract address?

I have a smart contract with an event where an account address is stored/indexed, and I want to get/advise about this event each time the account address is trigger by the event. By eg, my solidity ...
2
votes
1answer
64 views

Why raise a Created event in a Smart Contract constructor?

Reading through the Bancor code I see this: function SmartToken(string _name, string _symbol, uint8 _decimals) public ERC20Token(_name, _symbol, _decimals) { NewSmartToken(address(this)); ...
2
votes
1answer
590 views

Solidity events on react not firing

Simple logic event with firing in function, work perfectly as expected in truffle develop console, but never firing on my Dapp created with create-react-app, it's just seems to not listen/monitor the ...
2
votes
1answer
239 views

Event sender address

In web3JS, when I get past events, I can see the event and the tx hash, I can then do getTransaction on the corresponding tx hash and then see the sender address, but this is wasteful as I have to ...
2
votes
1answer
322 views

What happens when a function call fails within my contract method?

I am mostly interested in the following aspects: does the entire stack get unwind? if the entire stack gets unwind does this lead to all the changes made to the state by the contract get reverted? do ...
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)...
2
votes
1answer
862 views

Constant function creating event

Basically is it possible for constant functions to emit events? Example bellow: I have Sample Contract which has a getData() function which does not modify any state, emits an event and returns a ...
2
votes
1answer
1k views

Does infura support rinkeby event listening

Hi I ran a simple voting example connecting to https://rinkeby.infura.io/ since I do not run local Eth node. Everything works fine except event watching. var event2 = contractInstance.EventTester(); ...
2
votes
1answer
276 views

Solidity print multiple data

I understood that print is not possible on Solidity, is recommended to use event and events can be read by using .watch. In order for an event to appear it has to be mined first. What if I have a ...
2
votes
2answers
2k views

How to access the event log by knowing the contract address (golang)?

At the moment I develope dapps that use smart contract as storage for specific data. I use abigen to generate specific go binding to my contract. If someone try change state of the contract I use ...
2
votes
1answer
210 views

Let two clients trigger each others' event (request-response)

What I'm trying to achieve with 2 clients running on my computer (same, private network): client1 makes a request by sending a value k client1 starts to listen for an answer to the request client2 ...
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;...
2
votes
1answer
376 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 ...
2
votes
0answers
66 views

How can I extract sidechains (transient forks) from a geth node before they get discarded?

According to my understanding, transient forks (also known as sidechains in geth's source code) are discarded or overwritten when a reorganization happens. But before that, when the node detects a ...
2
votes
0answers
44 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 ...
2
votes
1answer
220 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
0answers
73 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 ...
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 ...
2
votes
1answer
516 views

How to unsubscribe logs / events?

There are two ways to subscribe/watch to logs/events: Subscribe: var subscription = web3.eth.subscribe('logs', { address: '0x123456..', topics: ['0x12345...'] }, function(error, result){ ...
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 ...
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 ...
2
votes
2answers
411 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
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 ...
2
votes
1answer
51 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....
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 ...

1 2 3
4
5
11