GithubHelp home page GithubHelp logo

doytsujin / solang Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperledger/solang

0.0 0.0 0.0 8.4 MB

A Solidity to wasm and bpf compiler written in rust

Home Page: https://solang.readthedocs.io/en/latest/

License: Apache License 2.0

Rust 93.31% C 3.00% Dockerfile 0.22% Solidity 1.26% Makefile 0.02% C++ 0.02% TypeScript 2.17%

solang's Introduction

solang - A Solidity to wasm compiler written in rust

Rocket.Chat CI Documentation Status license LoC

Welcome to Solang, a new Solidity compiler written in rust which uses llvm as the compiler backend. As a result, only the compiler front end needs to be written in rust.

Solang targets Substrate, Solana, ewasm, and Sawtooth. Solang is source compatible with Solidity 0.7, with some caveats due to differences in the underlying blockchain.

Solang is under active development right now, and has extensive documentation.

Simple example

First build Solang or use the docker image, then write the following to flipper.sol:

contract flipper {
	bool private value;

	constructor(bool initvalue) public {
		value = initvalue;
	}

	function flip() public {
		value = !value;
	}

	function get() public view returns (bool) {
		return value;
	}
}

Now run:

solang --target substrate flipper.sol

Alternatively if you want to use the solang docker image, run:

docker run --rm -it -v $(pwd):/sources hyperledgerlabs/solang -v -o /sources  --target substrate /sources/flipper.sol

You will have a file called flipper.contact. You can use this directly in the Polkadot UI, as if your smart contract was written using ink!.

License

Apache 2.0

solang's People

Contributors

atul9 avatar ebkalderon avatar jsulmont avatar kichjang avatar knarfytrebil avatar mul53 avatar seanyoung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.