salaheldin
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Solang developer experience improvements. - **Project Name:** Solang Maintenance - **Contributor Name:** Salaheldin Soliman - **Payment Details:** USDT (ERC20) - **Address**: 0xf19d225a4b7dc1fcc53fbdad5a3d87bce53af3c6 - **[Level](https://github.com/w3f/Grants-Program/tree/master#level_slider-levels):** 1 ## Project Overview :page_facing_up: ### Overview Solang compiles Solidity smart contracts to Substrate and Solana targets. An in-depth overview of Solang's purpose and motivation can be found at https://hyperledger.github.io/hyperledger-hip/HIPs/solang.html. ### Solang Improvement Project Details The aim of this project is to improve Solidity developer experience on Substrate chains through undertaking the following two milestones: - [lmprove debug buffer usage](https://github.com/hyperledger/solang/milestone/5): - The debug buffer can be used by the smart contract as a way to communicate with the developer during runtime, e.g. for printing messages or displaying the return code of API calls into the runtime environment. Currently, the debug buffer lacks any kind of structure, which can make for an awkward debugging experience. The goal is to use a JSON data structure within the debug buffer. This makes its usage more human friendly and even allows front-end tools to parse the content of the debug buffer in a defined way. - Currently, runtime errors are lost. Solang inserts an `unreachable` instruction, causing nothing more than a regular `trap` in case of runtime errors (like arithmetic overflows, failed assert statements, etc..). The aim here is to output the runtime error in the formatted debug buffer, so that a developer knows what went wrong (this doesn't even happen in Ethereum's Solc currently). The line number of the solidity source file in which that error is encountered will be displayed as a further improvement. - The debug buffer is not something meant to be used in production deployments (pallet contracts does not even support this in production setups). However, at the time of writing, `solang` does not have any means to omit all code generation related to the debug buffer. This results in (potentially a lot of) wasted gas. So another goal of this milestone is to implement a CLI flag for the compiler that effectively turns all logic related to debug printing into No-Op. - [Solang projects](https://github.com/hyperledger/solang/milestone/6): - At the time of writing, the only way to configure the compiler's behavior is to use CLI flags and options. An ever-growing list of compiler options (like optimization flags) and possible runtime configuration options is making this more and more awkward. This information can be provided to the compiler via a `TOML` file, similar to what we see in other languages (e.g. `Cargo.toml`). - To make this work, the compiler will need to implement functionality to parse its options out of such a `TOML` file. Additionally, some tooling should be implemented to help our users working with it. The first one will be a new sub-command `solang new`, which generates a new "Project" containing `Solang.toml` file with sensible defaults as well as some Solidity [flipper example](https://github.com/hyperledger/solang#simple-example) contract. Naturally, the `new` subcommand provides some configuration options itself, like specifying the project name or runtime target. - A further issue addressed here is that a Solidity developer using Solang currently has no way to tell the compiler some information like contract authors and version. Since this information is needed for metadata generation, it is just populated with some non-meaningful default value. As a consequence, at the time of writing, `solang` users need to edit the metadata file manually after each and every compilation. - Another improvement is for specifying the runtime target configuration. As-is, developers only have some low-level options like specifying the `address` and `balance` (`value`) size used by the runtime. A better solution would be able to provide high-level representations of currently deployed on-chain runtime configurations and the compiler will take care of the rest. For instance, providing a target configuration of "Substrate version `X`" or "pallet contract nodes version `Y`" will inform the compiler to generate contracts compatible with the default configuration of pallet contracts in substrate version `X` or contacts node version `Y` respectively. Other possible options for the user should be to just directly specify the parachain, e.g. `Rococo` or `Shiden` (randomly named examples). ### Ecosystem Fit **Who is your target audience and how does your project fit into the ecosystem?** We still have a long way to go in terms of developer experience with Solidity on Substrate based chains. Although Solang as a compiler itself can be considered a huge step towards attracting solidity developers to the Polkadot/Kusama ecosystems: The Solidity developer experience on Ethereum far exceeds that of "Solidity Contracts on Substrate", caused by our inferior tooling and debugging story. The mentioned improvements are some immediate measures to address that. This grant will benefit any substrate parachain looking to leverage the possibility of using Solidity for their own good, as it will help level the developer experience for Solidity developers regardless whether they target Ethereum or Substrate. ## Contributor :busts_in_silhouette: ### Contact - **Contact Name:** Salaheldin Soliman - **Contact Email:** salaheldin_sameh@aucegypt.edu ### Relevant Experience Worked on Solang as part of the [Hyperledger Mentorship Program](https://wiki.hyperledger.org/display/INTERN). 1. Implemented [array bounds checks optimization](https://solang.readthedocs.io/en/latest/code_gen_options.html#array-bound-checks-optimization). 2. Implemented [multiplication overflow detection during runtime](https://github.com/hyperledger/solang/pull/988). 3. Implemented [constant overflow detection during compilation](https://github.com/hyperledger/solang/pull/1024#ref-commit-baaa425). 4. Improved [Solang's parser resilience](https://github.com/hyperledger/solang/pull/1068). ### Github Handle - https://github.com/salaheldinsoliman ### LinkedIn Profile - https://www.linkedin.com/in/salaheldinsoliman/ ## Development Status 📖 This project is a part of larger repository: [Hyperledger Solang](https://github.com/hyperledger/solang). Solang is a Solidity compiler for Solana and Substrate, a formal documentation for the repo can be found at https://solang.readthedocs.io/en/latest/. There was no formal research done on the topic, but it can be noted that Solidity developer experience on Substrate chains is falling behind Ethereum's. Discussions with Solang's owner [Sean Young](sean@mess.org) and maintainer [Cyrill Leutwiler](cyrill@parity.io) , from Parity, have further solidified this statement. The above-mentioned tasks are a further step to alleviate this, through giving Solidity devs a smoother experience creating and debugging his contracts via Solang. ## Development Roadmap 🔩 ### Overview - **Start Date:** December 20, 2022 - **Estimated Duration:** 6 Months + 1 month spare. - **Sprint/Period Duration:** First period(milestone): 4 months Second period(milestone): 3 months Grace period(Time allocated for events that are not pre-calculated, like emergencies or unexpected work): 1 month - **Full-Time Equivalent (FTE):** 0.5 FTE (20h per week) - **Total Costs:** $5,000 ### Milestone 1: Improve debug buffer usage - **Time Estimate**: 4 months - **FTE (Full time Equivalent)**: 0.5 - **Cost:** 3,000 USD | Number | Deliverable | Specification | | ------: | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **0a.** | License | Apache 2.0 | | **0b.** | Documentation | I will provide both **inline documentation** of the code and some basic instructions of how a Solidity developer can utilize the debug buffer. I will also provide **documentation** of the newly added runtime errors. | | **0c.** | Testing and Testing Guide | I will add unit tests to [Solang's Substrate integration tests](https://github.com/hyperledger/solang/tree/main/integration/substrate). The tests will ensure that the output of the omitted debug buffer is as expected(regarding prints, API calls, runtime errors and overall structure). Also, I will make sure that running Solang's test suite via `cargo test --workspace` produces no failing tests. | | **0d.** | Docker | There will be no independent DockerFiler for this milestone, because Solang has its own DockerFile, which can be used to test the mentioned functionalities. | | 1. | [Use structured data in the debug buffer](https://github.com/hyperledger/solang/issues/1048) | Completing this issue will result in a well structured debug buffer. | | 2. | [Print execution errors in the debug buffer](https://github.com/hyperledger/solang/issues/1083) | Now that the debug buffer is well structured, runtime errors can be inserted in it for the user to debug. | | 3. | [Execution errors to be passed with source file and line number](https://github.com/hyperledger/solang/issues/972) | Instead of having an arbitrary error emitted on the debug buffer, the line number of the instruction will be inserted so that the dev will have an easier debugging experience. | | 4. | Bug Fix | Fix [Bug: Substrate Integration tests fail to compile with -g](https://github.com/hyperledger/solang/issues/1051) | ### Milestone 2: Implement [Solang projects](https://github.com/hyperledger/solang/milestone/6): **Time Estimate:** 2 months **FTE (Full time Equivalent):** 0.5 **Cost:** 2,000 USD | Number | Deliverable | Specification | | ------: | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **0a.** | License | Apache 2.0 | | **0b.** | Documentation | I will provide both **inline documentation** of the code and some basic instructions of how a Solidity developer can utilize the command `solang new` and the `Solang.toml` file to provide compiler configuration | | **0c.** | Testing and Testing Guide | I will add unit tests to [Solang's Substrate intergation tests](https://github.com/hyperledger/solang/tree/main/integration/substrate). The tests will ensure that the generated contract runs as expected on the configured chain. The tests will also ensure other information like contract author and version are correctly inserted the `Solang.toml`. | | **0d.** | Docker | There will be no independent DockerFiler for this milestone, because Solang has its own DockerFile, which can be used to test the mentioned functionalities. | | 0e. | Article | I will write a blog post that describes the two milestone, the target audience would be Solidity developers who want to try out Substrate. | | 1. | Implement [Solang projects](https://github.com/hyperledger/solang/milestone/6) | The functionalities mentioned under `Solang Improvement Project Details: Solang Projects` will be delivered. | ### Assurance That the Current Project Owners Are Willing to Review/Accept Your Contributions: Discussions with project owner [Sean Young](sean@mess.org) and maintainer [Cyrill Leutwiler](cyrill@parity.io) resulted in that the issues presented above would be reviewed and merged. ## Current and Future Plans - Improve Substrate developer experience via the above-mentioned tasks - Continue improving Solang till maturation from the Substrate side. - Possibly develop an IDE based on Solang that matches Ethereum's Remix ## Additional Information :heavy_plus_sign: **How did you hear about the Grants Program?** Recommendation from Solang's maintainers [Sean Young](sean@mess.org) and [Cyrill Leutwiler](cyrill@parity.io)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully