sol2ligo – sol2ligo公司区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,sol2ligo – sol2ligo公司区块链毕设代写 是一篇很好的国外资料

sol2ligo

Transpiler from Solidity to Ligo language for easier migrating to Tezos 🚀️

This project is Solidity to LIGO syntax converter and transpiler. It takes a .sol file as an input, parses it and yields PascalLIGO code as a result. It is able to convert conditionals, loops, functions and many more. Also it can emulate state and create router for multple entrypoints.

The project is in EXPERIMENTAL: it may crash or silently skip some statements, resulting code may be insecure or even plain wrong. Please do not deploy anything without prior review and audit.

📖️ Example

Input solidity code

contract FooBarContract {   function foo(uint number) internal returns (int) {     string[2] memory arr = ["hello", "world"];     bool isEven = number % 2 == 0;     int result = 42 * 42;     return isEven ? -1 : result;   } }

Translated LIGO code

function foo (const self : state; const number : nat) : (state * int) is   block {     const arr : map(nat, string) = map       0n -> "hello";       1n -> "world";     end;     const isEven : bool = ((number mod 2n) = 0n);     const result : int = (42 * 42);   } with (self, (case isEven of | True -> -(1) | False -> result end));

📚️ More examples

To further check out what this utility can produce, please refer to examples directory and Readme there: https://github.com/madfish-solutions/sol2ligo/tree/pretty-ligo/examples

🏗️ Installation

You need to have NodeJS installed on your machine. It was tested and developed using NodeJS v.10.13.0, but it’s expected to work on versions starting from v6.x.x up to v12.x.x

We suggest using node version manger (like nvm)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # relogin or source ~/.bashrc nvm i 12 

To try it out you will need Node.js, NPM and Iced Coffee Script

npm i -g iced-coffee-script npm i -g madfish-solutions/sol2ligo

Optional. You can install ligo compiler for tests

curl -o /tmp/ligo.deb https://ligolang.org/deb/ligo.deb dpkg -i /tmp/ligo.deb 

🌈️ Usage

sol2ligo <filename>

After transpiling you are likely gonna need to modify and thorougly audit the generated code. Follow transpiler warnings and comments inside the code to get more insight on what has to be done.

🏥️ Tests

You need clone github repository and install packages

git clone https://github.com/madfish-solutions/sol2ligo cd sol2ligo npm ci 

For full test run

npm test 

For quick testing run

npm run test-ext-compiler-fast

To run specific test case

npm run test-specific <test-name>

📑️ Documentation

Check out wiki for the knowledge base

Licensing

MIT


sol2ligo

从Solidity到Ligo语言的Transpiler更容易迁移到Tezos🚀️

该项目是LIGO语法转换器和transpiler的坚实基础。它以一个.sol文件作为输入,对其进行解析并生成PascalLIGO代码。它能够转换条件、循环、函数等等。它还可以模拟状态并为多个入口点创建路由器。

该项目正处于实验阶段:它可能会崩溃或悄无声息地跳过一些语句,生成的代码可能是不安全的,甚至是完全错误的。未经事先审查和审核,请勿部署任何内容。

📖️示例

输入可靠度代码

contract FooBarContract {   function foo(uint number) internal returns (int) {     string[2] memory arr = ["hello", "world"];     bool isEven = number % 2 == 0;     int result = 42 * 42;     return isEven ? -1 : result;   } }

翻译后的LIGO代码

function foo (const self : state; const number : nat) : (state * int) is   block {     const arr : map(nat, string) = map       0n -> "hello";       1n -> "world";     end;     const isEven : bool = ((number mod 2n) = 0n);     const result : int = (42 * 42);   } with (self, (case isEven of | True -> -(1) | False -> result end));

📚️更多示例

若要进一步检查此实用程序可以生成什么,请参阅示例目录和自述文件:https://github.com/madfish-solutions/sol2ligo/tree/pretty-ligo/examples

🏗️ 安装🌈️用法

您的机器上需要安装NodeJS。它是使用nodejsv.10.13.0进行测试和开发的,但是它预计可以在从v6.x.x到v12.x.x的版本上运行。

我们建议使用node版本管理器(如nvm)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # relogin or source ~/.bashrc nvm i 12 

来试用您需要的版本节点.js,NPM和冰咖啡脚本

npm i -g iced-coffee-script npm i -g madfish-solutions/sol2ligo

可选。您可以安装ligo compiler for tests

curl -o /tmp/ligo.deb https://ligolang.org/deb/ligo.deb dpkg -i /tmp/ligo.deb 

🏥️测试

sol2ligo <filename>

在传输之后,您可能需要修改并彻底审核生成的代码。按照transpiler的警告和代码中的注释来了解应该做什么。

📑️文件

您需要克隆github存储库并安装软件包,以便进行完整的测试运行

git clone https://github.com/madfish-solutions/sol2ligo cd sol2ligo npm ci 

以便快速运行测试

npm test 

要运行特定的测试用例,请查看wiki的知识库

npm run test-ext-compiler-fast

MIT

npm run test-specific <test-name>

许可

Check out wiki for the knowledge base

Licensing

MIT

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/16891.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » sol2ligo – sol2ligo公司区块链毕设代写

提供最优质的资源集合

立即查看 了解详情