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

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. And this is an online IDE, which allows us to write solidarity. And it lets us also run it using an in-browser blockchain. 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. And we are going to run the auto compile. We're going to enable optimization. I mean, that's really only for deployment if you want to. But we don't hear about these things too much. 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. So this is a contract that when you open remix, you will see this. And you can run this. So this is basically where you have the contract. And after this, you can go to the compile. And you can compile the contract. It will get compiled. And you can of course see the API, the bytecode, and a few other things. And you can deploy and run transactions. So you can see this environment. And the environment is basically what we're going to be using JavaScript. 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. So we can test our blockchain code very fast and very efficiently. It also has debuggers, which allows us to do other things. And it gives us multiple accounts. So you can see each of the accounts have 100 ether. 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. 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. 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. 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. 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 . 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. And this is essentially how you specify which versions that you want. We will go through the code in a bit. But this is just to get you to set up various different things. You don't need to install anything else for now. 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. And for now, we are just going to be starting with a plain file. So have a play around with this. 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. 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. 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. Okay, I got to 5.6 hash of that. So play around with this. Get to know this a little bit more. 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. 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. So all the links will be in the description below. So look at that. And if you have any questions, send me a message. [BLANK_AUDIO]