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.

137 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
94 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 ...
1
vote
0answers
106 views

Filtering blocks on basis of transaction logs in web3j

I want to filter blocks on the basis of a log present inside transactions. How can I do that? I don't have any contract address and want to filter all the blocks generated by all the contracts. ...
1
vote
0answers
90 views

Why would an Infura/MetaMask watch of a contract's allEvents() that works on Rinkeby fail sporadically on Mainnet

I have some code that immediately sets up an allEvents watch for the contract, then leaves that running and uses it to handle various events generated by the contract. I've been running it on Rinkeby ...
1
vote
0answers
58 views

Is there any specification for Decentralized Token Exchange?

Is the way of doing decentralized token exchange (DEX) on Ethereum blockchain specified in some ERC ? Exploring event data in Etherscan I found that there are many types of events: event Order(...
1
vote
3answers
390 views

Not able to export to csv all transfer events of a specific contract on Ethplorer.io

I'm able to use the Export to csv function, but it's only giving me the most recent 1000 events. Any suggestions on how to get ALL (2100+) of the events in a csv file? https://ethplorer.io/address/...
1
vote
1answer
106 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 ...
1
vote
0answers
141 views

Listen for Solidity Event With X Number of Confirmations

I presume Solidity events are fired the moment the block that includes its transaction is mined -- please correct me if I'm wrong. I need to sync the transaction status locally but wish to only save ...
1
vote
0answers
101 views

web3 got duplicate events and make data in server different from blockchain

I use web3j to listen ethereum smart contract events to synchronize data for the server, but sometimes I got duplicate events in one function. Let's consider Birth evens in CryptoKitties smart ...
1
vote
1answer
183 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
48 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)); ...
1
vote
1answer
529 views

Geth settings for watching Events?

what are the optimal geth settings if you just want to listen to some events that are fired by smart contracts? I'm having a bit trouble to setup geth properly. Thanks a lot. PS: That is my ...
1
vote
0answers
640 views

Recommended way to watch events with MetaMask?

I always get in trouble with things like var filter = web3.eth.filter({fromBlock: '5139365', toBlock: 'latest'}); filter.watch(function(_err, _resp){ ... when using MetaMask as provider. What is the ...
1
vote
1answer
746 views

Web3 Solidity events do not work any more in Chrome?

Ok, it seems like this issue is only present in chrome browser I am working with Version 64.0.3282.140 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit) Actually I had some ...
1
vote
1answer
68 views

event not returning expected data

When I start my app I listen for posts from the latest block. After a post has been made I'm supposed to return author (address), title (string) and an id (uint). But what I get in the author and id ...
1
vote
2answers
199 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 ...
1
vote
0answers
65 views

Get root data of smart contract

I am deploying a Smart contract with set of fields. Updating some fields using events.Till here is fine. Now here i need to fetch the root data(data while deploying the contract) Please suggest. ...
1
vote
0answers
104 views

Tracking transaction attempts/failed attempts sent to a contract from unknown parties

In light of the recently killed parity library and how the person responsible went around randomly trying to kill contracts, is there a way of monitoring smart contracts for attempted and potentially ...
1
vote
0answers
105 views

How to best react to geth events from a server app?

I have a geth node running on a server. I want my Ruby app to take action every time a contract emits an event. The app cannot miss any events. One way would be to poll for transactions to that ...
1
vote
1answer
154 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 ...
1
vote
0answers
314 views

I am trying to query historical blocks for specific events from my contract. Is a full node required for this? Or is a light node or fast node fine?

I am having difficulty seeing any events for my contract. They show up in etherscan but not when trying to view them using web3. I am running a light node. Do I need a full or fast node to have access ...
1
vote
0answers
36 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 ...
1
vote
0answers
704 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 ...
1
vote
0answers
431 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 ...
0
votes
0answers
13 views

TypeError: market.FileViewed is not a function while trying to watch event

I want to watch for fileViewed event and it throws TypeError: market.FileViewed is not a function in marketplace.FileViewed{ ^ My solidity contract: pragma solidity ^0.5.0; contract ...
0
votes
0answers
28 views

Events using Infura websockets on rinkeby Web3 1.2.1. Returned values aren't valid, did it run Out of Gas?

I am trying to do a simple event listener with NodeJS and Web3 using an Infura endpoint. I have the correct project-id const Web3 = require('web3'); let web3 = new Web3( // Replace YOUR-PROJECT-ID ...
0
votes
0answers
24 views

Error: invalid number/address values

Having trouble with the submitOracleResponse inside the callback below: flightSuretyApp.events.OracleRequest({ fromBlock: 0 }, function (error, event) { if (error) console.log(error); ...
0
votes
0answers
32 views

Problem accessing variables stored in event log

I have succesfully implemented an event in my contract Portfolio: // Define eventlog for myEvent event myEvent(uint indexed eventDate, address indexed sender, myArray[] eventList, uint eventBalance); ...
0
votes
0answers
13 views

Listening events

I have a problem I want to solve with watchevent function. I am building a daemon script that submit a transaction when a particular event is emitted. Let's suppose the node that run the script goes ...
0
votes
0answers
26 views

Getting empty events in response of receipt. I am using Infura+web3.js+ropsten

JS code contract.methods .myFunction( "data1", 1568545262, 1568631662, 1568718062, "0xD4496dA2a4b376fC8s4d786EB6B71483436077c4" ) .send({ from: "...
0
votes
0answers
29 views

web3 update monitoring

Inside a DAPP, I have been using web3.currentProvider.publicConfigStore.on('update',... to monitoring Metamask activity. But in the new metamask-mobile such method does not exists. There is a ...
0
votes
1answer
72 views

Filters object not working for web3.eth.contract getPastEvents() method

I have referred, Web3 Events, but filters object is not working for me, I've got the same result for events before and after applying filter object. Here's the code: instance.getPastEvents( "...
0
votes
1answer
16 views

Subscribe to events using local geth in light mode?

I've followed this guide to subscribe to events. I succesfully subscribed to the new block headers using Infura provider. But when I try to use local geth node syncing in light mode, it connects, but ...
0
votes
0answers
16 views

How to filter by string parameter , web3 2.0.0-alpha.1 Solidity events?

I'm trying to filter some events , and I noticed since I updated the web3 to version 2.0.0-alpha 1 the event catch is a little bit different. I have a Smart Contract with this event : event ...
0
votes
0answers
26 views

No Events After Deploying Another Contract in Remix

I am trying to write an upgradable smart contract in Remix. This involves a Proxy contract, a Logic_0_1_0 contract, and a Logic_0_2_0 contract. I uploaded Proxy and Logic_0_1_0 only, and the ...
0
votes
1answer
33 views

Solidity Events

I'm using Solidity events to interact with my html page, once a change is done in the contract or page the watch function from html reflects back to the contract. My question here is, while checking ...
0
votes
0answers
24 views

Web3.js doesn't fire event callbacks anymore

I have a small dapp that uses web3.js to interact with a contract. I have one event listener: let activateEvent = nexusContract.events.Activate({ _member: defaultAccount }) activateEvent.watch((...
0
votes
0answers
41 views

How to filter MyEvent({ },{ }) to retrieve only the latest transaction in the array?

My code: instance.MyEvent({}, {fromBlock: 0, toBlock: 'latest'}).watch(function(error, event) { if (!error) { console.log(event); $('#events').html(event.transactionHash); } else { ...
0
votes
1answer
26 views

Web3 event listener - timing issue when immediately retrieving contract values

I'd like to be able to immediately get a struct value from a mapping after calling a function that updates the struct, however, when testing with Ganache, sometimes the event arrives to the listener ...
0
votes
0answers
25 views

web3.eth.getBlock in order

I am a beginner for Javascript & web3(0.20). I am using Metamask for watching allevents, and I need to get timestamp. I use getBlock.timestamp. Due to Javascript, timestamps are not inorder. I ...
0
votes
1answer
58 views

In node.js event is not fired

I am using web socket to get event. sending transaction works fine. but event is not fired. also I referred Web3 events not working but it does not work, too. I used eventemitter also. but it did ...
0
votes
0answers
13 views

How can I use the parameters of an event as a function input?

how can I use the indexed parameter of a triggered event as a input for a function called in response to that event triggered? This is the event: event LogOfferAccepted( uint _id, ...
0
votes
0answers
113 views

Can I subscribe to events emitted by another contract?

I am trying to subscribe to an event emitted by an existing library's smart contract. I've found examples of how to subscribe to events emitted by my contract using web sockets and my contract ABI as ...
0
votes
1answer
37 views

Viewing transaction events by using web3 on geth console

According to https://web3py.readthedocs.io/en/stable/contracts.html#web3.contract.ContractEvents.myEvent web3 allows to extract the pertinent logs from a transaction receipt: tx_hash = contract....
0
votes
1answer
66 views

How to listen contract event in Python

The test contract is pragma solidity ^0.5.0; contract Test{ event Here(uint256 indexed a); uint256 public a; function add() public returns (uint256){ a += 1; emit Here(...
0
votes
0answers
30 views

How do i retrieve the transaction hash to DApp's frontend?

I have a simple DApp that stores data, developed with truffle and deployed on rinkeby, and I want to show the transaction hash in the frontend. I've read a lot about web3.eth.getTransaction() or ...
0
votes
1answer
106 views

Truffle, getPastEvents synchronously

I try to check that a total of 4 events have been emitted by my contract instance. Next code will fail in the assert.equal line since getPastEvents will process the events in a callback and so the ...
0
votes
0answers
29 views

Event - Filtering a BigInt (or a BigNumber)

I am trying to filter on a BigInt for an event (the number can fit in a uint256). I keep getting an error Error: invalid number value This is what the code looks like.. { filter: {fromID:BigInt(...
0
votes
0answers
50 views

Best way to support restoring of all the keys of a mapping

I have a contract, in which I maintain the keys of a mapping in two different ways: Storing each key in an array Emitting an event for each key I do this in order to be able to restore the keys (and ...
0
votes
2answers
22 views

Can events always be called directly by user accounts? Is there a way to make them internal?

I am using events to fire an order, basically using them as a vehicle for a master/slave connection with an IoT device, through the blockchain. Ideally i want to always verify the right msg.sender is ...
0
votes
0answers
37 views

Private blockchain losing access to older blocks

So, my private blockchain became out of sync and one of the nodes reset to block 0 – it then synced up with the other nodes. The node that went to block 0 is the node that is providing the rpc port ...