hyperledger-solang / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.27k stars 216 forks source link

Add support for Soroban as a target #1129

Open tomerweller opened 1 year ago

tomerweller commented 1 year ago

Soroban is a new smart contracts platform built by and for the Stellar ecosystem. The Soroban environment utilizes Parity's WASMI runtime and is written in rust. The main contract developer SDK is also written in Rust.

Stellar is one of the most active L1 blockchains by TPS (according to realtps.net) and is connected to a global network of on and off ramps, including hundreds of thousands of cash agents (through moneygram). These factors make Soroban especially appealing for smart contract developers.

seanyoung commented 1 year ago

Very interesting. I think it's entirely possible to add support to Solang for Soroban contracts runtime.

This would require the following steps:

Now right now I don't think any of the maintainers have time to work on this, but we certainly are always available to help anyone with this. We have a call every weekday at 13:00 UTC on Hyperledger discord server #solang-meetup

leighmcculloch commented 1 year ago

@seanyoung Thanks for an outline into what work would be required.

@JakeUrban @graydon and I spent a small amount of time last week exploring what would be involved. We wrote (hacked together) some changes to get the most basic contract executing on Soroban, to help us understand how compatible Soroban would be with Solang, and Solidity, and identify blind spots.

I tried to capture that in comments on:

There are some problems that we'd have to come up with a story for:

seanyoung commented 1 year ago

@leighmcculloch very thorough and interesting!

So it looks like due differences with ethereum, it might be prudent to make Solidity on Soroban a slightly different dialect which does not support 256 bit integers. The contract could enforce that the constructor is called first (for non-pure functions) by setting some sort of flag.

Looks to me creating a Soroban target for Solang is entirely possible!

xermicus commented 1 year ago

@leighmcculloch @tomerweller what's the status of this; are you planning to go forward here?

leighmcculloch commented 1 year ago

Since I posted the list of interesting issues to solve, a couple things have changed in Soroban that makes it an easier fit I think:

I updated the list in https://github.com/hyperledger/solang/issues/1129#issuecomment-1402338915.