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
1 vote
1 answer
36 views

How to fetch events emitted in a deployment transaction using ethers JS?

The newest Transparent Proxy from Openzeppelin deploys the admin contract by itself and emits an event from where we can find the admin contract's address. This event is emitted during the deployment ...
Zartaj Afser's user avatar
  • 2,180
1 vote
2 answers
75 views

Unable to fetch events using Ethers js

I am trying to fetch two events from a contract on Goerli. One of them is being fetched correctly but the other one doesn't. The working one : let eventFilter = Core.filters.AddChannel();//Core is ...
Zartaj Afser's user avatar
  • 2,180
0 votes
1 answer
42 views

Solidity Event String parameter decoding

The value of aggregatorId in the event emitted by the below tx is not equal to value “oneInchV5FeeDynamic” in the tx? Also, I can’t decode the value emitted in the event “...
Waiz Khan's user avatar
1 vote
1 answer
11 views

Do custom errors and events take up storage in Solidity?

For example, is slot 0 in this contract the uint256 x or does the custom error take up this slot? Same thing for events. contract Foo { error CustomError(); uint256 x; }
Rohan Nero's user avatar
  • 1,408
1 vote
1 answer
52 views

How to expect a function call to not emit an event in foundry

I have the following function: function doStuff() external { emit MyEvent(); } And in my foundry tests, I want to check to make sure this event was NOT emitted. How do I do that?
Patrick Collins's user avatar
1 vote
1 answer
91 views

How to decode a bytes value from Ethereum event with ethers.js

I've got the following event declaration in my Solidity contract: event RemoteOrderCreated(bytes32 indexed id, uint32 indexed nonce, address indexed sender, bytes input); And I capture the event ...
Milkncookiez's user avatar
0 votes
1 answer
32 views

Querying events using ethersjs provides logs with unrelated contract addresses

The UniswapV2Factory contract has the following event: event PairCreated(address indexed token0, address indexed token1, address pair, uint) I am using etherjs to detect all events on chain in the ...
RamanSB's user avatar
  • 101
1 vote
1 answer
53 views

Decode json.loads(log_event) using python web3

Using python 3.11.4, web3 6.9.0 I receive log information via websocket subscription. Below is sample output this omits: swap_log = { 'removed': False, 'logIndex': '0x8e', 'transactionIndex': '...
AdamMuzz's user avatar
0 votes
1 answer
14 views

Contract events logs: string data field divided

I got this event signature: event Event(address indexed from, address indexed to, string text); Which I call inside this method: function emitEvent(address to, string calldata text) external { ...
Francesco Stucci's user avatar
3 votes
0 answers
47 views

`delegatecall` in batch call stops working as expected when changing the code slightly

I have the following function for batching multiple calls, which returns the result (success or not) and the return data for each corresponding call. function callBatch(bytes[] calldata calls) public ...
Vlad Markushin's user avatar
1 vote
1 answer
18 views

It is possible to create events dynamically in already deployed Smart Contracts?

It is possible, in an already deployed Solidity Smart Contract, to create new events trough an existing function (something like new Event)? I'm not talking about emitting new events, from an existing ...
Alexander Herranz's user avatar
2 votes
1 answer
63 views

Prove that an Event didn't happen in the Blockchain

I'm working on a Solidity token-vesting contract that allows users to claim tokens based on how long they met certain conditions. To illustrate, let's assume holders of a specific NFT can claim 100 ...
Ernani's user avatar
  • 121
1 vote
0 answers
56 views

When I was testing a contract using ethers V6, I tried to read events from a transaction receipt and got an error

TypeError: Cannot read properties of undefined (reading '0') const hre = require("hardhat"); const main = async () => { const rsvpContractFactory = await hre.ethers.getContractFactory(&...
web3游民's user avatar
0 votes
1 answer
17 views

Do different blockchains have caps on different amounts of possible emitted events?

For example, a transaction that emits 1,000 events, would that work on Arbitrum, Optimism, Ethereum, etc? All EVM compatible chains/
Patrick Collins's user avatar
1 vote
0 answers
36 views

Web3js Events not working as intended in v4.x

I have a simple contract with an Event. I am trying to use it in my react component. According to the documentation, it can be done like this : contractStorage.events.NewZombie({ fromBlock: 1 }) ...
mnk-reddy's user avatar
0 votes
0 answers
24 views

Why a Uniswap/PancakeSwap emits same event multiple times

does someone know why Uniswap/PancakeSwap pairs occasionally emit the same Swap event multiple times? There is it an example on dexscreener on WBNB/USDT: I happen to also catch it in my script that I ...
Melardev's user avatar
  • 101
1 vote
1 answer
17 views

Is paying to an API provider the only way to get reliable events notifications?

I am new to Blockchain development. I am developing a game that depends heavily in random numbers. My first naive implementation was flagged by the auditor as I was generating them on-chain. So I ...
ElCoco's user avatar
  • 11
0 votes
0 answers
18 views

logging events while testing

In Current Version of ethers v6 ., once the event is emitted how we should log them ., because the older method of logging from transaction receipt is not working " for example this is my ...
jeevan siddu's user avatar
0 votes
0 answers
85 views

Contract.on event listener not working (using Ethers.js + Next.js), how come?

got a simple question here for all you ethers.js hackers. Simple code, transactions go through, but why doesn't the contract.on function work? const handleSubmit = async (e) => { e....
sunsakis's user avatar
0 votes
1 answer
30 views

Question about node performance on listening event of contract

what is the best way to listen new event emitted from contract with smallest delay? Other third party (Infura, Alchemy) is good enough or I have to run a new node ? ( as i know until now, public node ...
dang.pm.IT's user avatar
1 vote
2 answers
1k views

Ethers 6 transaction receipt events information

How i can get event name and params from tx receipt with Ethers 6? I wanna write test to check if event was emitted. Before each beforeEach(async () => { amount = tokens(10) const ...
HideME's user avatar
  • 125
0 votes
0 answers
150 views

How do I subscribe to contract events in Web3.js 4.0?

I have deployed a contract factory, Contract.sol, which emits the address of every contract it deploys. I would like to subscribe to these events in my JS application. It seems that the interface has ...
Boris K's user avatar
  • 197
0 votes
2 answers
72 views

Monitor USDT Deposits in Multiple Wallets on BSC

How to monitor USDT deposits in multiple smart contract wallets on binance smart chain (BSC)?
softweng's user avatar
  • 129
0 votes
0 answers
16 views

go-ethereum log.data for event is incomplete and missing

I have a problem with listening to events, I'm running SubscribeFilterLogs with query := ethereum.FilterQuery{ Addresses: []common.Address{contractAddress}, Topics: [][]common.Hash{{...
TechX's user avatar
  • 1
0 votes
1 answer
17 views

Is Hardhat calculating Event Signatures Wrongly?

I have this event on my code event CrowdSourceCreated(address indexed contractAddress, address indexed creator, uint indexed amount);. As per eth documentation, to get this event signature I will need ...
Buki's user avatar
  • 11
0 votes
1 answer
429 views

How to calculate swap-price from a Uniswap v2 swap event when both amount0In and amount1In are set?

Consider the following swap event as listed here: amount0In :4003282810462813624841310246 amount1In :947647544007674247 amount0Out :729688943313804828976594873545 amount1Out :0 To calculate the swap ...
Geert-Jan's user avatar
  • 169
3 votes
1 answer
110 views

Has anyone here used QuickAlerts?

How can I track transactions from and to a wallet address? / How can I track smart contract events in real-time as they happen? Renat Ghoste
renatghoste's user avatar
2 votes
1 answer
59 views

Help with event filters

I have been using a combination of eth_newFilter and eth_getFilterChanges for getting new NFTs minted on Ethereum and Polygon. But I miss some NFTs whenever my server gets overloaded. Is there any ...
Devsuite's user avatar
2 votes
1 answer
83 views

QuickAlerts Help!

I have been using QuickAlerts to track activities on my smart contract and receive a WebHook in my Discord server. How can I make sure that the WebHook is indeed coming from QuickAlerts and not a ...
Tien's user avatar
  • 193
0 votes
0 answers
19 views

web3.eth.abi.decodeLog not finding an event argument

I have a complicated event with the following signature: event SwappedShares(uint256 _stable, DataTypes.FeeReturn _fees, address _user, DataTypes.SubPoolGroup[] _subPoolGroups); Here are the ...
Barney Chambers's user avatar
0 votes
0 answers
45 views

Not able to add `dataSource` to existing subgraph

I am new to GraphQL & The Graph protocol. I have an exisitng subgraph with already 2 dataSource and deployed. Now I want to add 1 more new dataSource to subgraph. According to The Graph docs, I ...
Rishabh Raghwendra's user avatar
1 vote
1 answer
127 views

How can I use ethers.js to get streaming events via sockets instead of polling?

I try to use ethers.js events, but they seem to be polling constantly and eventually the RPC provider sends HTTP code 429: Too Many Requests. I understand that I can use non-standard APIs of providers,...
Gregory Magarshak's user avatar
0 votes
0 answers
25 views

What do the to/from fields in a swap event mean?

Im parsing swap log events from web3 and was reading the to and from addresses from the topic but sometimes the from/to address is the same, and other times its different. It doesn't seem to ever be ...
BAR's user avatar
  • 135
0 votes
0 answers
12 views

Not able to dynamically assign values to array

I am testing the correct emission of NFTMintedAll event on the following function, using hardhat: event NFTMintedAll( uint256 requestId, address indexed owner, uint256[] ...
Falcon Stakepool's user avatar
1 vote
1 answer
212 views

How do you "fake" the signature of a Solidity event?

The Note for the official Solidity documentation on Events says that "it is possible to “fake” the signature of another event using an anonymous event", without going into details of the ...
Iaroslav's user avatar
  • 279
1 vote
1 answer
54 views

Is it possible to know if a NFT was sold in OpenSea?

Is it possible to detect, by looking at the transfer events, whether a NFT was sold from a Marketplace or not? Basically I want to know if, in these cases, the safeTransferFrom method notifies the ...
Falcon Stakepool's user avatar
0 votes
0 answers
216 views

Listen to transfer event on any ERC721 compliant contract (ethers.rs)

I am trying to make a program that, given a ERC721 contract address, will listen to all transfer events done on this contract until a certain point. I am not yet very familiar with how Ethereum works, ...
Nathan's user avatar
  • 101
1 vote
1 answer
133 views

Can't catch all the events using ethers

Can't catch all the events. Why? I try to listen to events for several contracts and it is ok. But the more contracts I listen to, the more events are missed? Is there any way to prevent this and why ...
byggy's user avatar
  • 11
0 votes
0 answers
45 views

Scalable way to listen dynamically added contracts in web3j

Consider I need to listen to the event logs for a Uniswap's Swap method, which works perfect for a single CA, or even to many if they are known to the time of creation of filter: web3j.ethLogFlowable(...
0xMixer's user avatar
1 vote
1 answer
685 views

WEBSOCKETS Provider url for binance smart chain

I have a contract deployed in Binance smart chain. I have written a script that will help me read the events logs from the Blockchain. currently, I tested that with the local hardhat network itself, ...
Bappa Banerjee's user avatar
2 votes
2 answers
187 views

Reading events from layer 2 blockchains

I'm planning to query a tx using a tx hash on Ethereum and get the events/logs to find out the recipient and sender of the ETH. Is it possible to do so for L2 blockchains like Optimism, ZkSync, ...
att's user avatar
  • 165
1 vote
1 answer
155 views

FilterException when creating an EthFilter in web3j

I'm using web3j to create a filter to listen to events. Specifically, I want to listen to events of a specific contract between a certain block number and now. This is my code: Web3j web3j = ... ...
Michael's user avatar
  • 235
2 votes
1 answer
256 views

Why is Alchemy eth_getLogs not finding event logs for AaveV3 Supply events?

I have created a Node project that connects to Alchemy via ethers. I am trying to capture all Supply events for AaveV3 However, when I use the getLogs function, and use the contract address as the ...
Oscar Chambers's user avatar
1 vote
1 answer
47 views

before all" hook for "should allow a purchase" error - Chainshot

I am completing series of tutorials on chainshot. Now I am on events 4. - Sale and I am getting an error "before all" hook for "should allow a purchase" and I don't have an idea ...
rad2's user avatar
  • 13
3 votes
1 answer
517 views

How can I decode the emitted event data field using Foundry Cast in Ethereum?

I'm trying to extract relevant information from the event but I'm not sure how to decode the emitted event data using cast. Any tips or resources would be greatly appreciated. Thank you!" E.g for ...
Surbhi Audichya's user avatar
1 vote
0 answers
27 views

What is wrong with this function that is supposed to listen to an event from a smart contract?

I am essentially just trying to create a simple API that listens to this one event on a smart contract I created but for some reason the function doesn't output anything. I am pretty sure it has ...
Naander's user avatar
  • 11
1 vote
1 answer
52 views

Etherjs "contract.on" method in Reactjs to read events not loading on console

I am trying to display the events that are emitted from a function in my smart contract to the front end of my dApp, and I feel like I am missing a step in the connection process with my dApp. I've ...
OhItsPM's user avatar
  • 75
1 vote
2 answers
145 views

If no event is triggered with normal transaction, how do one listen to "transfer activities"?

This question is a follow up question based on the answer I got to the question How many transfer events are there in Ethereum? The answer mentioned that: There is no event emitted when an account ...
Finlay Weber's user avatar
2 votes
1 answer
65 views

Is it possible to track marketplace sales for an ERC721?

I know I can track events for smart contracts, such as Transfer and Approval for ERC20 and ERC721 or even ApprovalForAll for ERC721. I also know that I can track my own defined events for any smart ...
Falcon Stakepool's user avatar
2 votes
1 answer
24 views

Why do events with arguments of custom types appear fully-encoded in Tx Logs?

You can observe the behavior via the following contract which I've deployed to Polygon Mumbai at 0x33c059160280a45725d9509c120c6b30a44a61a4: pragma solidity ^0.8.19; contract EventWithCustomTypeArg { ...
Iaroslav's user avatar
  • 279

1
2 3 4 5
18