Apache License 2.0

项目介绍

pirapira/bamboo 是一个托管在 GitHub 上的开源项目,主要使用 OCaml 编写,采用 Apache License 2.0 许可证,目前获得 324 个 Star、41 次 Fork。

仓库全名
pirapira/bamboo
开源许可证
Apache License 2.0
Star 数
324
Fork 数
41
未关闭 Issue
49

README 摘要

Bamboo: a language for morphing smart contracts Cornell Blockchain says they can now maintain the Bamboo compiler. https://github.com/CornellBlockchain/bamboo 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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

bamboo 用什么语言开发?

主要使用 OCaml 编写,采用 Apache License 2.0 许可证,目前有 324 个 Star。

bamboo 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 bamboo 的源码?

可以直接克隆仓库:git clone https://github.com/pirapira/bamboo.git;安装与运行步骤见仓库 README。

bamboo 最近还在维护吗?

仓库最近一次更新为 2022年3月24日,当前有 49 个未关闭 Issue;Star 数为 324,可作为社区活跃度的参考。

简要分析

热度分
730
价值分
236
活跃状态
活跃

语言占比

JavaScript
Makefile
OCaml
Shell
Standard ML

README

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.

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.

评论

暂无评论