Skip to main content

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

Reading Ethereum contract event TypeError: Cannot read properties of undefined (reading 'toHexString')

I have the following js script that i want to use to read events from a smart contract below, but when i run the script I get the following error message TypeError: Cannot read properties of undefined ...
Osemu Aimiosior's user avatar
0 votes
1 answer
15 views

Efficiently Visualizing and Retrieval Ethereum Smart Contract Events on Decentralized Storage

I want to know what are the recommended decentralized storage solutions (IPFS or sub-graph)? and general process for retrieving them for front-end visualization?
Awais Ahmad's user avatar
0 votes
1 answer
33 views

Storage variables or event log

Why use local variables of type storage to store values in a contract if you can emit events and later from the front-end search and retrieve those values? If we do not want to operate with the ...
UnexpectedCharacter's user avatar
0 votes
1 answer
30 views

Emitting Debug Messages on an Arbitrum Contract during an AAVE Flashloan Call

I'm doing a flash loan request and trying to emit some debug information using events out of the function, but I haven't seen those messages emitted on the arbitrum block explorer or been able to ...
Ian Forsyth 's user avatar
0 votes
1 answer
31 views

Reading Events from Implementation contract

I own a proxy contract as well as an implementation contract. The implementation contract's function emits an event, but it does not emit the event when it is called from the proxy contract. Using the ...
Bappa Banerjee's user avatar
0 votes
2 answers
37 views

contract.events

I am listening on an event that's happening on smart contract. event UpdatedMaxNumber(address indexed player, uint maxNumber, uint256 timestamp); My original code works fine and updates the new number ...
pigfox's user avatar
  • 71
0 votes
1 answer
52 views

Viem's PublicClient#watchContractEvent with WSS transport: Socket closed

New PublicClient instances created with WSS transport immediately fail to watch contract events if created after a period of the app inactivity - i.e. if no PublicClient was created or used for a few ...
Utgarda's user avatar
  • 791
0 votes
0 answers
132 views

Methods allowed by RPCs providers for contracts Solidity Event listeners at etherjs

GM everyone. I'll appreciate any help to know how is the correct form of consume events in a backend listener of EVM solidity contracts, and if can share your favorite Rpcs Providers like infura,...
Gman's user avatar
  • 1
0 votes
0 answers
13 views

Forking a network to simulate events

I'm trying to simulate an event by forking a network. For example: wss.on('block', async (blockNumber) => { // Your code here }); How can I accomplish this? Any guidance would be ...
adam mr's user avatar
  • 131
2 votes
3 answers
67 views

How does Etherscan decode unverified contracts events?

Etherscan is able to decode event data from unverified contracts, even without an exposed ABI. Below is an example screenshot. No signature available for this event. I've been able to replicate the ...
user130657's user avatar
1 vote
1 answer
43 views

Ethersjs: check that a transaction method in contract emitted an event

I have a contract with the getOwnerAddress function that emits a OwnerReturned event: ... function getOwnerAddress() external returns (address) { emit OwnerReturned("Owner"); return ...
parsecer's user avatar
  • 115
1 vote
1 answer
28 views

How to get the hash of the Fulfill Random Words transaction (callback) that gets mined after calling the Chainlink's VRF?

I have the hash of the transaction that called Chainlink's VRF but I need to get the hash of the callback transaction that gets executed after the RandomWordsRequested event is fulfilled. How do I do ...
Falcon Stakepool's user avatar
0 votes
2 answers
33 views

How to get which tokens have been transferred by a transaction using ethers or Web3?

Given for example this transaction, is there a way of getting exactly what ERC721 tokens have been transferred by it? To clarify, it would be this detail here: Is it possible to get this information ...
Falcon Stakepool's user avatar
1 vote
0 answers
14 views

Structs in events [duplicate]

Is it possible to emit structs in Events nowadays? Like" contract MyContract { struct MyStruct { uint a; uint b; } event MyEvent(MyStruct indexed my); }
dNyrM's user avatar
  • 928
1 vote
0 answers
26 views

Represent UUIDv4 string as bytes16 in event topic

I am trying to emit an Event with UUIDv4 indexed string. Example contract: contract EventEmitter { event ExampleEvent(string indexed id); function dispatchEvent(string memory _uuid) public { ...
Marcin's user avatar
  • 111
1 vote
1 answer
127 views

Listening to events in unit test using Viem

I want to be able to tell how many approval event were sent during my test as I cannot tell how many where sent since they are auto-approved by hardhat Running Environment.
codekoriko's user avatar
1 vote
1 answer
28 views

How do i read sales here?

I've been trying to read the sales in this transaction. Tried to read "Execution721MakerFeePacked" event But could not understand anything from it. Tried seeing what NFTs got transferred and ...
Ladybug's user avatar
  • 11
2 votes
1 answer
40 views

How to correctly pack Log data in Go

Using go-ethereum, I want to convert a struct containing my log fields into a types.Log{} object containing the data bytes and topics. Essentially, I want to do the opposite of the Parse<EventName&...
Ryan Collingham's user avatar
0 votes
0 answers
11 views

Is it possible to verify that an event is not emitted in Hardhat tests?

I know that it's possible to check for emitted events in a call in Hardhat using .to.emit method. Is there a way to make sure that an event should not be emitted in a call? For example I may want to ...
mahdi's user avatar
  • 178
0 votes
0 answers
29 views

Query event - Range limit on Polygon, but not on Ethereum?

I want to query some deposit events to show all deposits for a user. On Ethereum, I did it like this to query all deposits (starting from block 0) const block = await provider.getBlockNumber() const ...
jan's user avatar
  • 111
0 votes
1 answer
192 views

Disconnected from ETH websocket after timeout error [Python]

i'm trying to listen to eth websocket using python's web3 library, particularly listening to log events. async def ws_v2_subscription_context_manager_example(): while True: try: async with ...
germor197's user avatar
0 votes
0 answers
24 views

How to fetch blockchain events when using Alchemy Account kit

0 I have doing a blockchain Transaction using the ERC 4337 by leveraging the Alchemy's Account Kit and I am stuck on how exactly do I get the event or the return values of the transaction execution, ...
Nitish Patel's user avatar
2 votes
1 answer
27 views

It is possible to listen Solidity events with Metamask provider?

I have an Smart Contract which submits events when a function is executed, and the associated transaction is mined. It works perfectly from NodeJS with a websocket network provider (wss://), but ...
Alexander Herranz's user avatar
0 votes
1 answer
82 views

Decode "pending transactions" from socket without calling RPC for every transaction?

Initial goal: catch transactions from address (when address calls "swap" events or "addliquidity" events, or does transfer on PancakeSwap router). I want to catch that kind of ...
Danik Logan's user avatar
0 votes
1 answer
14 views

Are errors emitted as logs on the blockchain?

Say if an error is caused due to a revert statement will it be emitted as an event so front end application will be aware or not?
davidastro's user avatar
1 vote
0 answers
33 views

Is it possible to have an ethereum node that only listens for events?

Scenario: A DApp requires specific events from ethereum or a sidechain, DApp does not afford any miss or delay. There is no reliable public RPC, so DApp developers decided to run a node. Question: Is ...
user129596's user avatar
1 vote
1 answer
283 views

Solidity: Reading events with web3.eth.contract

I am trying to read events issued on my hardhat local node. My code is the following var fs = require('fs'); var jsonFile = "artifacts/contracts/STPOAP_ERC.sol/STPOAP_ERC.json"; var parsed= ...
PupSt4r's user avatar
  • 61
1 vote
1 answer
179 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
  • 4,396
1 vote
2 answers
150 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
  • 4,396
0 votes
1 answer
122 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
73 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,607
1 vote
1 answer
184 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
605 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
273 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
  • 103
1 vote
1 answer
135 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
33 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
59 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
23 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
85 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
2 votes
0 answers
205 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
18 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
44 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
41 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
30 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
  • 13
0 votes
0 answers
25 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
123 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
38 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
2 votes
2 answers
4k 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
  • 135
0 votes
1 answer
264 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
145 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

1
2 3 4 5
18