Ethereum – Sample Smart Contracts

Documentation & Introduction

Solidity Documentation

Solidity Baby Steps

From euri10 below.


DAOs

The DAO
Note that this code has the recursive call vulnerability that allowed a hacker to steal USD 50 million.


BTC Relay

BTC Relay


Ethereum Wallet (Mist) Multisig Contract

Ethereum Wallet (Mist) Multisig Contract

From How to verify Mist’s standard multisig wallet using Etherscan tool? and Documentation On Multisig Wallet in Mist?.


Proof Of Existence

NoterEth

NoterEth, pronounced “Notaryth”, is a prototype notary and “Proof of Existence” DAPP. By submitting hashes of documents you can proof on a later date that you were privileged to certain information at a point in history. The transfer of documents can enable other contracts to allow certain access based on who owns a hash.


Libraries & Utilities

Random Number Generators

Ethereum Date And Time Tools

Working prototype.

StringUtils #1

From decypha in the reddit/r/ethereum post.

Basic string utilities for Solidity, optimized for low gas usage.

StringUtils #2

By @pipermerriam from How can I modify bytes32 result to uint? by @euri10.

Ethereum Alarm Clock

Schedule calls to Ethereum contracts.


Tokens & Currencies

The Good Old Greeter

Token

Create your own crypto-currency.

The Great Unicorn Meat Grinder

Grind up your Unicorn Tokens into dogfood meat.

Community Currency

A work-in-progress.


Exchange

Etheropt

A decentralised options exchange.

EtherEx

A decentralised exchange – alpha.

Customizable Atomic Swap Contract

Posted by reddit user David_Moskowitz on Customizable Atomic Swap Contract (DGD for Ether).


Gambling

Ether Dice

A place where you can throw away your ethers.

Ethereum Dice (or Simple Dice Game)

Another place where you can throw away your ethers.

Sleth – Ethereum Slot Machine

Working prototype.

EtherPot

You can’t smoke this. It’s a provably fair Lottery.


Pyramid Schemes

GovernMental

As posted by reddit user ethererik on GovernMental’s 1100 ETH jackpot payout is stuck because it uses too much gas , the payout for this pyramid scheme may be stuck because the payout code requires the array of past creditors and amounts to be cleared, and this operation costs too much gas. The code to clear internal storage is:

Apparently 1100 ethers are stuck in limbo.

WARNING – This is a situation Smart Contract developers need to be aware of!

The question How to clear large arrays without blowing the gas limit? has one answer to work around this issue. Thanks @Nick Johnson.

Ethereum Pyramid

A Pyramid scheme.

King Of The Ether Throne

Become a King or Queen, get rich and immortalise your name.

The Greed Pit

Ethereum Doubler

Double your ether. Ponzi.

Protect The Castle

Another Ponzi game.


Messages

Etherboard

An image powered by the blockchain.

Ethereum Wall

A decentralised and open public message board.

Decentralised Twitter

Working prototype.


Not Categorised Yet

Meteor Dapp Wallet

Multi-sig, daily-limited account proxy/wallet – “The Ξthereum wallet. NOTE The wallet is not yet official released, can contain severe bugs!”

Maker

Maker is a Decentralized Autonomous Organization that creates and insures the dai stablecoin on the Ethereum blockchain.

There are several public dapps and libraries in the Maker ecosystem:

Higher level information about Maker can be found here:

EtherId

Register a domain name for your Ethereum account.

Public Votes

A publicly verifiable Voting System – working prototype.

State of the Dapps

SafeMarket

From aakilfernandes in the reddit/r/ethdev post – “Check out dapps.ethercast.com and look in repos, then search for .sol or .se files. Got a couple dozen here if you’d like to take a look.”

Oraclize

From bertani in the reddit/r/ethdev post – “Here you can find some Oraclize-based ones ;)”.

ether.camp

From inasacu in the reddit/r/ethdev post – “Try ether.camp”.

I have moved the links above from the answer to my Ethereum.StackExchange.com question Where can I find some Solidity / Smart Contract source code examples?.