I am getting one weird issue when calling BEP20 standard method- balanceOf(address) for any address. My contract is a BEP20 token, and it has all the standard functionalities of BEP20 protocols.

When I am calling the balanceOf method in bsc testnet, I am getting below error:

[ balanceOf method Response ]
    uint256 :  Error: Wrong response id "0" (expected: "5") in {"jsonrpc":"2.0"

Testnet url: https://testnet.bscscan.com/address/0xB578AFcDa60b70D0572194A79b34679dAAaBB144#readContract

The same method is working perfectly fine in mainnet.

Can someone please look into this, and share your views.

  • I have checked and I can successfully call balanceOf on your contract. I think it's more an issue in your web3 code, could you please share it ? Commented Mar 13, 2022 at 18:44
  • yeah, it was related to my code. sorted now, thanks anyways!
    – VikasGS
    Commented Mar 16, 2022 at 17:59
  • I meet the same error because I use wrong rpc url!
    – huu duy
    Commented Mar 19, 2022 at 13:00
  • just to add, this is working fine through web3 code. But if I got to the above testnet url, and exectute the balanceOf method- I'm still getting the same error. Any suggestion why is this happening?
    – VikasGS
    Commented Mar 19, 2022 at 17:56


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.