ethers-io / ethers.js

Complete Ethereum library and wallet implementation in JavaScript.
https://ethers.org/
MIT License
7.87k stars 1.82k forks source link

Unhandled Rejection (Error): call revert exception (method="balanceOf(address)", errorSignature=null, errorArgs=[null], reason=null, code=CALL_EXCEPTION, version=abi/5.0.10) #1305

Closed nazariyv closed 3 years ago

nazariyv commented 3 years ago

Getting a lot of like the above and trackback isn't useful since it is async. This happens a lot and I can't pinpoint what the issue might be, is there a way to better log this?

Thanks for your work

ricmoo commented 3 years ago

Can you include more information? What contract you are calling, network, etc. What parameters you are passing?

You can use .catch or try..catch with await.

I need more to go on though. ;)

nazariyv commented 3 years ago

sure, I don't have a balanceOf call anywhere, so it must be my Symfoni hardhat plugin that is calling it. If I change the network from mainnet to my local hardhat node, I get a similar error but now for isApprovedForAll call inside of my code (unlike symfoni).

If I use try catch, I will get the same error, though, right? :)

nazariyv commented 3 years ago

when I log the isApprovedForAll call, I can that the addresses are correct, that the contract is instantiated correctly with my metamask provider and me as the signer.

nazariyv commented 3 years ago

caught with try catch:

rror: call revert exception (method="isApprovedForAll(address,address)", errorSignature=null, errorArgs=[null], reason=null, code=CALL_EXCEPTION, version=abi/5.0.10)
    at Logger.makeError (index.ts:205)
    at Logger.throwError (index.ts:217)
    at Interface.decodeFunctionResult (interface.ts:326)
    at Contract.<anonymous> (index.ts:309)
    at Generator.next (<anonymous>)
    at fulfilled (index.ts:2)
nazariyv commented 3 years ago

not much to go off of that. When I look at local node, no errors either

ricmoo commented 3 years ago

I don't make any implicit calls to .balanceOf or .isApprovedForAll. Perhaps there is a bug in your plugin or hardhat?

I don't think this is an ethers issue though... If you open issues against the other projects though, please link back to here so I can keep an eye on it. :)