Easily Create Ethereum Smart Contracts With Etherscripter

What is Etherscripter?

Etherscripter is a nifty little tool that lets people write smart contracts with easy to understand blocks. These blocks are automaticaly translated into XML, Serpent and LLL  (Solidity).

Smart contracts are an important evolution in the way that contracts can be written and agreed upon.

Example: You want to sell your website to a customer in March for 5000 USD. You agree upon the terms. However, as soon as march comes around, there is a misunderstanding. The buyer meant march of next year and the seller meant march of this year. Understandly, written contracts can be vague and often result in costly legal battles.

With the smart contract above, the terms and conditions are written down clearly with Blocks. This makes it easier for non tech-savvy to understand the content of the smart contract.

This is how the code blocks look in Serpent and Solidity:

Serpent

init:
  # *** An Ethereum smart contract to sell a website for "5000 by March"
  # First, store buyer's ethereum address:
  contract.storage["BUYER"] = 0x6af26739b9ffef8aa2985252e5357fde
  # Then, store seller's ethereum address:
  contract.storage["SELLER"] = 0xfeab802c014588f08bfee2741086c375
  # April 1, 2014 is 1396310400 in "computer time"
  contract.storage["DEADLINE"] = 1396310400
code:
  # If the agreed amount is received on time...
  if (contract.balance >= 5000*10^18 and block.timestamp <= contract.storage["DEADLINE"]):
    # ... then designate the buyer as the new website admin and pay the seller
    contract.storage["WEBSITE_ADMIN"] = contract.storage["BUYER"]
    send(contract.storage["SELLER"], contract.balance, (tx.gas - 100))

LLL (Solidity)

(seq
  ;; *** An Ethereum smart contract to sell a website for "5000 by March"
  ;; First, store buyer's ethereum address:
  (sstore "BUYER" 0x6af26739b9ffef8aa2985252e5357fde)
  ;; Then, store seller's ethereum address:
  (sstore "SELLER" 0xfeab802c014588f08bfee2741086c375)
  ;; April 1, 2014 is 1396310400 in "computer time"
  (sstore "DEADLINE" 1396310400)
  (return 0 (lll (seq ;; START BODY
  ;; If the agreed amount is received on time...
  (when (and (>= (balance) 5000ether) (<= (timestamp) (sload "DEADLINE")))
   (seq
    ;; ... then designate the buyer as the new website admin and pay the seller
    (sstore "WEBSITE_ADMIN" (sload "BUYER"))
    (call (- (gas) 100) (sload "SELLER") (balance) 0 0 0 0)
   )
  )
  ) 0)) ;; END BODY
)

 

The following sample Smart contracts are available:

  • Coin Flip
  • Sales Contract
  • Toothfairy
  • Vote Registry
  • Mitch Jack Bet
  • Swear Jar
  • Insurance Policy
  • Last Will
  • Marriage Contract
  • Rock Paper Scissors
  • Random Number Maker