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
1 answer
11 views

Display Value in Remix

I am a newbie in Solidity. Below is the simple Solidity source code pragma solidity ^0.4.21; contract CAT { event XYZ (uint Z ) ; uint[] x; uint a ; function f(uint[] memoryArray) ...
user avatar
1 vote
0 answers
10 views

Is there a way to subscribe to a The Graph subgraph?

I want to use GraphQL subscription to be able to watch for all changes in the liquidity pools. Is there a way to do this with The Graph or another possible option?
user avatar
  • 363
0 votes
0 answers
19 views

Solidity event returns object instead of string

I'm trying to test and learn how I can register a solidity event in front-end and get the value. everything seems to be fine except I get [object object] instead of the string I'm looking for. Here's ...
user avatar
  • 101
2 votes
1 answer
15 views

Is the `indexed` keyword for a Solidity event no longer necessary because of subgraphs?

Context: The indexed keyword is used for Event fields when we want them to be easily searchable using the JSON-RPC method eth_newFilter. This was the best way to offchain index the interactions with ...
user avatar
  • 447
0 votes
1 answer
20 views

Ethereum Undecodable logs

I have encountered this transaction where all of its logs were undecodable. If you see the value of topic0 in events logs, it is function signature but ideally it should be the event signature. From ...
user avatar
  • 25
0 votes
1 answer
12 views

web3.js filtering events does not work

Event: event published(string indexed username,uint8 indexed age); in front-end (browser) : instance.events ...
user avatar
  • 25
0 votes
0 answers
19 views

Determining what event will be emitted

I want to call a contract function f() using ethers, but before I do so, I want to make sure that it executes in the desired way. I can learn whether f() executes in the desired way by looking at the ...
user avatar
  • 386
0 votes
1 answer
9 views

How to filter and access the unindexed event parameters?

I was doing a project, and I have an event event AddedDoctor( address indexed doctorAddress, string indexed name, string indexed doctorRegistrationId, uint256 ...
user avatar
0 votes
1 answer
15 views

How to catch multiple events from a single function in the hardhat framework?

I was going through a function that emits multiple events. Usualyy, if a function emits a single event, we can check that during the test cases using: await expect(contract.claimTokens(busd.address)) ...
user avatar
1 vote
0 answers
19 views

Subscribe to smart contract using go-ethereum

I am trying to subscribe to certain smart contract using go-ethereum. Here is the example of my function client, err := ethclient.Dial(config.AppConfig.SmartcontractHost) if err != nil { log.Fatal(...
user avatar
0 votes
1 answer
20 views

Get event call from solidity contract from react

I am looking for doing something, if an event is emmited from solidity contract. Here's my solidity contract:: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract QuoteV2{ string ...
user avatar
1 vote
1 answer
69 views

Is it possible to track how many event listener does the specific smart contract have?

I'm wondering if the above question is possible in ethers or web3? If yes, is it possible to get their IP as well? Thanks!
user avatar
0 votes
0 answers
31 views

Listening to events other than than Transfer

I'm simply trying to listen to all Sync events that happen however, whenever I run my script it doesn't log anything Here's how I'm doing it - I've omitted a lot of irrelevant code let provider = new ...
user avatar
0 votes
0 answers
21 views

Is it possible to retrieve event logs from an eth_call?

When using eth_call is it possible to get event log data, or does it not exist?
user avatar
0 votes
1 answer
47 views

Staging test is getting timeout error on rinkeby network: Chainlink VRF and Keeper Issue

I am following Patrick Collins course. At chapter 9, when we do a testnet test on rinkeby. The event is not firing. I am using chainlink Keeper and VRF to run the the code as detailed below. Console ...
user avatar
0 votes
0 answers
23 views

Geth javascript console how to subscribe using JSON RPC

I am running an go-ethereum client in light mode. I have connected to my node with ./geth attach /home/user/.ethereum/geth.ipc and have my geth console. I want to use real-time subscriptions mentioned ...
user avatar
0 votes
0 answers
9 views

Solidity event doesn't include args

I'm emitting an event from a Market.sol contract with three indexed args but they aren't showing up in my frontend after calling the contract function. Contract code: event MarketTokenEvent ( ...
user avatar
0 votes
0 answers
17 views

fetch the event data in the console

please what should I put inside the console.log() to fetch the 2 returned addresses of the event(args[0], args[1])? and thank you! const filter = { address: '0xbc4...', topics: [ ...
user avatar
  • 3
0 votes
0 answers
25 views

Question about using events as smart contract storage

This question is a development of related questions from existing sources (https://media.consensys.net/technical-introduction-to-events-and-logs-in-ethereum-a074d65dd61e) and prior threads (Do logs/...
user avatar
  • 1
0 votes
1 answer
37 views

How I can retrieve event logs generated by a contract?

I'm trying to build a MERN app with a web3 part, I have a typical authentication step in the beginning (centrelized), then the user will connect his wallet and send a transaction to the smart contract ...
user avatar
  • 3
1 vote
1 answer
20 views

I cannot see a single event in NEthereum

Say I have this code: private async void LaunchEventRetrievalLoop() { try { Debug.Log("Creating event filter"); ...
user avatar
0 votes
0 answers
72 views

Having trouble with ethers.js queryfilter --> TypeError: contract.queryFilter is not a function

Trying to use queryFilter to find the value, sender and destination for a transaction event but im completely unable to, instead it is erroring out and telling me that queryFilter is not a function. ...
user avatar
0 votes
0 answers
17 views

Can't read a single event

I am using web3: ^1.7.3 and have an event as follows: event ChannelOpened( address indexed consumer, address indexed channelId, uint256 indexed expiration, address ...
user avatar
0 votes
1 answer
22 views

Emit an Event when no transaction

Can I emit an event in case a transaction doesn't take place? For example, I have a function checking whether the wallet is allowed to buy the token. If yes, the transaction takes place and an event ...
user avatar
  • 113
1 vote
1 answer
12 views

Are there off-the-shelf solutions/services for receiving events from smart contracts on the server?

am working on a project where I need to catch events from smart contracts on the backend. Are there any solutions or services that help to catch events and pass them to the backend? The main ...
user avatar
  • 11
0 votes
2 answers
51 views

Hardhat Node Stops Emitting Events to Web3js

I'm running a hardhat node and a nodejs backend using web3js to capture events (code) and for some reason the events stop getting caught by web3js. The transactions seem to be firing just fine as I ...
user avatar
  • 113
0 votes
0 answers
32 views

How can I subscribe to smart contract event properly?

I'm using React Js to subscribe to events in my smart contract, and I want to get the subscription values only once. The syntax: mySmartContract.on('MyEvent', (value) => { console.log(value); }); ...
user avatar
0 votes
0 answers
14 views

transferFrom doesn't emit an event

I use OpenZeppelin ERC20 contract and want to emit event when transferFrom is called. import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract TST is ERC20 { event diff(string ...
user avatar
  • 1,029
0 votes
0 answers
6 views

Can Data of TX With Contract Be Tracked If No Event Is Emitted?

Given I interact with a smart contract and provide data. All transactions on the blockchain are recorded, but is unindexed data which is never emitted as event also readable to all (e.g. on scanners)? ...
user avatar
  • 11
0 votes
0 answers
25 views

Filter Ethereum events by number range

Is it possible, using web3 or ethers to filter events by a number range, e.g. indexing the amount in an event and then filter events with amount > a number.
user avatar
  • 309
0 votes
2 answers
124 views

How to get the returned values in Solidity functions? [duplicate]

Imagine I'm developing a simple function as the following: uint256 state; event Addition(uint256 result); function addition(uint256 a, uint256 b) public ...
user avatar
  • 705
0 votes
0 answers
6 views

Get Limit Price from thegraph limit price order

Trying to get price from limit order that was been summited to contract but when call theGraph query: https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-fantom-ii/graphql, I getting ...
user avatar
  • 111
0 votes
1 answer
128 views

Etherscan API get transaction status from getLogs api call

I am using the Etherscan API to get a list of ERC20 transfer events for a contract, that are relevant to my address: https://api.etherscan.io/api?module=logs&action=getLogs https://api.etherscan....
user avatar
2 votes
1 answer
57 views

Use cases of anonymous events

What are the practical use cases of anonymous events in Solidity? In which situations they might be helpful?
user avatar
  • 214
0 votes
1 answer
59 views

events can cause state change?

I am doing a simple HelloWorld class trying out several things including emitting events. My contract code is below: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract HelloWorld { ...
user avatar
0 votes
1 answer
29 views

Reading Contract Events

i have an promlem readen a Hash from ethereum logs. When a user Mints a token, i fire a mint event: event Mint(address indexed _to, string indexed _hash, uint256 _tokenId); Example for _hash = ...
user avatar
0 votes
2 answers
43 views

What characters are allowed in event names?

I'm having trouble locating any documentation on which characters are allowed in Ethereum event names. For example, can I put cyrillic characters in them? Can I put emojis? What is allowed and ...
user avatar
0 votes
0 answers
50 views

Can I combine Brownie to view events and contracts on Ganache?

It seems that ganache can only work for truffle-config file , if i want to see the events and smart contracts on my local ganache blockchain? I am developing an app where i want to locally test the ...
user avatar
0 votes
1 answer
91 views

Is it possible to retrieve events later on?

The scenario is : There are two participants A and B. A sends a transaction to a Smart Contract and an event (X) is emitted as a result of the transaction. The event is caught (listened to ? ) by B ...
user avatar
1 vote
1 answer
39 views

Best way to get notified when fallback arrived

When you request random number, the Chainlink VRF2 returns it by calling following function. function fulfillRandomWords( uint256, /* requestId */ uint256[] memory randomWords ) ...
user avatar
  • 1,029
0 votes
1 answer
38 views

Events in Chained Fallback Function Cause VirtualMachineError

I’m working on an upgradeable contract that uses fallback functions with inline assembly delegatecall and call calls (using calldatacopy and returndatacopy) to route internal and external function ...
user avatar
  • 126
0 votes
1 answer
156 views

How to listen for events without a websocket RPC?

Based on the docs of ethersjs, I could use the provider.on() function to listen for events and perform some actions. However, would it still work if I don't have a websocket RPC URL? If it still does ...
user avatar
  • 277
1 vote
0 answers
283 views

How do I listen for Events starting at a previous block number in Golang?

I'm writing an Event listener for my smart contract using the go-ethereum library. I'm trying to figure out how to listen for all SubmitProof events and have successfully been able to use the builtin ...
user avatar
0 votes
1 answer
38 views

contract.getPastEvents() take too much time

I have configured a private blockchain with some solidity smartcontract inside a docker container on my AWS VPS. When I connect to the blockchain with truffle console --network besu and test the ...
user avatar
0 votes
1 answer
38 views

Is it possible to analyze how frequent the ERC721/1155 `tokenURI` method is called?

The ERC721/1155 method tokenURI is a public variable and has a getter for retrieving the data itself (e.g., often returns the ipfs://Qm... CID). Let's assume the tokenURI method itself isn't emitting ...
user avatar
  • 1
1 vote
0 answers
73 views

How the bscscan Dex Trades works?

I'm trying to get transaction logs of a token on all Dex Exchange (.e.g Pancakeswap) like below. I captured it from https://bscscan.com/token/0x78a499a998bdd5a84cf8b5abe49100d82de12f1c#tokenTrade ** ...
user avatar
  • 11
0 votes
0 answers
60 views

How can you listen for certain events to have real-time updating on your front-end?

For example, if using ERC721A there is a _totalMinted() function that returns the current amount of minted tokens. Can you listen for a successful mint and then have your front-end display that value ...
user avatar
0 votes
1 answer
94 views

Default options for getPastEvents in web3js

I am trying to get the specific past events for my contract, named 'Transfer'; when I try to simply use the following code, it gives empty result. myContract.getPastEvents("Transfer").then(...
user avatar
0 votes
1 answer
26 views

Can the graph only index indexed parameters?

I have an event that looks like this: event ItemListed( address indexed seller, address indexed nftAddress, uint256 indexed tokenId, uint256 price ); And I'd ...
user avatar
1 vote
0 answers
17 views

Is it wrong to read or trust historical information from logs in client side?

I noticed one thing while learning Events/Logs from some sources. If I understand these sources correctly nodes can remove logs for effective memory usage. If my client tries to read logs that do not ...
user avatar

1
2 3 4 5
16