2 years ago

#58121

test-img

TiagoS

Why contract event data is undefined on a testnet but not in a local node?

I've created the following Solidity contract that emits an event:

enter image description here

And in my front-end JS code I'm using ethers.js and reading the data from the event with event.args[2] (line 76):

enter image description here

When I use a Hardhat local node the event.args[2] has what I'm expecting.

However event.args is undefined when I use the contract deployed on a Polygon Mumbai testnet node with Alchemy.com.

enter image description here

I appreciate any help or guidance with this error I'm facing, let me know if I should share any other info. Cheers.

blockchain

ethereum

solidity

ethers.js

0 Answers

Your Answer

Accepted video resources