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
0
votes
0answers
15 views

How unique are the event log ids?

I am using log_ids of events to keep track of which events I've processed. Log ids are formed using the word log followed by 8 hexadecimal characters i.e. log_d758eda8 The possible combinations of ...
0
votes
1answer
22 views

How can I extract a wallet address from event data?

I have a contract that returns event data including the sender's address: event Result( address indexed _walletAddress, string _name, uint256 _amount ) And in my Node.js app I try to ...
0
votes
1answer
20 views

How do I get all logs for all time for a given contract using web3?

This answer worked when filter.get was not deprecated, but now I am not sure how to do the same thing with subscribe - web3.eth.subscribe hears new events and acts on them after I create the ...
0
votes
1answer
30 views

Unable to filter events with specific values of indexed parameters

I am currently trying to test a smart contract using the truffle suit ( with 'truffle test'). My contract is of a simple ERC20 token which includes the standard Transfer event: event Transfer(address ...
0
votes
1answer
15 views

how to be notified about incoming transactions instantly?

I'm creating a platform which users are able to receive ETH on their own wallets (addresses). They will give the addresses to others, but the question is how can I be notified that new transactions ...
1
vote
1answer
28 views

How does web3 handle new longest chains?

I have a Dapp which subscribes to events using web3. I'm wondering how I can detect that the longest chain has changed or rather how I can make sure the events that I've received are canonical. The ...
0
votes
1answer
31 views

How can I turn this into a human readable output? [closed]

I have this buy function but the output gives me a transaction Nr. or whatever this is async function buy() { var a = document.getElementById("amount").value; var accounts= await web3.eth....
0
votes
2answers
26 views

Sending data outside the blockchain

Once a transaction is committed to the blockchain is there a way to let an entity outside the blockchain (i.e. An entity that is not a node in the blockchain) know that a particular transaction has ...
0
votes
1answer
25 views

Listen to a solidity event from a smart contract function [duplicate]

I have the following event: event WaitingPlayer2(address indexed player2); Which I call through: function partecipateAsPlayer2(address player2) public{ emit WaitingPlayer2(player2); } Is ...
0
votes
0answers
28 views

Efficient way to save and retrieve hash in blockchain

I am learning Ethereum using Geth. I have a private blockchain and I am saving hashes through a REST API (python web service). I have readed I can save hash values using maps (mapping data type) and ...
0
votes
1answer
21 views

Storing name values off-chain in events and web3.js

Somewhere I read the advice to store name (title, geographical name, people name, etc.) value off-chain in events. But if a value is stored in an event, is there an efficient way to retrieve its ...
0
votes
2answers
29 views

Returning a value from an external function

I have in a contract: function createCourt() external returns (uint256) { uint256 _id = ++nonce; courtOwners[_id] = msg.sender; return _id; } Now, when I try to call ...
0
votes
0answers
41 views

How does function getPastEvents works? It's too quick

I'm trying to understand how .getPastEvents function works. When given block range to search is {fromBlock:0, toBlock: 'latest'} it finds my events almost instantaneously. Shouldn't filtering all 7M ...
0
votes
0answers
12 views

How to filter ERC721 events?

I got inspired by cryptozombies to start working with ERC721 and give them a try. Now that I have my collectable idea set up, I want to allow people doing exchanges but for erc20s. Notice that this ...
0
votes
1answer
19 views

How can I find the result of a function using Events?

Consider the following basic solidity smart contract event BattleResult(string result,uint playerResult, uint enemyResult); mapping(address => uint)playerChoice; function setChoice(...
0
votes
2answers
32 views

Is the range of a FilterQuery inclusive up to ToBlock?

I'm looking to use this function: func (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) but I'm unsure if the range of the FilterQuery is inclusive or ...
1
vote
1answer
21 views

Watching for events

How come sometimes events show up on block explorers in hex and sometimes to you can see the actual string name of the event in the logs. I ask because my event watchers on my front end only pick up ...
0
votes
0answers
14 views

0x event extra data fields

I'm looking at events on the exchange contract address: https://etherscan.io/address/0x61935cbdd02287b511119ddb11aeb42f1593b7ef#events with a topic_0 equal to ...
1
vote
1answer
24 views

Garbage in string parameters of events

I have an event defined like this: event Created( address indexed target, string indexed name ); I do emit Created(..., _name); // called function with _name = "comment" which gives ...
1
vote
1answer
27 views

Stop watching events

I have activated watching events with Contract.events.events_name(filter, lastBlock), now I need to stop watching this event. I can't find the command in web3 docs. I'm using Web3 version: 1.2.1. How ...
2
votes
1answer
78 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 ...
0
votes
0answers
12 views

How do I get the value from the event to be displayed on the webpage? [duplicate]

I can connect and console.log the event. But can't bring the value to display on the webpage. I don't know what to do. Front-end import React from 'react'; import logo from './logo.svg'; import './...
0
votes
1answer
16 views

Event propagation from imported contracts

Im implementing a contract with imported subcontracts of my own. I'm trying to understand if I can receive the events emitted by the imported contracts, but since contracts can be inherit other ones ...
1
vote
1answer
70 views

What data is in 'calldataload'?

I want to parse event logs that are generated by the contract shown below, which assigns different sections of calldataload to the 4 Topics, and the Data section, of the event logs. Topic 0 receives ...
3
votes
2answers
67 views

dYdX event log signature hash

dYdX has an event called LogDeposit(address indexed accountOwner, uint256 accountNumber, uint256 market, BalanceUpdate update, address from) within their SoloMargin contract. I am trying to get the ...
0
votes
1answer
32 views

List of ALL Ethereum Contract Events, for ex: Transfer, Mint, etc

A very simple question, yet couldn't find a simple answer. Where can I find a list of all event types such as Transfer, Mint, etc? Is this stored anywhere, for ex: online database or historically ...
0
votes
0answers
5 views

Nethreum CreateFilterInput Block Number boundary issue

I obtained the latest block number by using: var Latest = web3.Eth.Blocks.GetBlockNumber.SendRequestAsync().Result; Assume Latest = 400000 I create a filter even from block number 390000 to (the ...
0
votes
1answer
116 views

Web3js - Internal Transaction Data (Event Logs): Token Transfers, Contract Creations, & Internal ETH Transfers

I'm currently recording transaction data via Web3js, while directly connected to a local Geth full archive node via IPC, and I was wondering if there was a more elegant way to record internal ...
1
vote
0answers
90 views

Ganache is not showing any events

I have a contract method which emits events but ganache seems not to catch any events. I say this because when I deploy my contract on ropsten the events are being caught fine but only in ganache I ...
0
votes
1answer
39 views

getPastEvents on localhost is not a function error

Now, I'm working on an Ethereum Blockchain project to transfer the ownership of stored devices by using local web3 provider at the truffle environment. Truffle v5.0.27 (core: 5.0.27) Solidity v0.5....
0
votes
1answer
36 views

Smart Contract Transfer Event Log Data & transfer _value [Rust]

I'd like to have a better understanding of events and logs data, more specifically when it comes to interacting with ERC20 tokens smart contracts and their Transfer events. I'm looking for a way to ...
0
votes
0answers
28 views

getPastEvents undefined(please help)

I had asked this question before. I looked carefully at the exchange section, which I advised, and I think there is no problem with the exchange section. At least in my opinion there is no problem and ...
0
votes
1answer
29 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 ...
1
vote
0answers
21 views

How a contract on Ropsten (deployed after fork) emit 3/5 events on the shorter chain while same contract on longer chain emits 5/5 of the events

General info: We have a full-node, which broadcast our txs. We have a EventSource contract which contains 5 events types. The eventSource contract deployed only after Istanbul fork. Our node was ...
0
votes
0answers
66 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
1answer
20 views

If for each setter I can get the blockchain state at the moment and make it queryable, will I still need events?

That question came as part of understanding better the role of events in Ethereum. Can the mechanism which index the blockchain state at each setter and makes it queryable for all parties can ...
0
votes
1answer
32 views

Way to create an event?

As soon as a function is called this other function should also be called!! Example: As soon as ether is deposited it should transfer funds into employees wallet. I already have functions deposit() ...
0
votes
0answers
37 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
1answer
34 views

Emited Solidity Events not being watched at frontend truffle contract instance

So, I have been reading through A LOT of pages about events in Solidity and how to interact with them on frontend but I am still pretty new to this and it seems like there have been multiple changes, ...
0
votes
0answers
14 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
40 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: "...
1
vote
1answer
38 views

Event Names not showing up on Etherscan

For some reason Event Names associated with transactions to my contracts aren't being shown in their Event Logs on Etherscan. Worth noting, this event in particular is not indexed. Any thoughts as to ...
0
votes
0answers
33 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
217 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
161 views

How to connect with WebSocket with Web3?

Already referred web3 documentations and other Q-A for web socket connection. Currently using infura as provider.
0
votes
1answer
39 views

Not getting getPastEvents or once function using contract instance

I have followed Web3 documentation to subscribe an evnet, I have created Instance of web3 using infura url as argument. Created contract object using, const contract = web3.eth.contract(abi, ...
0
votes
1answer
50 views

Truffle: 'func.call()' retrieves the return-value of a non-constant function

I've just learned that one can easily obtain the return-value of a non-constant function, by using myContract.func.call() (instead of myContract.func(), which retrieves a response object). Up until ...
0
votes
1answer
49 views

getPastEvents cannot handle multiple requests?

When I send about 100-120 requests in async, it is fine, the event will give me a response. But above 150 or so, I get "Invalid JSON RPC response: "" Web3JS 1.2.1 Geth Info: Version: 1.8.12-stable ...
0
votes
1answer
24 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 ...

1 2 3 4 5 11