1

Try window.ethereum.on('networkChanged', handleChainChanged) From what I know, the new MetaMask api (which will change this command to 'chainChanged') is not yet live.


1

I'd like to return to the first issue: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8545/. (Reason: CORS request did not succeed). If you're trying to connect to localhost:8545, I assume that you're trying to connect MetaMask to a local node. Essentially, MetaMask is trying to connect to ...


1

Here: contract.methods.viewNewestComment().call().then(console.log); contract.methods.createLocation("test-location4", "comment4").call().then(console.log); Your two ABI-encoded objects are: contract.methods.viewNewestComment() contract.methods.createLocation("test-location4", "comment4") If the encoded function changes the state of the contract, then ...


1

I had the same issue and using once for events filtering also didn't work. I had to stop provider from polling events. You can do it like this: bytesContract.provider.polling = false This is what ethers documentation says about it prototype.polling mutable If the provider is currently polling because it is actively watching for events. This may be ...


Only top voted, non community-wiki answers of a minimum length are eligible