Skip to content

Smart contract calling is not working with BrowserProvider #4067

Answered by ricmoo
dreamPerson0106 asked this question in Q&A
Discussion options

You must be logged in to vote

This often happens when the injected provider is not on the same network. If the contract is deployed on mainnet and MetaMask is connected to Görli, then when using the BrowserProvider, you are communicating with Görli, which will return 0x as the contract doesn’t live there.

Your error indicates the result from sending the request to the contract was 0x, so that’s my first guess…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@dreamPerson0106
Comment options

@JesseMorningstar
Comment options

@fukemy
Comment options

Answer selected by dreamPerson0106
Comment options

You must be logged in to vote
2 replies
@oforduh
Comment options

@fukemy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants