We are excited to announce that Solang has been accepted as the latest Hyperledger® project and has been renamed as Hyperledger Solang™. The project is now formally being incubated as a top-level project by the Hyperledger Foundation™, hosted by the Linux Foundation, and has support from multiple sponsors.
Solang started in the Hyperledger Labs since we always wanted to work together with other Hyperledger projects. The very first ledger we supported was Hyperledger Burrow. Being part of Hyperledger Labs was a great way to give the project more visibility and ensure we could make use of the great tooling provided by Hyperledger. After tapping into those resources, Hyperledger Solang, a tool that enables smart contract portability, is now the newest Hyperledger project.
Hyperledger Solang is a compiler for Solidity source code and targets different blockchains.
The idea for Solang arose from early work on Hyperledger Burrow. We were trying to do things with Solidity that were not possible with the existing Ethereum Solidity compiler. Since that compiler is specific for Ethereum, there was no interest in supporting features for Hyperledger Burrow. From that problem, a portable Solidity compiler that could support many blockchains was born, making it possible to have different features depending on which blockchain is being targeted.
The Solidity programming language is the most popular language for smart contracts, and there is clear interest from many blockchains to have support for it. Although some blockchains emulate an EVM environment to maintain compatibility with Solidity built with Solc, they cannot access missing features from Ethereum that an emulated EVM environment cannot provide, such as cryptographic functions, like blake2, zero-knowledge proof and the ability to call native contracts or be called by them. Hyperledger Solang offers the ability to compile Solidity to native execution environments other than the EVM, allowing the language many new possibilities and innovations.
Currently, Hyperledger Solang supports Solana and Polkadot (Substrate).
Hyperledger Solang compiles Solidity into a native contract and a corresponding metadata file. Deploying a compiled contract needs tooling from the corresponding target blockchain.
First follow the installation guide for installing Solang: https://solang.readthedocs.io/en/latest/installing.html and then follow the steps for Solana https://solang.readthedocs.io/en/latest/targets/solana.html or Substrate https://solang.readthedocs.io/en/latest/targets/substrate.html
For Solana, we have the @solana/solidity npm package for deploying and interacting with Solang compiled contracts. To compile Solidity for Solana, use:
$ solang compile –target solana source.sol
This will produce an ABI file for each contract, and a single binary contract called `bundle.so`.
For Polkadot or Substrate, the native @polkadot/api-contract npm package can be used. The command line for compiling Solidity for Substrate is:
$ solang compile –target substrate source.sol
For each contract found in the file a `.contract` file is produced.
There are examples in the documentation and in the integration tests of how to run these contracts.
We also have a visual studio code extension, which provides real-time compiler warnings and errors as well as type information when you hover over variables and functions.
Please head to the github d ocumenationpage https://github.com/hyperledger-labs/solang documentation page https://solang.readthedocs.io/en/latest/
If you want to get involved, we have a curated list of good first issues to work on in our github issue tracker: https://github.com/hyperledger/solang/labels/good%20first%20issue.
We are always available on the #solang channel on the hyperledger discord, and we run a daily discord meeting at 13:30 UTC in #solang-meetup. For more details, see the Hyperledger calendar of public meetings: https://wiki.hyperledger.org/display/HYP/Calendar+of+Public+Meetings. We look forward to welcoming you.