New answers tagged events
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
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 ...
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 ...
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.
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.
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....
Top 50 recent answers are included
Related Tags
events × 851solidity × 260
web3js × 253
logs × 113
go-ethereum × 77
contract-development × 73
ethers.js × 56
transactions × 47
truffle × 44
javascript × 40
contract-design × 37
web3.py × 37
filters × 36
contract-invocation × 28
etherscan × 28
blockchain × 26
remix × 22
nodejs × 21
event-handling × 21
dapp-development × 20
python × 19
infura × 19
websocket × 19
erc-20 × 18
json-rpc × 17