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
32 views

Infura-Like caching layer to store all Events in local nodes for fast retrieve

Anyone who has tried to use a local Ethereum node to run any complex DApp will have realized that it is impossible to do so because there is a huge problem of slowness in the retrievement of large ...
0
votes
1answer
22 views

Solidity Event Handling

I have been trying to listen to the event of my smart contract; however, I receive the error. MyContract.events.myEvent( function(error, event){ if(!error){ $("#instructor")....
0
votes
0answers
12 views

truffle does not find emitted event when it includes a string parameter [closed]

I am finding some weirdness with the Truffle test suite where it recognizes an event if it takes only an address argument, but if it takes an address and a string truffle does not pick it up in the ...
0
votes
1answer
32 views

How to handle a Solidity return value/event in JavaScript test? [duplicate]

I'm trying to create a basic ERC721 NFT, using OpenZeppelin contarct. I started with something similar to their example code: //SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; ...
0
votes
1answer
24 views

Event / Emit naming Convention

When I deploy the exact same contract on Rinkeby, other than the name of the event, Rinkeby behaves differently. When the Event's name is OwnerSet I can see that on https://rinkeby.etherscan.io/. ...
-1
votes
2answers
25 views

ERC-20 without events

I have created a non-compliant ERC-20 token that does not emit any events. I do not want to fix this bug, because fixing it produces other troubles. So, an ERC-20 token with this bug (not emitting ...
1
vote
0answers
21 views

How to watch/wait for events in JavaScript + Truffle?

I'm learning to develop Oracles, and, like all of us, I've encountered a dated article. After fixing all the Solidity changes (version, adding emit to fire an event, changing constructor function to ...
0
votes
0answers
9 views

ERC-1155 events for approval

ERC-1155: function approve(address _spender, uint256 _id, uint256 _currentValue, uint256 _value) external; /** @dev Allow other accounts/contracts to spend tokens on behalf of msg....
0
votes
0answers
11 views

Referencing events of interfaces in libraries

When writing a contract and using an interface, events that are part of the interface do not need to be declared in the contract. Can this be avoided when not writing a library and emitting events ...
1
vote
1answer
153 views

Pending transactions logs issue

I am trying to get the pending transactions logs to identify specifics topics before the next block was mined (ERC20 transfers, Uniswap swaps, ..). I run a Geth (1.9.22) full node, mining is enabled (...
0
votes
1answer
30 views

myContract.getPastEvents returns undefined event

I am using Web3 1.3.0. Connecting using Node. Also if I try to enter the name of my Event I get an error saying that event does not exist. This is what I get, shouldn't event have a value ? I am using ...
0
votes
1answer
37 views

High level tool (autogenerated UI) to obtain all the events emitted by the contract?

I'm pretty sure something like this exists, saw it somewhere in the wild, my Google skills need some StackOverflow boost... I would like to provide two data points: contract address name of the event ...
1
vote
1answer
22 views

How to use `topics` as an argument in `getPastEvents()`

I am currently attempting to collect data on token transfers. In order to accomplish this, I am collecting data using getPastEvents() and I am passing a filter object as an argument to collect ...
1
vote
1answer
21 views

Divide or not to divide in a smart contract?

I need my contract to create a ratio of two big integers (prices) output in an event. Which of two variants is better: divide in the contract using a math library; output two integers and let the ...
0
votes
1answer
60 views

How can I view pending events, without much delay?

I can view pending events like so: pending_events_filter = my_contract.events.TestEvent.createFilter(fromBlock='pending', toBlock='pending') pending_events_filter.get_new_entries() But the events are ...
0
votes
0answers
28 views

Read transaction logs of another Smart Contract

I have to track user activity in DEX smart contract and do some validation/operation based on that information. DEX itself does not API to retrieve that info, but emit events, so is there any way to ...
1
vote
1answer
70 views

how to decode log event of my transaction log?

I receive a transaction event in my log of my Ethereum transaction. .on('receipt', function(receipt){ console.log("address: " + receipt.logs[0].address); ...
2
votes
1answer
157 views

How to listen to contract events using ethers.js?

I need to listen to the specific contract events and do some task once the event is emitted. I didn't find proper docs on ethers.js documentation. Can anybody tell me how can I keep listening to my ...
0
votes
1answer
9 views

When an Ethereum transaction event occurs, is there a case when it was not included in the main chain later due to a fork?

I know Ethereum is a POW blockchain where forks take place. The transaction event is issued after executing the transaction on the node. If a fork occurs, is there a possibility that the transaction ...
1
vote
1answer
27 views

Events declared in library are missed in contract ABI

DYDX contract SoloMargin is firing events like LogTrade, LogSell but they are not provided in ABI. SoloMargin contract: https://etherscan.io/address/0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e#code ...
0
votes
0answers
31 views

Does Infura support Event Filters?

Does Infura support creating filters to Listen to events ? I have a dapp with many events, and would like to test it in Ropsten testnet and python web3.py, but it seems infura does not support filters....
1
vote
0answers
28 views

Can not run more than 1 event in Infura

I am trying to listening to many events from infura but it is not working. Only one filter work, when I add the second filter, this message appear: RuntimeError: cannot call recv while another ...
0
votes
0answers
30 views

Duplicate events from get_new_entries using web3.py

I'm struggling to understand how to properly poll events emitted from contracts. The provider I'm using is Infura. My code boils down to the following: filter = target_event.createFilter(fromBlock='...
1
vote
1answer
16 views

When to use indexed on events

Looking at the newer smart contract I rarely see "indexed" on events. Sometimes even event emiting is scarce, I would assume its to save gas on contract execution. So question is when would ...
0
votes
1answer
25 views

Recording Event Logs in a DB from a Smart-Contract

I have created a smart-contract and deployed to the Rinkeby Network, it has a client-side application which has been established with React. Now, I would like to observe and audit every transaction or ...
0
votes
0answers
10 views

How to display formatted transaction information in Remix IDE from web3.eth.getTransactionReceipt()?

tl,dr: Remix shows a formatted transaction summary for transactions that are initiated within the Remix IDE. Is it possible to display the same output for an arbitrary transaction hash? Sorry if this ...
0
votes
0answers
25 views

Subscribing to new blocks doesn´t work [ROPSTEN]

I'm trying to subscribe to newBlockHeaders on the ropsten network, but it does not seem to work. The following code works for mainnet but not ropsten. Any ideas? const Web3 = require('web3') const ...
0
votes
0answers
16 views

Events stop triggering after a while

I created a script that subscribes to PairCreated event on Uniswap using Web3 and Infura API. The event works for a few minutes but stops working after a while (timeouts?). How can I make it watch the ...
0
votes
1answer
84 views

ethers.js Why aren't logs filtering? (query returned more than 10000 results)

I'm building an API to scrape events from a contract suite deployed to Rinkeby. Here's an example function with some context: const network = getNetwork(parseInt(`${process.env.CHAIN_ID}`)); const ...
0
votes
0answers
10 views

Event listener works correctly from outside of the machine but not from inside the machine

I have created an event listener for my application. When I run the event listener from outside of the machine it listens correctly to all the events but when I run the same event listener (with ...
1
vote
2answers
61 views

Is Ethereum fast sync feasible to get logs

I want to get the logs of an contract address by filtering the even with transfer Event. I cant use Infura for its restrictions and limits. So i want to sync my own ethereum node for myself. Since my ...
0
votes
1answer
27 views

Is there some possibility to listen MakerDAO's LogNote events?

I wonder is there some possibility to listen MakerDAO's LogNote events, like we able to do with standard events. What I managed to research: I saw that LogNote was listed as an event from contract ...
0
votes
0answers
19 views

How to find a specific event if it has no indexed params

I understand that I can filter for logs with indexed events like so: event Transfer(address indexed src, address indexed dst, uint wad); whereby, I can search for all Transfer events with src=...
0
votes
1answer
22 views

Functions that are used for token transfers for ERC20 and ERC721 tokens

Let's suppose there is a contract address A of an erc721 token B. If I want to monitor all of its transfers from A to another address say C then should I only filter the Transfer function or should I ...
0
votes
1answer
26 views

Array lenght and data miss match while storing data of events

Can someone help me in finding what is wrong here a why the length of task info is 0 even the taskInfo has some data. I'm using events to fill the taskinfo array. I'm stuck at this place for almost 2 ...
0
votes
1answer
33 views

Does variables inside Event gets stored in blockchain?

Hey I have following event event Submitted(bytes32 indexed docHash); The event is called by a function function submitHash(bytes32 docHash) public onlyOwner() { Submitted(docHash); } It ...
0
votes
0answers
33 views

Which Ethereum library is the one to use nowadays? Contract events on mobile must work

I used drizzle in our dApp and contract events work fine on Desktop browsers with MetaMask. However, on mobile (tested with Rinkeby deployment on MetaMask and Status on Android) the contract events ...
0
votes
1answer
47 views

How to use truffle-assertions to verify parameters of an emit?

I have not been able to find any resources with usage instruction besides github and blog post by the author On github an example is show as such: truffleAssert.eventEmitted(result, 'TestEvent', (...
1
vote
1answer
25 views

Correct approach of replicating smart contract balances

We are storing user balances on smart contract and as well as on our local db, so that we dont always have to query blockchain for user balance. For this we use contract events to update balances ...
0
votes
1answer
43 views

Why eth_getLogs returns empty result for Ethereum account address?

I'm developing an Ethereum platform and need to fetch the events log of a desired address. I found a code like this: curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics":...
0
votes
0answers
41 views

How to listen for contract creation, or all block events?

I'm building a web app with web3 where users can deploy a certain contract and assign some people to it. Inside the constructor of that contract I also output a certain event. I want these assigned ...
0
votes
0answers
26 views

How to filter an indexed event parameter using web3j?

I am planning to use ethereum logs as a data storage on my private blockchain. I have defined event in my contract like this: event logDomainFilter(uint128 indexed _campaignId, uint128 indexed ...
0
votes
0answers
19 views

In EtherJs how to find account number of balance change event?

I am creating Ethereum Wallet application & I am using EtherJs for Web wallet development. When I try to listen for Balance Change event for multiple accounts then How do I find account number ...
0
votes
0answers
30 views

How can I listen for Truffle Actions such as TX_BROADCASTED, TX_ERROR via the Drizzle Vue Plugin?

In my Vue JS Dapp, which uses Drizzle Vue Plugin, I listen for contract events using $drizzleEvents like so: this.$drizzleEvents.$on('drizzle/contractEvent', (payload) => { this....
0
votes
0answers
18 views

Ethereum Logs since Beginning of Time

I can subscribe to all events in ethereum network (logs, pendingTransaction etc) so I can get only newly generated events (while I am subscribed). For my analysis I need to retrieve all logs from ...
0
votes
1answer
15 views

How is data sent to the front-end by a View function?

I am required to send some data from a view-only function to the front-end. I tried using the standard approach by emitting an event with the required fields. However, when the emit call is placed ...
1
vote
0answers
33 views

What is the maximum size of ABI in real world contracts?

To monitor my contracts during development and test in a private blockchain I’ve written an event explorer that encodes beside other parameter the ABI in an URL parameter. The ABI will be compressed ...
1
vote
0answers
69 views

Websocket provider reconnects every 1 minute

I'm developing an application on a private Ethereum chain and trying to listen to some events. I wrote a basic indexer script for listening to events and writing them in a database. To listen to the ...
0
votes
1answer
34 views

Are the events raised in a private transaction in quorum also private?

I'm trying to understand the specifics of privacy in quorum transactions, specially regarding the events. Are the events raised in a private transaction in quorum also private? I can't find any ...
2
votes
1answer
79 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 ...

1
2 3 4 5
12