New answers tagged

0 votes

Is there any way to listen smart contract events from nodejs-expressjs server?

use web3.js events listener emitted by smart contract Official docs link - https://web3js.readthedocs.io/en/v1.10.0/web3-eth-contract.html#events
AMANPREET BAINS's user avatar
0 votes

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

Following code will do your work const { ethers } = require("ethers"); const ABI = <Contract ABI> const rpcProvider = new ethers.JsonRpcProvider( <rpc url> ); async function ...
Iresh Madhusankha - DevCresix's user avatar
0 votes

How to call functions or access public mappings from inside of a subgraph?

You can use .bind contract Uniswap V3 subgraph has an example here: https://github.com/Uniswap/v3-subgraph/blob/bf03f940f17c3d32ee58bd37386f26713cff21e2/src/mappings/core.ts#L402-L404 let ...
0xh8h's user avatar
  • 155
2 votes

Unable to fetch events using Ethers js

My bad. The deployed contract was an old contract, containing only two parameters in the event, but the instance I was creating had three parameters, producing a wrong filter for the event.
Zartaj Afser's user avatar
  • 2,085
1 vote

Unable to fetch events using Ethers js

The contract hasn't emitted that event yet. The only functions called so far is the createChannel. Try calling updateChannelMeta which emits the UpdateChannel event.
Farrukh Raza's user avatar
2 votes

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

There isn't way to check if an event is NOT emitted, but for your purpose you can use vm.getRecordedLogs(); and assert that the length of the logs array is 0. function testDoesNotEmit() public { Vm....
Siddharth Bhoite's user avatar

Top 50 recent answers are included