Writing Smart Contracts FAQ (outdated)

StephanTualStephanTual London, EnglandPosts: 975Member, Administrator, Moderator admin
edited September 2014 in Education

Note this information is now outdated. Please instead see:

The basics

As of Proof of Concept 4 (POC4), smart contracts are written in higher-level languages such as Serpent (Python inspired), Mutan (Go inspired) or LLL (LISP inspired).

Whichever high-level language you opted to write your contracts in, this code is compiled down to EVM-code, the machine-readable code that runs on a virtual machine built in the Ethereum clients.

Tutorials are few and far between, and mostly written by the community: this is by design as we are rapidly iterating over each Proof of Concept and their feature set is changing quickly. We will of course issue extensive documentation for all reference clients, our APIs, etc, as development continues.


EVM-code, previously refered to as "EtherScript", will continue to improve as we develop the language. Right now we are at version 1, but Vitalik has released information about the upcoming version 2. This does not impact your Serpent, Mutan or LLL code: compilers will take care of converting to the 'current' version of EVM-code.

Our alpha python Serpent->EVM-code v1, compiler is now available at https://github.com/ethereum/compiler
We have a web version at http://multisig.info:3000/

Regarding LLL, the C++ reference client (AlethZero) has a built-in LLL -> EVM-code v1, compiler, so you won't need a separate app if you've chosen to write in this language.

Same for Mutan, where the latest Go client (ethereal) has a built-in Mutan to EVM compiler.

Tutorials and sample contracts

Mutan information can be found at:
Video tutorials playlist:
Language definition: http://obscuren.github.io/mutan/
Wiki: https://github.com/ethereum/go-ethereum/wiki
Maran Hidske wrote this comprehensive tutorial on building a Dapp in Mutan and HTML: http://hidskes.com/blog/2014/05/21/ethereum-dapp-development-for-web-developers/

Gav Wood has written a tutorial on LLL smart contracts on the C++ wiki:

Vitalik Buterin wrote the Serpent programming guide:

k1n0k0 has written a really fun smart contract simulator, 'EthSim', that you can access at:

Here's another contract simulator, alongside many functioning contract samples:

And a third, Mintchalk:

More contract samples by Jam10o


Check the videos in the Forums' "Education" category, here are a few selected samples:

Jeffrey Wilcke takes us through a basic meta coin example:

Joel Dietz had Joris Bontje take us through a Namecoin implementation demo.

First the code:

Then running inside EthSim:

Another contract, this time a sub-currency explainer video:

An escrow service implementation in Ethereum:

Amusing marriage contract:

Dennis McKinnon wrote a Lotto app, explained here:

Here's the tutorial for an 'egalitarian DAO':
Post edited by StephanTual on
This discussion has been closed.