When I use the "Read Contract" tab on Etherscan, it works even if I didn't "connect" by Web3 wallet. It seems to be reading the blockchain passively.

The thing is, one of the functions uses msg.sender or even _msgSender() to check, for example, is the caller is the owner of the contract. And calling it from Etherscan returns false, while remix returns true (because it's connected to the wallet).

What does Etherscan use, and is there a way to set the caller for the Read Contract methods? I tried doing it in Write Contract, but it doesn't seem to be used for Read Contract anyway. Probably just caches the info?

  • When you try to interact with such method, it does not even display the error response on etherscan even though you can see it in the Network tab of DevTools.
    – Qwerty
    Commented Jan 11, 2022 at 17:05
  • Interestingly enough, by removing the view keyword from the function, I was able to call it from the Write Contract tab with a wallet connected, but I could not understand the value returned from the tx. The response did not appear in etherscan below the field.
    – Qwerty
    Commented Jan 11, 2022 at 17:38
  • Is Etherscan just flawed in this way with no fix? Commented Jan 12, 2022 at 15:10


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.