Remix in VSCode now has DEPLOY & RUN

Filip Mertens
Remix Project

--

Until now, the Remix Extension in VSCode has been limited to compiling smart contracts and to plugins that further digest the results of those compilations.

In our latest release of the extension, v0.0.8, we have added Deploy & Run functionality!

Make transactions on public networks from VSCode

You can now make transactions on public networks via WalletConnect — which opens a connection to mobile wallets. Some of these wallets (the Metamask wallet, among others) have access to testnets.

Connect to Ganache

You can also open a connection to local networks, such as Ganache.

We are also working on a way to connect to Metamask — the browser plugin directly without forcing you to jump to a wallet on your phone — but that is still baking in the developmental oven will probably be ready in v0.0.9.

Download the extension here:
https://marketplace.visualstudio.com/items?itemName=RemixProject.ethereum-remix

Read about our spiffy VSCode extension here:
https://medium.com/remix-ide/a-remix-ide-extension-for-vscode-1f751fdeee46

Deploying & Running

Step 1: Activate the plugin

In the list of plugins in the extension, you will find Deploy & Run.
Click that to activate it.

The plugin will appear in a panel on the right of your editor.

Step 2: Connect

There are two options available to you:

  • Using any WalletConnect compatible wallet on your phone
  • Connecting to a local network, such as Ganache

Using WalletConnect applications and Ganache is beyond the scope of this article. But check out this great explanation of how Wallet Connect works in Remix:

In VSCode, the basic operation of connecting to WalletConnect is the same. Once you have connected you will see your addresses and connection status.

Watch the OUTPUT

VSCode has a panel at the bottom of your screen where the Terminal is displayed. This panel also contains an OUTPUT section where our extension will give you feedback on what’s happening when you use the extension.

Step 3: Compile

There two methods for compiling:

Compiling with the Solidity extension provides some extra features that are included in the Solidity extension.

NOTE: You should have a sol file actively selected when compiling. 
If you have the plugin in focus and not the .sol file, the compiling plugin won’t be able to tell which file you want to compile.

To compile use the command palette ( Shift+cmd+p ) and type in REMIX. You will see both options there.

Step 4: Deploy

After compiling, you‘ll see the contracts appear in a dropdown in the Deploy & Run panel. If your solidity file contains multiple contracts, you’ll need to select one you want to deploy.

Enter the arguments for you contract and hit ‘Deploy’.
Depending on how you are connected, you may have to sign the deployment (the transaction), for example in your WalletConnect application.

Once you have successfully deployed, the contract address appear.

Step 5: Running transactions

If you are accustomed to running transactions in Remix, this will look familiar to you. The Run section of the plugins displays the contracts you have deployed.

From here, you can interact with your contract the same way you do in Remix. If you are connected through the Wallet Connect app, you’ll have to sign those transactions whereas on Ganache you do not need to sign anything.

The results of your transactions will appear below in the Output section of the plugin in a similar way you see those results in the Terminal in Remix.

Let us know what you think

The Remix VSCode is in Beta — so any feedback you give will be very useful. Post issues: https://github.com/ethereum/remix-vscode/issues

You can always reach us on Twitter & Gitter TIA!

Useful links

Wallet Connect https://walletconnect.org/
Ganache https://www.trufflesuite.com/ganache

Download the Remix VSCode extension here:
https://marketplace.visualstudio.com/items?itemName=RemixProject.ethereum-remix

Info about the Remix VSCode extension

Info about the Remix WalletConnect plugin

--

--