Ethereum For Beginners

Compile and Deploy smart contracts

Ethereum is one of the fast growing technology that is set to break all the records. Most of us wanted to explore this technology but due to lack of complete tutorials or beginner guide most of us struggle to get started with this technology. We prepared a beginner guide on the Ethereum blockchain that help you to get started with Ethereum blockchain development.

This is lesson 3 of Ethereum development beginner guide and this lesson shows how to compile the smart contracts and then how to deploy to JavaScriptVM. You can watch video below to go in more detail.

In lesson 2, we have learnt how to create simple student smart contract so we will use that smart contract for this lesson. In this lesson, you will learn two concepts, one is compile and second is deployment.

Compile Smart Contract

To compile smart contract, go to compile option and click on "Start to compile" option, this compile the smart contract and show if there are any warning or error. In this there are warnings or errors then smart contract shown in green background as shown below.

 

Compile Smart Contract

Compile Smart Contract

Deploy Smart Contract

Before we deploy smart contract, let's try to understand JavaScriptVM. In very simple words, we can say JavaScript virtual machine is inbuilt blockchain in remix IDE that can be used for testing purpose and this is in memory blockchain. We need to have at least one account to deploy smart contract to blockchain and JavaScriptVM gives us some default accounts that we can use. We get 5 accounts by default in JavaScriptVM as shown below.

 

JavaSciptVM Accounts

JavaSciptVM Accounts

We also need to understand the concept of gas. It means that whenever you are doing any operation on blockchain, either deploy the smart contract or create student record, you need to pay some money and that is known as gas. In Ethereum you need to pay gas in terms of ether. So the account that is used to deploy smart contract on blockchain need to have some ether in account as that need to be spend during deployment and testing phase.

Now you understand the concept of deployment and gas so let's see how we can deploy smart contract to JavaScriptVM. To do that, go to "Run" option and choose "JavaScrip VM" option from environment drop down.

Then click on "deploy" button to deploy that smart contract.

Deploy smart contract

Deploy smart contract

When smart contract is deployed on blockchain, it get stored at some address and that can be seen in below screen shot. It also show the set and get function to test the functionality.

Deployed smart contract address

Deployed smart contract address

Lesson Intro Video

Please login to get access to the quiz
Develop smart contract using solidity (Prev Lesson)
(Next Lesson) Deploy smart contracts to Ganache Blockchain
Back to Ethereum For Beginners
Inquire Now
close slider