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
2answers
751 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
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.)
2
votes
2answers
515 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
26 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
31 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
2answers
66 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
1answer
123 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
223 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
535 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
223 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
281 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
322 views

Decrease polling interval for web3.myContract.myEvent()

The following seems to poll my Ethereum node every second: web3.eth.contract(contractAbi).at(contractAddress).allEvents(callback); Is there a way to decrease the polling interval?
2
votes
1answer
828 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
211 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
1k 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
193 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
394 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
354 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
57 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
1answer
63 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
0answers
32 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
133 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
62 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
187 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
344 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
249 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
319 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
301 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
40 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
157 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 ...
2
votes
0answers
252 views

Parity syncing status for smart contract events with warp

So I'm trying to find the fastest way to fully sync a parity node in order to get all smart contract events, not just account states. The problem I've found is that when parity has warp syncing ...
2
votes
0answers
187 views

Web3 js events not listening after 5 mins of idle time

My contract is deployed on ropsten infura test-network and that contract has events which gets fired when there is some transaction. contract file function functionName(address from, address ...
2
votes
0answers
314 views

How to use logx in Solidity?

Aim: To log data from a smart contract. Following function is written in accordance with low level interface to Logs in ethereum. However, due to lack of documentation, and being new in Solidity, I ...
2
votes
0answers
129 views

Etherscan for Ropsten not showing tx events anymore [closed]

Since today 2018-04-11 etherscan on Ropsten testnet does not show anymore the events related to a given transaction. It is very important for the testing and debugging of Smart Contract to view the ...
2
votes
1answer
79 views

Is it possible Filter events with wildcards based on recorded indexed parameters

Let's say I have a contract that fire an event PersonCreated(uint personId, bytes32 indexed name) every time a person is created. To query for all the past events with name equal to Jason, we can ...
2
votes
0answers
115 views

(1) Parity: why does syncing fall behind, (2) Why are events missing events because of (1)

Background: I have multiple parity nodes setup on Digital Ocean and AWS and event watchers attached to these nodes. I also have a service to query block numbers and compare versus etherscan's current ...
2
votes
1answer
813 views

Subscribe to events usign geth websocket

I'm trying to subscribe to geth using the websocket api. First step was to start geth: geth --ws --wsport=8456 --wsorigins="*" --fast --cache=512 --rpcport=8455 --rpc --rpcapi="personal,eth,network" ...
2
votes
1answer
159 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://...
2
votes
0answers
949 views

Error :current provider doesn't support subscriptions : using ganache, web3 1.0.0 [duplicate]

how to solve the error : The current provider doesn't support subscriptions: HttpProvider at Subscription.subscribe while using web3 1.0.0 and ganche
2
votes
1answer
41 views

Query events for a topic's max value

My Event outputs an indexed parameter uint id. Can I query the logs for the max value of id, without returning and searching through all log records? I'm guessing not, since indexed values are ...
2
votes
1answer
113 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
224 views

event logs with geth fast sync

If I use --fast syncing, will the contract execution Event logs be available? I wish to setup a private node to make RPC request.
2
votes
1answer
264 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(...
2
votes
1answer
462 views

Implementing Events in Solidity (Remix)

I have a test code on Remix and have been getting ParseError: Expected Primary Expression. The error happens in function Enquiry -- at event definition - line. ParserError: Expected primary ...
2
votes
2answers
232 views

Can we apply modifier to an event in solidity just like function?

Let's say as per business I want to restrict certain users(addresses) from seeing the logs for a contract. I know there is "modifier" which can be set to function, to give access rights but Can we do ...
2
votes
1answer
253 views

convert padded topics address to valid address string

I am parsing some information from the topics array. I receive 32bit padded addresses in some indexes. Is there a web3 utility function or useful helper method to get these back into normal sized ...
1
vote
2answers
468 views

Truffle Tests Events via JavaScript

I am testing my contract via the chai and truffle-assertions libraries from a JavaScript file and am testing if events return the correct values. I have an event called Message. In my function, the ...
1
vote
1answer
1k views

Contracts will not compile using truffle with the “emit” keyword included in front of events [duplicate]

I notice there has been changes made to solidity and that the word emit is now to be used in front of event triggers (to distinguish from functions being called). However when I include these in ...
1
vote
1answer
37 views

Am I hashing the data in the file itself, or just the reference?

I am attempting to create an app where I upload a file to a website and then I submit a hash of that file onto Ethereum. I am unsure whether I am hashing the actual file below or just the reference to ...