Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Constructor Support for Solang Solidity Contracts on Soroban #1674

Merged

Conversation

tareknaser
Copy link
Contributor

This PR is the first step towards implementing #1672. It adds constructor support for Solidity contracts in Solang. The next step, not covered in this PR, is handling cases where the user defines a __constructor function with custom logic. More details can be found in the issue discussion.

Changes Made

  • Renamed the init function (used to call storage_initializers) to __constructor so that it is recognized and invoked by the Soroban host environment.
  • Updated tests and CI to work with Soroban version 22.

@tareknaser tareknaser force-pushed the soroban_constructor22 branch 2 times, most recently from 239ae3f to ecac9fe Compare November 22, 2024 17:25
@tareknaser tareknaser force-pushed the soroban_constructor22 branch from ecac9fe to b66e4af Compare November 22, 2024 17:33
@tareknaser tareknaser force-pushed the soroban_constructor22 branch from b66e4af to ba848bb Compare November 23, 2024 01:21
@@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@1.75.0
- uses: dtolnay/rust-toolchain@1.81.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that change related to the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soroban-sdk 22.0.0-rc.3.2 requires rustc 1.79.0 or newer, and soroban-cli (which we use in the CI) now requires rustc 1.81.0 or newer.

Copy link
Contributor

@seanyoung seanyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@salaheldinsoliman salaheldinsoliman merged commit de4fc34 into hyperledger-solang:main Nov 27, 2024
17 of 18 checks passed
@tareknaser tareknaser deleted the soroban_constructor22 branch November 29, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants