1

I have come across a strange problem. My contract is on the Polygon network, but for example, when I connect to Metamask with the Binance network and run a function of my contract, it is done successfully. while it should throw error or a warning, should it? I should Handle this in the client ?

2 Answers 2

1

Yep, the client should make sure it's connected to the right network. The reason calling a function from your contract on another network doesnt throw is because theres no contract deployed on the other network, and when you send a transaction to an EOA, the calldata is simply ignored. You could deploy an empty contract at the same address (the deployment address of a contract is a function of the deployer address and the nonce, so you can perfectly deploy a contract at the same address on 2 different networks) to prevent this from happening

1
0

Yes, must handle it in the client. MetaMask is sending a transaction to an (probably) inexistente account on Binance Smart Chain. MetaMask has no way of knowing that your contract is on Polygon.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.