Skip to content
Bamboo: a morphing smart contract language
Branch: master
Clone or download
Pull request Compare This branch is 1 commit behind pirapira:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
bamboo-tests @ e9c50e7
.travis.yml Polish _oasis and opam configurations May 4, 2018
package.json Let’s see if this works Feb 2, 2018

Bamboo: a language for morphing smart contracts

Join the chat at

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


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


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 is another programming language that models smart contracts as state machines. Obsidian even tracks states of the contracts statically.

You can’t perform that action at this time.