I’m trying to deploy a smart contract through remix IDE by connecting it to metamask. However it seems that remix is unable to recognize Zama network. Whenever I try to deploy the contract my metamask network automatically shifts to Linea Mainnet.
I’m using the following configuration in metamask for zama network:
Network name: Zama Network
Default RPC URL: devnet.zama.ai
Chain ID: 9000
Currency symbol: zama
Are you using the Zama Remix plugin? If it’s the case, the issue is due to a weird browser/Metamask issue. Basically, you need to go on https://remix.zama.ai/, then select Zama network in Metamask.
It’s happening because the provider selected on https://remix.ethereum.org/ could be different from the one selected in the plugin because the plugin is an iframe hosted on a different domain.
I select zama network in metamask and for the remix environment I select Injected Provider - Metamask. As soon as i try to deploy the metamask network changes to Linea Mainnet and I get an error for insufficient funds for tranfer.
I’m attaching some screenshots for your reference.
You have the Zama network configured correctly in Metamask
You select the Zama network, and injected Provider - Metamask. Therefore, you see Custom (9000) network below the select box. So far, your Metamask is on Zama’s network.
You deploy a contract and Metamask will show a popup to accept the deployment but Metamask autoswitched to Linea Network.
That is correct? If not, record a video or details each step. It looks like a very weird issue. Maybe you have another wallet in your browser and Remix is confused?
I think you might be right, remix is either getting confused or unable to detect zama network but I don’t have any other wallet other than metamask. However, I believe metamask is behaving strangely as well. I have 20 ZAMA in my account but it shows 0 Zama on the metamask homepage (screenshots attached). When I look at all the accounts I have, then i can see 20 ZAMA.
Steps:
I compile the contract on remix and in the deployment tab I select Injected Provider - Metamask. In the account section I see my account address along with currency (0 ether).
When I click on deploy, I get a pop with the error Gas Estimation Failed (insufficient funds for transfer) and I get an option to either “send transaction” or “cancel transaction.”
I click on “send transaction” after which I get a pop up from metamask asking to “Reject” or “Confirm” (screenshot attached). I believe this is where the network is actually switched in metamask.
I managed to make it work. I am not sure what was causing the problem but I noticed remix wasn’t detecting zama even when it was selected in metamask (it showed “Custom (59144) network”).
So I removed metamask extension from chrome, added it again and that did the trick. I can now deploy my sample smart contract through remix.