data out-of-bounds #4664
Unanswered
david000602
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am facing issue data out-of-bound
let eventAbi = [
'event PairCreated(address token0,address token1,address pair,uint256)',
];
let eventName = 'PairCreated';
let iface = new ethers.Interface(eventAbi);
let contract = new ethers.Contract('0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73', eventAbi, this.provider);
const criteria = contract.interface.getEvent(eventName);
let filter = {
address: '0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73',
fromBlock: 37242695,
toBlock: 37242696,
topics: [criteria.topicHash],
};
let log;
try {
log = await this.provider.getLogs(filter);
} catch (error) {
console.log('Log error: ' + error);
return;
}
for (const element of log) {
let decode = await iface.decodeEventLog(
eventName,
element.data,
element.topics,
);
console.log(decode);
}
Beta Was this translation helpful? Give feedback.
All reactions