1

anyone can help me? I am using ganache-cli with fork bsc mainnet. When I use queryFilter, javascript show me this error: "Number can only safely store up to 53 bits"

In bsc mainnet it works perfectly

How can I solve this?

this is the code :

const {JsonRpcProvider} = require("@ethersproject/providers")
const ethers = require('ethers')

var provider = new ethers.providers.JsonRpcProvider("http://localhost:xxxx")
var abi = [
    "event Swap(address indexed sender,uint amount0In,uint amount1In,uint amount0Out,uint amount1Out,address indexed to)"
    ]

  contract = new ethers.Contract("0xd99c7F6C65857AC913a8f880A4cb84032AB2FC5b", abi, provider)
  provider.getBlockNumber().then(function(x) {
    contract.queryFilter([contract.filters.Swap()], x-48, x).then(function(el) {
      console.log(el)
    })
  })

1 Answers1

0

Guess this workaround should do the trick:

https://github.com/ChainSafe/web3.js/pull/3948#issuecomment-821779691

sirroger
  • 176
  • 4