Created
March 28, 2023 11:10
-
-
Save ImHukam/a147a8b28a5408debfc97b3cf702f3a1 to your computer and use it in GitHub Desktop.
zkEVM logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers'); | |
const provider = new ethers.providers.JsonRpcProvider('https://zkevm-rpc.com'); | |
// Define the range of blocks to retrieve logs for | |
const fromBlock = 100; | |
const toBlock = 9000; | |
// Define the filter to use for the logs | |
const filter = { | |
address: 'CONTRACT_ADDRESS', | |
topics: [] // Set topics to an empty array | |
}; | |
// Make the request to get the logs | |
provider.getLogs(filter,fromBlock, toBlock).then(logs => { | |
console.log(logs); | |
}).catch(error => { | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment