Skip to content

vindaloo-thesis/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Idris Ethereum smart contracts

Example contracts to show how to use Idris as a smart contract language for the Ethereum platform.

Prerequisites

For compiling to actual EVM code (not yet fully possible due to back end output size), you need either:

  • pyethereum (for running Serpent code in a simulator), or
  • An Ethereum client like AlethZero to compile the LLL code

Building

For example, building the Rock-Paper-Scissors sample. Assuming idris-se and examples are checked out in the same directory.

Compiling to Serpent and then to LLL:

idris -p effects -p contrib idris/RPS_SIO.idr -i idris/ -i ../idris-se/lib --codegen se --interface -o rps.se --no-partial-eval
serpent compile_to_lll rps.se > rps.lll

Run using the test runner (should work):

idris -p effects -p contrib idris/RPS_IO.idr -i ../idris-se/lib -i idris  -o rps --no-partial-eval && ./rps

About

Code samples inspiring language design

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published