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¶
What's Remix anyways?
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!
HTTP vs HTTPS
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.
Version Pragma
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
Switch Compiler Version
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:
Open Remix Pre-Configured
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!