Setting up an environment for smart contract

Set up the environment for using Ethereum Remix IDE

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

This lesson preview is part of the newline's Introduction to Privacy on Ethereum course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to newline's Introduction to Privacy on Ethereum, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course newline's Introduction to Privacy on Ethereum
  • [00:00 - 00:09] In this lesson, we are going to be setting up the environment in which we are going to write the code in. And for this, we are going to be using remix.therium.org.

    [00:10 - 00:22] And this is an online IDE, which allows us to write solidarity. And it lets us also run it using an in-browser blockchain.

    [00:23 - 00:39] So we can compile the contracts with different solidarity versions that you can see here. For this, we are going to be using just 061, 060, just anything of that.

    [00:40 - 00:46] And we are going to run the auto compile. We're going to enable optimization.

    [00:47 - 00:53] I mean, that's really only for deployment if you want to. But we don't hear about these things too much.

    [00:54 - 01:03] So this is where you have the files. So when you write files, you get this contract by default to show you how it works.

    [01:04 - 01:12] So this is a contract that when you open remix, you will see this. And you can run this.

    [01:13 - 01:20] So this is basically where you have the contract. And after this, you can go to the compile.

    [01:21 - 01:24] And you can compile the contract. It will get compiled.

    [01:25 - 01:32] And you can of course see the API, the bytecode, and a few other things. And you can deploy and run transactions.

    [01:33 - 01:38] So you can see this environment. And the environment is basically what we're going to be using JavaScript.

    [01:39 - 01:49] It's extremely fast because it's running near browser. It does not really have any waiting times because it's more like an emulator.

    [01:50 - 01:59] So we can test our blockchain code very fast and very efficiently. It also has debuggers, which allows us to do other things.

    [02:00 - 02:05] And it gives us multiple accounts. So you can see each of the accounts have 100 ether.

    [02:06 - 02:14] And you have like about what, like 10 accounts. And you can specify of course the gas limit, the value that you are sending to the contract.

    [02:15 - 02:34] And, or if you, if you were using a different environment such as injection web 3 or web 3 provider, then you can also access the deployed contracts if you have the source code. So, and you can, you can also go and change things in settings.

    [02:35 - 02:47] So you can install different modules, which will help you to do different things. And you can also change, you can also change the viewing.

    [02:48 - 02:57] So I am now in a dark theme, but you can also change the theme within settings. So whichever one you prefer, you can customize it.

    [02:58 - 03:14] But for this, we are going to be looking at just writing the code and compiling it and running it. So we can test out the our code works and it's actually deployable and runnable .

    [03:15 - 03:27] But we are going to be doing it on, on the JavaScript VM because it's extremely fast. We are going to be using 060 or you can actually use any of these ones that you want.

    [03:28 - 03:36] And this is essentially how you specify which versions that you want. We will go through the code in a bit.

    [03:37 - 03:46] But this is just to get you to set up various different things. You don't need to install anything else for now.

    [03:47 - 03:56] Of course you are free to try out anything that you want. These are just different modules that you can install, which will help you to do different things.

    [03:57 - 04:06] And for now, we are just going to be starting with a plain file. So have a play around with this.

    [04:07 - 04:27] It also comes with the terminal where you have Ether.js installed web 3 version 1.0 and swam as well. So in this case, for example, I can just show you that you can write Ethers and then it will give you an Ethers instance.

    [04:28 - 04:43] So just to show you that it actually works, you can do Ethers.utils.id, which is how you hash anything. And you can just type anything in there.

    [04:44 - 04:53] And of course you would have to print it out to see the results. I mean, sometimes it doesn't have it out. Yes. So you can see this is like a hash of anything.

    [04:54 - 05:00] Okay, I got to 5.6 hash of that. So play around with this. Get to know this a little bit more.

    [05:01 - 05:12] And if you want to set up Visual Studio Code, you can also do that. But for this thing, we will only be looking at remix because it's easy to deploy it.

    [05:13 - 05:30] If you are running Visual Studio Code, I recommend that you go and install Gann ash CLI, which is also a blockchain emulator that you can run standalone. It's a blockchain that runs and mines on demand.

    [05:31 - 05:40] So all the links will be in the description below. So look at that. And if you have any questions, send me a message.