• Stars
    star
    324
  • Rank 129,708 (Top 3 %)
  • Language
    OCaml
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bamboo see https://github.com/cornellblockchain/bamboo

Bamboo: a language for morphing smart contracts

Cornell Blockchain says they can now maintain the Bamboo compiler. https://github.com/CornellBlockchain/bamboo


Join the chat at https://gitter.im/bbo-dev/Lobby

Build Status

Bamboo is a programming language for Ethereum contracts. Bamboo makes state transition explicit and avoids reentrance problems by default. See manifest for the motivation, or tutorial if you want to deploy something first, or semantics if you need something resembling a definition.

Example Bamboo Code

Compiler

The Bamboo compiler sometimes produces bytecode, which needs to be tested.

As preparation,

  • install opam with OCaml 4.04.1
  • opam install bamboo should install bamboo.

When you check out this repository,

bamboo < src/parse/examples/006auction_first_case.bbo

produces a bytecode. Do not trust the output as the compiler still contains bugs probably.

bamboo --abi < src/parse/examples/006auction_first_case.bbo

prints ABI.

[{"type": "constructor", "inputs":[{"name": "_beneficiary", "type": "address"},{"name": "_bidding_time", "type": "uint256"},{"name": "_highest_bid", "type": "uint256"}], "name": "auction", "outputs":[], "payable": true},{"type":"fallback","inputs": [],"outputs": [],"payable": true}]

Developing Bamboo

To try Bamboo in your local environment, run make dep from the project folder. That should install all dependencies. Once the installation process is done, run eval $(opam config env) and then you can build all targets using make, and run the tests with make test.

When you modify the OCaml source of Bamboo, you can try your version by

$ make
$ ./lib/bs/native/bamboo.native < src/parse/examples/006auction_first_case.bbo

Embark

An Embark plugin for Bamboo is available. To use it, first install Embark and add then add the plugin to your DApp.

npm install -g embark
embark new AppName
cd AppName
npm install embark-bamboo --save

then add embark-bamboo to the plugins section in embark.json:

  "plugins": {
    "embark-bamboo": {}
  }

Afterwards Embark will recognize .bbo files and compile them with Bamboo.

How to Contribute

  • notice problems and point them out. create issues.
  • test the bytecode like this, but using other examples. You might find bugs in the compiler.
  • write new Bamboo code and test the compiler.
  • join the Gitter channel.
  • spread a rumor to your friends who are into programming languages.

Related Work

Linden Scripting Language

Linden Scripting Language has similar organization of code according to states.

Obsidian

Obsidian is another programming language that models smart contracts as state machines. Obsidian even tracks states of the contracts statically.

More Repositories

1

awesome-ethereum-virtual-machine

Ethereum Virtual Machine Awesome List
839
star
2

ethereum-formal-verification-overview

The start page about my efforts around smart contract verification
298
star
3

eth-isabelle

A Lem formalization of EVM and some Isabelle/HOL proofs
Isabelle
236
star
4

coq2rust

Coq to Rust program extraction. The whole tree is on the original Coq code base.
OCaml
214
star
5

evmverif

An EVM code verification framework in Coq
Coq
44
star
6

dry-analyzer

Dr. Y's Ethereum Contract Analyzer
Coq
42
star
7

vmtrace_visualizer

A program that annotates a vm trace with dataflow information
Ruby
35
star
8

ethereum-word-list

Words are Hard: Defining Common Terms in the Ethereum / Crypto Space
22
star
9

gohantabeyo

Gohantabeyo is a web site where people can make a wish whom they want to eat out with. If the other makes a similar wish, their wishes are told to both.
Ruby
15
star
10

cbc_casper

Isabelle formalization of binary consensus
Isabelle
8
star
11

record

6
star
12

neta

neta notes
HTML
5
star
13

rlp-ocaml

RLP serialization for OCaml
OCaml
4
star
14

practice

JavaScript
3
star
15

kissdb-rust

kissdb ported to rust
Rust
3
star
16

sql2lisp

Verilog
3
star
17

verbose-code-reading

Verboselly Logged Code Reading
2
star
18

token_why3

A Why3 modelling of a token contract
Coq
2
star
19

surreal

surreal numbers in Coq
Verilog
2
star
20

proofmarket

2
star
21

kietter

kietter
Ruby
2
star
22

js-graph-it-with-containers

a fork of http://js-graph-it.sourceforge.net/
JavaScript
2
star
23

ethereum-formal-list

A list of formal method applications on smart contracts
1
star
24

undecidable

undecidability club's web page
1
star
25

async_lazy_rpc

Haskell
1
star
26

taocp_in_coq

taocp_in_coq
1
star
27

htodo

a todo manager
Haskell
1
star
28

CLTT

Verilog
1
star
29

lifepicker

A randomized activity picker for your 5 minites
Python
1
star
30

waitfree

A combinator library for asynchronous waitfree computation among forkIO threads.
Haskell
1
star
31

haskell-twitter

1
star
32

thesis

1
star
33

game

combinatorial game
Verilog
1
star
34

ConcurrentSet

Haskell
1
star
35

pirapira.github.io

HTML
1
star
36

salary-nego

Salary negotiation app on the Nexus zkVM
Rust
1
star