Lottery as a Smart Contract: The Business Logic

Lottery as a Smart Contract: The Business Logic

Writing a lottery contract is a great way to learn important Smart Contract concepts such as State, Event and Visibility. In this 3 part series, I will describe the logic and codes behind a Lottery Smart Contract. In developing my Lottery Contract, I used Oraclize, a data carrier service that executes external JSON web services.

Motivation

Escrow Service as a Smart Contract: The Business Logic

Escrow Service as a Smart Contract: The Business Logic

An area of Smart Contract development that has consistently intrigued me is its real world usage to disintermediate the middleman. There's one gem of a Smart Contract that achieves this in the Solidity documentation called Safe Remote Purchase.  This is the first blog post of a 2-parter where I will document how to execute Safe Remote Purchase using a combination of Remix and MetaMask.

Syncing Geth to the Ethereum Blockchain

Syncing Geth to the Ethereum Blockchain

(Updated, 29th May 2018: I have written an update to this article. Consider reading Ethereum Geth Syncing 101 in 2018 instead)

I run geth on my cloud server to sync with the Ethereum Blockchain. I start geth whenever I code and it goes into a round of resynchronization with the Blockchain. This takes anything from minutes (that's if the last time I code is yesterday), or hours (if the last time I did this was months ago). 

A DApp to capture supper expenses for buddies

Going Dutch - A Dapp to capture supper expenses for buddies

This is a continuation of the Going Dutch Smart Contract project that I started on 2nd Sep 2017. It has been a month, which is probably the equivalent of a year if you count in blockchain-time. Geth has gone from 1.6.7 to 1.7.2 and after upgrading my setup, I had to let it run overnight (in fast mode!) to sync my node to the block again.

Objective

Going Dutch on the Blockchain

Going Dutch on the Blockchain

My buddy, Mark and I have been hanging out on supper dates for the past 18 years. Sometimes he pays first and I forget to pay him back. The reverse happens at other times. We don't trust each other to maintain an Excel file to capture the records. I mean, look, what if Mark doctors the Excel file when I am not looking. This is obviously a great candidate for blockchain - now our records becomes immutable and the history of our misspending are forever etched in the blockchain.

Objectives

Ethereum Smart Contract execution with MetaMask

Ethereum Smart Contract execution with MetaMask

Mahesh Murthy has an amazing tutorial to setup an Ethereum environment to develop Truffle Dapps on the Ethereum blockchain. You can read it here. Part 1 of the tutorial explains the architecture of the Ethereum platforms and lets you execute a smart contract via a simple web page that runs locally. The blockchain runs locally using testrpc.