Category: ethereum

Ethereum Lottery Example Part 3: Collecting an Entrance Fee

See Part 2 Here Code Change: https://github.com/samuelfrench/solidity-lottery/commit/96c1763400c3b0f8603695ee4d4e4ef537f98df8 Changelog: Add balances mapping to have a constant-time way to look up entrants Make enter a payable function to accept an entrance fee Check entrance fee Check balance to see if they’ve entered before Add getLotteryBalance for debugging Update solidity version (not shown in commit) Add override modifier […]

Ethereum Lottery Example Part 2: Participant Aggregation and Winner Selection

Part 1 of this series: Ethereum Lottery Example Part 1: Setting Up Environment Develop Functionality to Randomly Select a Winner Before we jump into handling the monetary or scheduling part of things, let’s break this project down by first implementing and manually testing a contract that is able to aggregate a list of lottery entrants, […]

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: Blockchain Basics 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 […]