Setup Remix
First we need to setup Remix to have the correct plugins installed, activated and configured. Before we do that, some general information!
Video
If you are a premium subscriber, you can watch the video here, otherwise please watch the video either on Udemy or on other Platforms where this course is published!
Generally about Remix
Remix, previously known as Browser-Solidity, is a browser based development environment for Smart Contracts. It comes with compilers for different solidity versions and a blockchain simulation. It also has plenty of other plugins. Itās a great way to get started!
Be careful with the https vs http domain. Remix stores edited files in localstorage of the browser. If your smart contracts are suddenly gone, look at the protocol.
In this course we work with http, not https. This is especially important later when we do private blockchains which require CORS to be setup correctly.
Open Remix
Go to http://remix.ethereum.orgā. You should be greeted with the following page:
If the popup shows up for you, then feel free to accept if you have no concerns over privacy violations. For our course we can do that.
Add a new File to Remix
Having the contract-folder selected, click the little new-file icon:
Name the file āMyContract.solā and add the following Content:
contract MyContract {
}
Plugins
Remix is built with a pluggable architecture. All functions are done via plugins. The Compiler is a plugin, the blockchain connection is a plugin, the debugging functionality is a plugin and there are a lot of other plugins that might be useful.
What you need in the next few chapters are
- The Solidity compiler
- The āDeploy & Run Transactionsā Plugin
Configure the Compiler
In this chapter we are working with Solidity 0.8.1. The compiler will normally switch automatically based on the pragma
line in your solidity files. But you can set a specific version, if necessary.
If you donāt know what that pragma line is and donāt want to wait several videos to understand what a pragma line is: In layman terms, itās here to configure your compiler. For example thereās a version pragma, that tells the compiler āHey, this source is made for compiler version XYZā. Thatās what weāre going to use. Need more information? Either wait, or read the official docsā
If it is necessary to switch compiler versions manually, you can always do this. You can either follow along in the videos, then use the compiler version the videos are using. Or you follow along this guide and use this solidity version.
New Compiler versions are published very frequently. It is very normal to find āoutdatedā solidity files around. Some very popular projects are using older solidity versions.
Make sure āauto-compileā is enabled:
There is a new option where Remix can be opened pre-configured with a link. I do not know how long thatās going to work, but hereās a link that enables the plugins and also enables auto-compile:
Great! Youāre all set! Letās go to the next section!