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

Detecting `accountsChanged` and `chainChanged` with ethersjs?

I'm not sure if this question makes sense or if I'm looking at things correctly but it's coming from my understanding that ethersjs is an abstraction on top of MetaMask (and other providers)... I've ...
0
votes
0answers
8 views

Truffle contract not receiving events after some time

In my nodejs app I'm using truffle to communicate with a ERC721 contract, mainly to receive events. All I'm doing is listening for when a Transfer event happens. But it only works for the first few ...
0
votes
1answer
11 views

How to get events from a contract deployed on different network? - Web3

I have contract A in Avalanche FUJI C-chain. When I'm on C-chain testnet, I can get events from A using getPastEvents() in web3.js, but when I change the testnet (for example, to Goerli), I receive an ...
1
vote
0answers
23 views

Ethers - get historical block.timestamp in batch mode

I am trying to build a simple database table containing block.number and block.timestamp starting at a given block number. This could be easily done with the following JS code using ethers.js library: ...
0
votes
1answer
8 views

Detect Function call or Transaction when no Event is Emitted

Is it possible to detect a contract function call using a listener, even though it does not explicitly emit an event? I want to think this is possible, because block explorers like Etherscan are able ...
0
votes
0answers
13 views

How to associate Transfer events with a Swap event?

Let's take this Transaction as an example. Here we have events: 287 Transfer 289 Transfer 291 Swap We can associate those two Transfer events with Swap event by looking at the sequence of events and ...
0
votes
0answers
14 views

go-ethereum: watching contract for events

I've been trying to get a go program going that monitors a smart contract for emitted events. I had found the amazingly written https://goethereumbook.org/event-read-erc20/ unfortunately it appears to ...
0
votes
1answer
12 views

Security considerations: using events to trigger offchain actions

I need to trigger a sensitive offchain action based on a users interaction with my smart contract. My current approach is to emit and event (Trigger(msg.sender, 123)) and then use a filterQuery with ...
0
votes
1answer
20 views

Is it possible for web3 to listen to contract function call ? (For example mint() for a NFT)

Hey I have read about listening to events in web3js and it worked. I have my abi set up and looked through all available events in it and mint(), what I use to mint nfts is a function which makes ...
0
votes
0answers
6 views

How to validate transfers?

As far as I understand, events associated with transactions are completely arbitrary pieces of data emitted by a contract, i.e. just because transaction event log says that a Transfer took place, ...
0
votes
1answer
10 views

Does solidity event only gets emitted when transaction successfully mined?

I have a transaction method call which sets a value and at the end I have emitted an event. Somewhere in web3 I am listening an events. What if the transaction took time to mine? Does event get ...
1
vote
1answer
13 views

TheGraph is not connecting to IPFS locally

I have a Graph local node set up using this tutorial. When I am trying to deploy it, its not going through with the following error message: Add file to IPFS build/schema.graphql ⠋ Upload subgraph to ...
0
votes
1answer
25 views

How to listend to ALL NFT smart contract events?

I would like log all NFT transfers happening on the blockchain. I know that there is a standard event in the ERC721 smart contract. I actually can subscribe to that event if I know the address of the ...
1
vote
0answers
33 views

Event name conflicts and data out-of-bounds error in Remix

I have been getting a weird errored: Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.1.2) error when testing contract functions in Remix, even though it goes through ...
0
votes
0answers
11 views

How to get List of Etherscan Lable for each contract address and identify contract transfer token event

I use Etherscan API to get list of ERC20 tranfer token event of a specified address, but I want to get transactions which are sent FROM Uniswap or contract symbol address like this, but I don't know ...
0
votes
1answer
33 views

Obtain transaction hash from event (ethersjs)

My goal is to detect a contract invocation as fast as humanly possible. To do this I am processing all the pending transactions I have access to (via provider.on("pending", async (tx) => {...
0
votes
0answers
17 views

Best way to replay (and track) blockchain to build own indices. Is it hooking into web3.eth.subscribe('logs',..)?

As a nice project to get my hands dirty with Web3 I want to attempt to build something like poocoin which shows historic OHLCV candles for BEP-20 tokens. To this end I want to replay the entire ...
0
votes
0answers
23 views

Get new data after the events.Swap()

here is the code: await SWAP_CONTRACT.events.Swap({}) .on('data', async function(event){ console.log(event) await changeListenPair(); }) .on('changed', async function(event)...
0
votes
0answers
8 views

How to search for event in when an input should be the 5th topic in event

I want to query an ERC1155 token event where I know the token Id, there only can be 4 topics and tokenId would be the fifth,which means it's not an indexed input and goes to the data part. How can I ...
1
vote
0answers
35 views

How to manually interpret balance change after custom Events using web3.py

Context I am trying to build my own Ethereum explorer. I know this already exists on Etherscan out-of-the-box but the features that I want are either rate-limited or not even provided via its API. To ...
1
vote
1answer
25 views

OpenZeppelin test helper: expectEvent.inTransaction error

I'm trying to use OZ Test helpers to pass a test when a specific event is emitted. Here is the logic: I call function1 with a JS Promise. function1 calls function2 which emits an event. Parts of ...
0
votes
0answers
6 views

GetPastEvents and string topic - Error: invalid argument 0: hex has invalid length 160 after decoding; expected 32 for topic

Being "token" below a contract instance, i do: token.getPastEvents('OperationEvent', {fromBlock:68000000, filter: {productId: '...
2
votes
0answers
11 views

can i use events as persisnt storage? [duplicate]

I'm building an application that is a mix of the blockchain and a centralized app. I need some way for the systems to communicate with each other, for example. Let's say you can buy some digital asset ...
0
votes
0answers
12 views

Multisender.app transactions aren't emitting transfer events for Ampleforth

I am trying to collate the whole of Ampleforth's transaction history. To do this I was grabbing the transfer events every 1000 blocks since Ampleforth's inception. In doing this I noticed that some ...
1
vote
2answers
21 views

Is it possible to subscribe to the same event, but in multiple contracts at the same time?

Let's say we have 1000 contracts with the same type of event 'Event'. I can subscribe to each one of them individually using contract.listen('Event'), but I cannot use this if I want to create a ...
1
vote
0answers
13 views

Web3.py filter.get_new_entries() returns nothing if over 10 events have been emitted?

I'm using the following loop to try and add the metadata for tokens generated in my own smart contract, it all works exactly as intended when I am generating up to 9 "bots" at a time, but as ...
1
vote
1answer
47 views

web3.getPastEvents return events but can't subscribe to an event

I have a contract which has an event. The contract's code is pretty simple: pragma solidity >=0.7.4; import "./Crowdfunding.sol"; contract Factory { address[] public ...
0
votes
0answers
15 views

Send web3js event to webhook when it happens

I have a transfer method that transfers a token using the deployed smart contract in Web3JS. I have to return the values to the customer, so I subscribe to the transfer event and wait for it to ...
0
votes
0answers
16 views

How to get data from earlier blocks in ethereum BC via web3.py?

I am trying to get data from earlier blocks/transactions. I have created events and emitted them. I can see the logs in the Remix IDE. However, I cannot get the logs in web3.py. It only returns empty. ...
1
vote
1answer
28 views

Does a failing `require` condition cause emitted events to be reverted too?

Consider the following contrived contract function: function submitOffer(uint256 foo) public payable { emit MyEvent(foo); // then later... require(foo > 10, "Foo must be greater ...
1
vote
1answer
40 views

Can a chain link node listen to ethereum smart contracts events?

Can a chain link node listen to ethereum smart contracts events? Let’s say I want to provide data to a node from a smart contract. Can a I link a chain link node and use a smart contract as an oracle?
1
vote
2answers
370 views

To get event args when I using ethers.js

I'm a three months old programmer. So if what I'm saying is ambiguous, please let me know and help me being a better programmer. Now I'm coding a test code as using hardhat and ether.js. My solidity ...
0
votes
0answers
17 views

Is it safe to perform calculations on past events?

I would like to store all balances of my ERC20 contract on my website's database: addresses and their balances and be able to call the script anytime to sync it with new balances using Transfer event. ...
0
votes
0answers
11 views

Event data has insufficient length | What does this mean?

I've seen this warning from time to time when working with Brownie Event data has insufficient length This is after I made a call to a Chainlink node, calling a function like: function requestUsers()...
1
vote
0answers
12 views

web3.contract.events.EventName.on('data', () => {}) expiring after ~15 minutes

I am using the following code: const web3 = new Web3.providers.WebsocketProvider(host); const contract = web3.eth.Contract(...); contract.events.EventName.on('data', console.log); The EventEmitter ...
4
votes
1answer
311 views

How to understand uniswaps events?

I could not find any explanation about this so I'm reverse engineering it, the 3rd tx is the most interesting, If you look at this transaction https://etherscan.io/tx/...
1
vote
0answers
34 views

Event Ordering in Ethereum

I am developing an application using solidity, web3js and eventeum. I am testing it locally using ganache-cli. I use Kafka to store all the events to process them at convenience instead of processing ...
0
votes
1answer
29 views

Send ETH Transaction based on price

I'd like to be able to execute an ETH transaction on chain based on a change in price of an asset. This seems like a job for an Oracle, but aside from an app that's not on chain that watches for ...
0
votes
0answers
13 views

my python event listener create duplicates in case of multiple event in one transaction

I have an issue to manage with my listener in python, here is my code : def handle_event(event, log_index): receipt = w3.eth.waitForTransactionReceipt(event['transactionHash']) ...
1
vote
1answer
20 views

can I trust transactions in blocks with just 1 block confirmation?

In my application, I am using events/logs to capture and display information. So, to decrease the response time, I am returning the result as soon as the block is mined and not waiting for 5-6 block ...
0
votes
0answers
51 views

get “event name” using web3

I want to build a listener in python using web3 as usual. The issue is that I have a lot of event on my contract (let say 30), and depending the event I have an action to do. Here is my code, and I'll ...
0
votes
1answer
76 views

How to reduce time for block confirmation in the Ethereum blockchain and also time to listen to logs emitted?

I am designing an application in which I am emitting logs through transactions in the Ethereum blockchain. I also created an event listener to listen to the new logs emitted. But I want time from ...
0
votes
0answers
57 views

How to pass Multiple Values in a Solidity Event

I am emitting within a function the following in a solidity smart contract. emit Transfer(address(0), to, tokenId) In my front-end JavaScript code, I am reading the values as follows: let transfer = ...
0
votes
1answer
65 views

Reflect Base contract's update in another contract

I have wanted to know what concept is it called when we want two contracts which are deployed on the Network, reflect the transaction and updates in another contract. for example: contract Base{ ...
1
vote
1answer
506 views

Metamask API: can't detect events “connect” and “disconnect” in React.js

Hello I'm very new to developing. I'm testing communication with Metamask via React.js I managed to succesfully listen to Network and Account changes, but when I try to detect if someone "...
0
votes
0answers
8 views

What is the impact on my Dapp performance when subscribing to events?

What would be the expected performance impact on my Dapp if I subscribe to a lot of events from different contracts? I'm not sure how the event process work. The performance would decrease while ...
0
votes
0answers
12 views

Get past events or store them in traditional databases

I have a question about showing some results to users. I have a smart contract which has multiple arrays and mappings. I use events to store their data when I set data in functions. is it better to ...
1
vote
0answers
31 views

Python filtering the type of event in contact

I am building a python app that is listening to events from a contract. The issue is that I have different events in only one contract, let me explain. Currently my code is : def handle_event(event): ...
0
votes
1answer
57 views

Is there any way to find out what exchange a ETH wallet was created?

I added a ETH wallet address to Genesis Mining back in 2017 for a 2 year contract. After the contract was finished it still took them a year to add the ETH to said Wallet. (long story but I did not ...
1
vote
2answers
29 views

Is there a websocket URL in Ethereum classic like in Ethereum?

Can anyone tell me whether or not there is a WebSocket URL to deal with smart contract events in Ethereum Classic especially? I know ethereum supports WebSockets and we can easily listen to events ...

1
2 3 4 5
13