Remix Project
Published in

Remix Project

Moonbeam Plugin for Remix

Remix now has a plugin for Moonbeam. This plugin lets Solidity devs build on Moonbeam, and gain access to the greater Polkadot ecosystem.

The instructional part of this article (below) is short because deploying to a Moonbeam chain is pretty straightforward. In fact, the Moonbeam plugin’s design is a streamlined version of the usual Remix development process because the compile and deploy functionality are in a single place.

You may not have heard about Moonbeam…

Moonbeam is an Ethereum-compatible smart contract platform that is a parachain on Polkadot. Existing Ethereum-based projects can port and maintain their protocols without any code changes while continuing to use familiar services and tools (like uhhh Remix).

For more info about Moonbeam, check their docs:
https://docs.moonbeam.network/
https://apps.moonbeam.network/moonbase-alpha

Moonbeam is not a riff off Frank Zappa’s daughter’s name, Moon Unit. It’s actually a riff off the song Frank Sinatra made popular, Polka Dots and Moonbeams.

You’ve probably heard of Polkadot, but here’s a little blurb…

Polkadot is a Layer Zero metaprotocol that unites heterogeneous shards (AKA parachains). You can’t deploy smart contracts directly to Polkadot, instead you deploy them to parachains, wherein you have access to the entire Polkadot network. And Moonbeam is a popular parachain.

Ethereum and EVM-compatible chains—like Moonbeam and Moonbeam’s Canary chain, Moonriver—use H160 accounts and ECDSA signatures. But the interesting thing is that Polkadot does not use this same account system. So Moonbeam becomes the interface users can employ to interact with Substrate-based assets while still using their existing H160 accounts.

Moonbeam Networks

Moonbeam is the name of the Moonbeam network’s parachain on Polkadot. Like Polkadot, Moonbeam was first deployed as a “canarynet” on Kusama called Moonriver. For Moonbeam and Moonriver, you’ll need appropriate tokens to spend on transaction fees. There is a testnet called Moonbase Alpha (which seems not to be named after a song) and new users can get DEV tokens via a faucet.

For those who are interested in building on Moonbeam or Moonriver, go to the documentation site.

Instructions for Using the Moonbeam Plugin in Remix

Activating the Moonbeam Remix Plugin…

  1. Go to the Plugin Manager tab
  2. Search for “Moonbeam”
  3. Press “Activate” and the Moonbeam Remix Plugin will be added directly above the Plugin Manager tab

Once you’ve added the plugin, a Moonbeam logo will appear on the left hand side, representing the Moonbeam Remix Plugin tab.

Getting Started with the Moonbeam Remix Plugin

Grab a contract to work with. You can use one of the default Remix contracts in the contracts folder of a workspace, or if you want to try this process with an ERC-20 contract, generate one with the Open Zeppelin Wizard and click the Open in Remix button.

Then in Remix, go to the Moonbeam plugin to connect to the Moonbase Alpha network by clicking the Connect to Moonbase Alpha button:

Or if you want to connect to the Moonriver network, use the following data in Metamask’s Custom RPC section:

But for Moonriver, you’ll need its tokens.

Compiling and Deploying in the Moonbeam Plugin

  1. Press “Connect” to connect your MetaMask to the Remix IDE
  2. Ensure you’re on the correct network. In this example, we’re on Moonbase Alpha
  3. Press Compile or choose Auto-Compile if you prefer
  4. Press Deploy and confirm the transaction in MetaMask

Only four steps — not bad for deploying a contract that will be readable on Polkadot’s network.

Here’s a video by the Moonbeam team, showing the plugin’s operation:

https://youtu.be/NBOLCGT5-ww

Once the contract is deployed, you’ll see the address and all available read/write methods to interact with it. You might need to scroll down to see the deployed instance:

When using the Moonbeam Remix Plugin, you can switch between using the traditional Remix Compile and Deploy Plugins and the Moonbeam Remix Plugin. The Moonbeam Plugin manages the compilation and deployment, all in the same place.

So try it out, and learn what you can do with this network!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store