Ethereum Lottery Example Part 1: Setting Up Environment

Recommended Prerequisites

To get the most out of this example series, it’s best to have a general understanding of:

  1. Blockchain Basics
  2. The Ethereum Virtual Machine

Step 1: Open Remix

https://remix.ethereum.org/

Remix is a web based IDE allow us to develop and execute the Ethereum contract we are developing using the Solidity language.

I recommend using Google Chrome as your browser when working in Remix. Brave seemed to crash often.

Step 2: Activate Remix Plugin Modules

We’re going to use a plugin module called Deploy & Run Transactions.

Go to the plugin manager in the Remix IDE to install this plugin.

Figure 1: Plugin manager after installing Deploy & Run Transactions plugin module

Before we can deploy our contracts, we need to be able to compile them. We will install the Solidarity Compiler module for that.

Figure 2: Plugin manager after installing both the Deploy & Run Transactions plugin module and the Solidarity Compiler module.

Step 3: Deploy Default Contract to Memory

To validate our environment is set up correctly, let’s deploy the default sample storage contract to an in-memory blockchain before we proceed with development of our lottery contract.

https://youtu.be/GwvdxVYmG8o
Figure 3: Demonstration of running default contract in Remix IDE

Follow-up

The next article in this series will demonstrate a simple smart contract that both aggregates participants and uses third party oracle to securely generate a random number to determine a winner.

Ethereum Lottery Example Part 2: Participant Aggregation and Winner Selection

Leave a Reply

Your email address will not be published. Required fields are marked *