From 5176166545df6090131565a990b303d9cfabf37e Mon Sep 17 00:00:00 2001 From: Sean Young Date: Fri, 27 Sep 2024 08:46:41 +0100 Subject: [PATCH] Move to new hyperledger-solang org Signed-off-by: Sean Young --- .github/workflows/dco.yml | 21 -------------- .github/workflows/release.yml | 14 +++++----- .github/workflows/test.yml | 10 +++---- CHANGELOG.md | 10 +++---- Cargo.toml | 2 +- README.md | 6 ++-- RELEASE_CHECKLIST.md | 2 +- docs/contributing.rst | 6 ++-- docs/examples.rst | 8 +++--- docs/extension.rst | 10 +++---- docs/index.rst | 4 +-- docs/installing.rst | 28 +++++++++---------- docs/language/managing_values.rst | 2 +- docs/running.rst | 4 +-- docs/targets/polkadot.rst | 2 +- docs/targets/solana.rst | 16 +++++------ docs/testing.rst | 8 +++--- fmt/src/solang_ext/safe_unwrap.rs | 2 +- integration/polkadot/chain_extension.sol | 2 +- integration/subxt-tests/README.md | 2 +- solang-parser/Cargo.toml | 2 +- solang-parser/src/helpers/fmt.rs | 2 +- src/bin/languageserver/mod.rs | 2 +- src/codegen/encoding/mod.rs | 4 +-- src/codegen/revert.rs | 2 +- .../strength_reduce/reaching_values.rs | 2 +- src/sema/yul/expression.rs | 4 +-- src/sema/yul/tests/expression.rs | 8 +++--- .../polkadot/arrays/multi_dim.sol | 2 +- .../polkadot/arrays/push_array_literal.sol | 2 +- .../destructure_assign_struct_member.sol | 2 +- .../destructure_assign_struct_member_2.sol | 2 +- .../solana/large_contract.sol | 2 +- .../solana/rational/rational.sol | 2 +- .../solana/shift_struct_member.sol | 2 +- tests/contract_testcases/solana/yul/parse.sol | 2 +- .../solana/yul/return_in_asm.sol | 2 +- ...310a0c4760ecd6751c916245de2ef625696f7b.sol | 2 +- tests/polkadot_tests/expressions.rs | 2 +- tests/polkadot_tests/primitives.rs | 2 +- tests/solana_tests/simple.rs | 2 +- vscode/README.md | 2 +- vscode/package.json | 1 + 43 files changed, 97 insertions(+), 117 deletions(-) delete mode 100644 .github/workflows/dco.yml diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml deleted file mode 100644 index 8ac615348..000000000 --- a/.github/workflows/dco.yml +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -name: DCO - -on: [pull_request] - -jobs: - dco_check: - runs-on: ubuntu-latest - name: DCO - if: ${{ github.actor != 'dependabot[bot]' }} - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@198af03565609bb4ed924d1260247b4881f09e7d - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@f2279e6e62d5a7d9115b0cb8e837b777b1b02e21 - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da4314230..bc9565c3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: linux-arm64: name: Linux arm64 runs-on: solang-arm - if: ${{ github.repository_owner == 'hyperledger' }} + if: ${{ github.repository_owner == 'hyperledger-solang' }} steps: - name: Checkout sources uses: actions/checkout@v4 @@ -43,7 +43,7 @@ jobs: sudo apt-get install -y gcc g++ make - uses: dtolnay/rust-toolchain@1.74.0 - name: Get LLVM - run: curl -sSL --output llvm16.0-linux-arm64.tar.xz https://github.com/hyperledger/solang-llvm/releases/download/llvm16-0/llvm16.0-linux-arm64.tar.xz + run: curl -sSL --output llvm16.0-linux-arm64.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-linux-arm64.tar.xz - name: Extract LLVM run: tar Jxf llvm16.0-linux-arm64.tar.xz - name: Add LLVM to Path @@ -69,7 +69,7 @@ jobs: with: submodules: recursive - name: Download LLVM - run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger/solang-llvm/releases/download/llvm16-0/llvm16.0-win.zip + run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-win.zip - name: Extract LLVM run: unzip c:\llvm.zip -d c:/ - name: Add LLVM to Path @@ -99,7 +99,7 @@ jobs: submodules: recursive - uses: dtolnay/rust-toolchain@1.74.0 - name: Get LLVM - run: curl -sSL --output llvm16.0-mac-arm.tar.xz https://github.com/hyperledger/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-arm.tar.xz + run: curl -sSL --output llvm16.0-mac-arm.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-arm.tar.xz - name: Extract LLVM run: tar Jxf llvm16.0-mac-arm.tar.xz - name: Add LLVM to Path @@ -126,7 +126,7 @@ jobs: submodules: recursive - uses: dtolnay/rust-toolchain@1.74.0 - name: Get LLVM - run: wget -q -O llvm16.0-mac-intel.tar.xz https://github.com/hyperledger/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-intel.tar.xz + run: wget -q -O llvm16.0-mac-intel.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-intel.tar.xz - name: Extract LLVM run: tar Jxf llvm16.0-mac-intel.tar.xz - name: Add LLVM to Path @@ -149,8 +149,8 @@ jobs: needs: [mac-arm, mac-intel] steps: - run: | - curl -sSL --output solang-mac-intel https://github.com/hyperledger/solang/releases/download/${GITHUB_REF/refs\/tags\//}/solang-mac-intel - curl -sSL --output solang-mac-arm https://github.com/hyperledger/solang/releases/download/${GITHUB_REF/refs\/tags\//}/solang-mac-arm + curl -sSL --output solang-mac-intel https://github.com/hyperledger-solang/solang/releases/download/${GITHUB_REF/refs\/tags\//}/solang-mac-intel + curl -sSL --output solang-mac-arm https://github.com/hyperledger-solang/solang/releases/download/${GITHUB_REF/refs\/tags\//}/solang-mac-arm lipo -create -output solang-mac solang-mac-intel solang-mac-arm - name: Upload binary uses: svenstaro/upload-release-action@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4af52feb..220310709 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -110,7 +110,7 @@ jobs: linux-arm: name: Linux Arm runs-on: solang-arm - if: ${{ github.repository_owner == 'hyperledger' }} + if: ${{ github.repository_owner == 'hyperledger-solang' }} steps: - name: Checkout sources uses: actions/checkout@v4 @@ -122,7 +122,7 @@ jobs: sudo apt-get install -y gcc g++ make - uses: dtolnay/rust-toolchain@1.74.0 - name: Get LLVM - run: curl -sSL --output llvm16.0-linux-arm64.tar.xz https://github.com/hyperledger/solang-llvm/releases/download/llvm16-0/llvm16.0-linux-arm64.tar.xz + run: curl -sSL --output llvm16.0-linux-arm64.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-linux-arm64.tar.xz - name: Extract LLVM run: tar Jxf llvm16.0-linux-arm64.tar.xz - name: Add LLVM to Path @@ -145,7 +145,7 @@ jobs: with: submodules: recursive - name: Download LLVM - run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger/solang-llvm/releases/download/llvm16-0/llvm16.0-win.zip + run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-win.zip - name: Extract LLVM run: unzip c:\llvm.zip -d c:/ - name: Add LLVM to Path @@ -181,7 +181,7 @@ jobs: submodules: recursive - uses: dtolnay/rust-toolchain@1.74.0 - name: Get LLVM - run: curl -sSL --output llvm16.0-mac-arm.tar.xz https://github.com/hyperledger/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-arm.tar.xz + run: curl -sSL --output llvm16.0-mac-arm.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-arm.tar.xz - name: Extract LLVM run: tar Jxf llvm16.0-mac-arm.tar.xz - name: Add LLVM to Path @@ -207,7 +207,7 @@ jobs: submodules: recursive - uses: dtolnay/rust-toolchain@1.74.0 - name: Get LLVM - run: wget -q -O llvm16.0-mac-intel.tar.xz https://github.com/hyperledger/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-intel.tar.xz + run: wget -q -O llvm16.0-mac-intel.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-intel.tar.xz - name: Extract LLVM run: tar Jxf llvm16.0-mac-intel.tar.xz - name: Add LLVM to Path diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b2e181ca..acc4a3c98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Changelog -All notable changes to [Solang](https://github.com/hyperledger/solang/) +All notable changes to [Solang](https://github.com/hyperledger-solang/solang/) will be documented here. ## Unreleased @@ -399,7 +399,7 @@ substrate contracts node `v0.22.1`. - On Solana, the accounts that were passed into the transactions are listed in the `tx.accounts` builtin. There is also a builtin struct `AccountInfo` - A new common subexpression elimination pass was added, thanks to - [LucasSte](https://github.com/hyperledger/solang/pull/550) + [LucasSte](https://github.com/hyperledger-solang/solang/pull/550) - A graphviz dot file can be generated from the ast, using `--emit ast-dot` - Many improvements to the solidity parser, and the parser has been spun out in it's own create `solang-parser`. @@ -430,7 +430,7 @@ substrate contracts node `v0.22.1`. - On the solang command line, the target must be specified. - The Solana instruction now includes a 64 bit value field - Many fixes to the parser and resolver, so solidity compatibility is much - improved, thanks to [sushi-shi](https://github.com/hyperledger/solang/pulls?q=is%3Apr+author%3Asushi-shi+is%3Aclosed). + improved, thanks to [sushi-shi](https://github.com/hyperledger-solang/solang/pulls?q=is%3Apr+author%3Asushi-shi+is%3Aclosed). ### Removed - The Sawtooth Sabre target has been removed. @@ -452,14 +452,14 @@ substrate contracts node `v0.22.1`. - The Solana target now compiles all contracts to a single `bundle.so` BPF program. - Any unused variables, events, or contract variables are now detected and - warnings are given, thanks to [LucasSte](https://github.com/hyperledger/solang/pull/429) + warnings are given, thanks to [LucasSte](https://github.com/hyperledger-solang/solang/pull/429) - The `immutable` attribute on contract storage variables is now supported. - The `override` attribute on public contract storage variables is now supported. - The `unchecked {}` code block is now parsed and supported. Math overflow still is unsupported for types larger than 64 bit. - `assembly {}` blocks are now parsed and give a friendly error message. - Any variable use before it is given a value is now detected and results in - a undefined variable diagnostic, thanks to [LucasSte](https://github.com/hyperledger/solang/pull/468) + a undefined variable diagnostic, thanks to [LucasSte](https://github.com/hyperledger-solang/solang/pull/468) ### Changed - Solang now uses LLVM 12.0, based on the [Solana LLVM tree](https://github.com/solana-labs/llvm-project/) diff --git a/Cargo.toml b/Cargo.toml index 534ab0ac5..d1a1a2fba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "solang" version = "0.3.3" authors = ["Sean Young ", "Lucas Steuernagel ", "Cyrill Leutwiler "] -repository = "https://github.com/hyperledger/solang" +repository = "https://github.com/hyperledger-solang/solang" documentation = "https://solang.readthedocs.io/" license = "Apache-2.0" build = "build.rs" diff --git a/README.md b/README.md index f3b1094bb..110ec0617 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ # solang - Solidity Compiler for Solana and Polkadot [![Discord](https://img.shields.io/discord/905194001349627914?logo=Hyperledger&style=plastic)](https://discord.gg/hyperledger) -[![CI](https://github.com/hyperledger/solang/workflows/test/badge.svg)](https://github.com/hyperledger/solang/actions) +[![CI](https://github.com/hyperledger-solang/solang/workflows/test/badge.svg)](https://github.com/hyperledger-solang/solang/actions) [![Documentation Status](https://readthedocs.org/projects/solang/badge/?version=latest)](https://solang.readthedocs.io/en/latest/?badge=latest) [![license](https://img.shields.io/github/license/hyperledger/solang.svg)](LICENSE) -[![LoC](https://tokei.rs/b1/github/hyperledger/solang?category=lines)](https://github.com/hyperledger/solang) +[![LoC](https://tokei.rs/b1/github/hyperledger/solang?category=lines)](https://github.com/hyperledger-solang/solang) Welcome to Solang, a new Solidity compiler written in rust which uses llvm as the compiler backend. Solang can compile Solidity for Solana and @@ -68,7 +68,7 @@ Here is a brief description of what we envision for the next versions. | Provide Solidity -> Polkadot porting guide | Not started | | Declare accounts for a Solidity function on Solana | In progress | | Tooling for calls between ink! <> solidity | In progress | -| Provide CLI for node interactions | [Done](https://github.com/hyperledger/solang-aqd) | +| Provide CLI for node interactions | [Done](https://github.com/hyperledger-solang/solang-aqd) | ## License diff --git a/RELEASE_CHECKLIST.md b/RELEASE_CHECKLIST.md index 690b2d035..48c51cd23 100644 --- a/RELEASE_CHECKLIST.md +++ b/RELEASE_CHECKLIST.md @@ -30,4 +30,4 @@ - Ensure ReadTheDocs defaults to the latest version - Update the version number and the MacOS binaries' sha256 hash in `Casks/solang.rb` under the repository `hyperledger/homebrew-solang`, - e.g. https://github.com/hyperledger/homebrew-solang/pull/11 + e.g. https://github.com/hyperledger-solang/homebrew-solang/pull/11 diff --git a/docs/contributing.rst b/docs/contributing.rst index 1d9510670..ecdcd1bfd 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -14,13 +14,13 @@ How to report issues -------------------- Please report issues to -`github issues `_. +`github issues `_. How to contribute code ---------------------- Code contributions are submitted via -`pull requests `_. +`pull requests `_. Please fork this repository and make desired changes inside a dedicated branch on your fork. Prior to opening a pull request for your branch, make sure that the code in your branch @@ -36,7 +36,7 @@ Target Specific Solang supports Polkadot and Solana. These targets need testing via integration tests. New targets like -`Fabric `_ need to be +`Fabric `_ need to be added, and tests added. Debugging issues with LLVM diff --git a/docs/examples.rst b/docs/examples.rst index 5fe99af52..635398780 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -33,8 +33,8 @@ ___________ There is an example on Solana's integration tests for a Solidity contract that manages an NFT. The contract is supposed to be the NFT itself. It can mint itself and transfer ownership. It also stores on chain information about itself, such as its URI. -Please, check `simple_collectible.sol `_ -for the Solidity contract and `simple_collectible.spec.ts `_ +Please, check `simple_collectible.sol `_ +for the Solidity contract and `simple_collectible.spec.ts `_ for the Typescript code that interacts with Solidity. @@ -43,7 +43,7 @@ ______________ On Solana, it is possible to create a hash table on chain with program derived addresses (PDA). This is done by using the intended key as the seed for finding the PDA. There is an example of how one can achieve so in our integration -tests. Please, check `UserStats.sol `_ -for the Solidity contract and `user_stats.spec.ts `_ +tests. Please, check `UserStats.sol `_ +for the Solidity contract and `user_stats.spec.ts `_ for the client code, which contains most of the explanations about how the table works. This example was inspired by `Anchor's PDA hash table `_. \ No newline at end of file diff --git a/docs/extension.rst b/docs/extension.rst index 19bd77e16..09ce06671 100644 --- a/docs/extension.rst +++ b/docs/extension.rst @@ -53,23 +53,23 @@ Development ----------- The code is spread over two parts. The first part the vscode extension client code, -`written in TypeScript `_. +`written in TypeScript `_. This part deals with syntax highlighting, and calling out to the Solang language server when needed. The client needs `npm and node installed `_. The client implementation is present in -`src/client `_. +`src/client `_. The extension client code is in -`src/client/extension.ts `_. +`src/client/extension.ts `_. Secondly, there is the language server which is written in Rust. The Solang binary has a subcommand ``language-server``, which starts the -`built-in language server `_. +`built-in language server `_. Once you have node and npm installed, you can build the extension like so: .. code-block:: bash - git clone https://github.com/hyperledger/solang + git clone https://github.com/hyperledger-solang/solang cd solang/vscode npm install npm install -g vsce diff --git a/docs/index.rst b/docs/index.rst index bc5920dd6..59fdbed90 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,7 +2,7 @@ :width: 75% :alt: Hyperledger Solang Logo :align: center - :target: https://github.com/hyperledger/solang + :target: https://github.com/hyperledger-solang/solang | @@ -19,7 +19,7 @@ or compute units. Solang aims for source file compatibility with the Ethereum EVM Solidity compiler, version 0.8. Where differences exist, this is noted in the language documentation. -The source code repository can be found on `github `_ +The source code repository can be found on `github `_ and we have solang channels on `Hyperledger Discord `_. Contents diff --git a/docs/installing.rst b/docs/installing.rst index 750caba93..aa08bf2bb 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -28,11 +28,11 @@ Option 2: Download binaries There are binaries available on github releases: -- `Linux x86-64 `_ -- `Linux arm64 `_ -- `Windows x64 `_ -- `MacOS intel `_ -- `MacOS arm `_ +- `Linux x86-64 `_ +- `Linux arm64 `_ +- `Windows x64 `_ +- `MacOS intel `_ +- `MacOS arm `_ Download the file and save it somewhere in your ``$PATH``, for example the bin directory in your home directory. If the path you use is not already in ``$PATH``, then you need to add it yourself. @@ -55,7 +55,7 @@ Option 3: Use ghcr.io/hyperledger/solang containers --------------------------------------------------- New images are automatically made available on -`solang containers `_. +`solang containers `_. There is a release `v0.3.3` tag and a `latest` tag: .. code-block:: bash @@ -74,7 +74,7 @@ First clone the git repo using: .. code-block:: bash - git clone https://github.com/hyperledger/solang + git clone https://github.com/hyperledger-solang/solang Then you can build the image using: @@ -118,7 +118,7 @@ These patches make it possible to generate code for Solana, and fixes concurrency issues in the lld linker. You can either download the pre-built libraries from -`github `_ +`github `_ or :ref:`build your own from source `. After that, you need to add the ``bin`` of your LLVM directory to your path, so that the build system of Solang can find the correct version of LLVM to use. @@ -126,8 +126,8 @@ Linux ~~~~~ A pre-built version of LLVM, specifically configured for Solang, is available at -``_ for x86 processors -and at ``_ for ARM. +``_ for x86 processors +and at ``_ for ARM. After downloading, untar the file in a terminal and add it to your path. .. code-block:: bash @@ -139,7 +139,7 @@ Windows ~~~~~~~ A pre-built version of LLVM, specifically configured for Solang, is available at -``_. +``_. After unzipping the file, add the bin directory to your path. @@ -151,8 +151,8 @@ Mac ~~~ A pre-built version of LLVM for intel macs, is available at -``_ and for arm macs there is -``_. After downloading, +``_ and for arm macs there is +``_. After downloading, untar the file in a terminal and add it to your path like so: .. code-block:: bash @@ -206,7 +206,7 @@ Once you have the correct LLVM version in your path, ensure you have GNU make in .. code-block:: bash - git clone https://github.com/hyperledger/solang/ + git clone https://github.com/hyperledger-solang/solang/ cd solang cargo build --release diff --git a/docs/language/managing_values.rst b/docs/language/managing_values.rst index 700984c33..3e60cb3e8 100644 --- a/docs/language/managing_values.rst +++ b/docs/language/managing_values.rst @@ -10,7 +10,7 @@ Value in Solidity is represented by ``uint128``. On Polkadot, contracts can be compiled with a different type for ``T::Balance``. If you need support for a different type, please raise an - `issue `_. + `issue `_. .. _balance: diff --git a/docs/running.rst b/docs/running.rst index 33ba2dd62..9f80fffa0 100644 --- a/docs/running.rst +++ b/docs/running.rst @@ -180,7 +180,7 @@ ______________________________ A solang project is a directory in which there are one or more solidity files and a ``solang.toml`` file where the compilation options are defined. Given these two components, a user can run ``solang compile`` in a similar fashion as ``cargo build``. -The ``solang new`` command creates a new solang project with an example `flipper `_ contract, +The ``solang new`` command creates a new solang project with an example `flipper `_ contract, and a default ``solang.toml`` configuration file. @@ -245,7 +245,7 @@ Running Solang using a container ________________________________ First pull the last Solang container from -`solang containers `_: +`solang containers `_: .. code-block:: bash diff --git a/docs/targets/polkadot.rst b/docs/targets/polkadot.rst index 825c3b5a8..94eea53b7 100644 --- a/docs/targets/polkadot.rst +++ b/docs/targets/polkadot.rst @@ -12,7 +12,7 @@ Solidity flavored for the Polkadot target has the following differences to Ether - Only functions called via rpc may return values; when calling a function in a transaction, the return values cannot be accessed There is a solidity example which can be found in the -`examples `_ +`examples `_ directory. Write this to flipper.sol and run: .. code-block:: bash diff --git a/docs/targets/solana.rst b/docs/targets/solana.rst index 32cfdbbc6..8da8951c8 100644 --- a/docs/targets/solana.rst +++ b/docs/targets/solana.rst @@ -95,7 +95,7 @@ _________________________ Please follow the `Solang Getting Started Guide `_. For more examples, see the -`solang's integration tests `_. +`solang's integration tests `_. Using the Anchor client library _______________________________ @@ -359,13 +359,13 @@ transferring token. This is the Solana equivalent of `ERC-20 `_ and `ERC-721 `_. Solang's repository contains a library ``SplToken`` to use spl-token from Solidity. The file -`spl_token.sol `_ should be copied into +`spl_token.sol `_ should be copied into your source tree, and then imported in your solidity files where it is required. The ``SplToken`` library has doc comments explaining how it should be used. There is an example in our integration tests of how this should be used. See -`token.sol `_ and -`token.spec.ts `_. +`token.sol `_ and +`token.spec.ts `_. .. _system_instruction_library: @@ -377,19 +377,19 @@ Solana's system instructions enable developers to interact with Solana's System create new accounts, allocate account data, assign accounts to owning programs, transfer lamports from System Program owned accounts and pay transaction fees. More information about the functions offered can be found both on `Solana documentation `_ -and on Solang's `system_instruction.sol `_ file. +and on Solang's `system_instruction.sol `_ file. The usage of system instructions needs the correct setting of writable and signer accounts when interacting with Solidity contracts on chain. Examples are available on Solang's integration tests. -See `system_instruction_example.sol `_ -and `system_instruction.spec.ts `_ +See `system_instruction_example.sol `_ +and `system_instruction.spec.ts `_ Minimum balance +++++++++++++++ In order to instantiate a contract, you need the minimum balance required for a Solana account of a given size. There is a function ``minimum_balance(uint64 space)`` defined in -`minimum_balance.sol `_ +`minimum_balance.sol `_ to calculate this. .. _account_management: diff --git a/docs/testing.rst b/docs/testing.rst index 9e604b14e..ef41aa421 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -2,13 +2,13 @@ Solang Test Suite ================= Solang has a few test suites. These are all run on each pull request via -`github actions `_. +`github actions `_. Solidity parser and semantics tests ----------------------------------- -In the `tests `_ directory, there are +In the `tests `_ directory, there are a lot of tests which call `fn parse_and_resolve()`. This function parses Solidity, and returns the *namespace*: all the resolved contracts, types, functions, etc (as much as could be resolved), and all the compiler diagnostics, i.e. compiler warnings and errors. These tests check that @@ -25,7 +25,7 @@ Codegen tests The stage after semantic analysis is codegen. Codegen generates an IR which is a CFG, so it is simply called CFG. The codegen tests ensure that the CFG matches what should be created. These tests are inspired by LLVM lit tests. The tests can found in -`codegen_testcases `_. +`codegen_testcases `_. These tests do the following: @@ -56,6 +56,6 @@ of the contract working memory to ensure there are no corruptions. Deploy contract on dev chain ---------------------------- -There are some tests in `integration `_ +There are some tests in `integration `_ which are written in node. These tests start an actual real chain via containers, and then deploying some tests contracts to them and interacting with them. \ No newline at end of file diff --git a/fmt/src/solang_ext/safe_unwrap.rs b/fmt/src/solang_ext/safe_unwrap.rs index f3ec77f8c..9fcc9b3a2 100644 --- a/fmt/src/solang_ext/safe_unwrap.rs +++ b/fmt/src/solang_ext/safe_unwrap.rs @@ -9,7 +9,7 @@ use solang_parser::pt; /// [pt::VariableDefinition] or [pt::EventDefinition], where the `name` field is `None` only when an /// error occurred during parsing. /// -/// [hyperledger/solang#1068]: https://github.com/hyperledger/solang/pull/1068 +/// [hyperledger/solang#1068]: https://github.com/hyperledger-solang/solang/pull/1068 pub trait SafeUnwrap { /// See [SafeUnwrap]. fn safe_unwrap(&self) -> &T; diff --git a/integration/polkadot/chain_extension.sol b/integration/polkadot/chain_extension.sol index 09af45b66..b5e8eb0df 100644 --- a/integration/polkadot/chain_extension.sol +++ b/integration/polkadot/chain_extension.sol @@ -2,7 +2,7 @@ import "polkadot"; contract ChainExtension { // Implementation on the node: - // https://github.com/hyperledger/solang-substrate-ci/blob/substrate-integration/runtime/src/chain_ext.rs#L43 + // https://github.com/hyperledger-solang/solang-substrate-ci/blob/substrate-integration/runtime/src/chain_ext.rs#L43 function fetch_random(bytes32 _seed) public returns (bytes32) { bytes seed = abi.encode(_seed); (uint32 ret, bytes output) = chain_extension(1101, seed); diff --git a/integration/subxt-tests/README.md b/integration/subxt-tests/README.md index 9ebdb63ec..595e6ff8c 100644 --- a/integration/subxt-tests/README.md +++ b/integration/subxt-tests/README.md @@ -10,7 +10,7 @@ The test cases requires compiled versions of the contracts from the `polkadot` i parallel solang compile -v --target polkadot --wasm-opt z -o ./contracts/ ::: ../polkadot/*.sol ../polkadot/test/*.sol ``` -Make sure to start a [solang-substrate-ci node](https://github.com/hyperledger/solang-substrate-ci) or a [substrate-contracts-node](https://github.com/paritytech/substrate-contracts-node) on the test host. +Make sure to start a [solang-substrate-ci node](https://github.com/hyperledger-solang/solang-substrate-ci) or a [substrate-contracts-node](https://github.com/paritytech/substrate-contracts-node) on the test host. Run only one test at the time against the node by setting the `RUST_TEST_THREADS=1` env var or by passing `-- --test-threads=1 ` to `cargo test`. diff --git a/solang-parser/Cargo.toml b/solang-parser/Cargo.toml index 03c48d8d5..59e1b6428 100644 --- a/solang-parser/Cargo.toml +++ b/solang-parser/Cargo.toml @@ -2,7 +2,7 @@ name = "solang-parser" version = "0.3.3" authors = ["Sean Young ", "Lucas Steuernagel ", "Cyrill Leutwiler "] -repository = "https://github.com/hyperledger/solang" +repository = "https://github.com/hyperledger-solang/solang" documentation = "https://solang.readthedocs.io/" license = "Apache-2.0" build = "build.rs" diff --git a/solang-parser/src/helpers/fmt.rs b/solang-parser/src/helpers/fmt.rs index c8ef21016..afc500fbb 100644 --- a/solang-parser/src/helpers/fmt.rs +++ b/solang-parser/src/helpers/fmt.rs @@ -1294,7 +1294,7 @@ impl Display for pt::YulSwitchOptions { // These functions are private so they should be inlined by the compiler. // We provided these `#[inline]` hints regardless because we don't expect compile time penalties // or other negative impacts from them. -// See: +// See: #[inline] fn fmt_parameter_list(list: &pt::ParameterList, f: &mut Formatter<'_>) -> Result { let iter = list.iter().flat_map(|(_, param)| param); diff --git a/src/bin/languageserver/mod.rs b/src/bin/languageserver/mod.rs index d48c9ba15..77f12a5ea 100644 --- a/src/bin/languageserver/mod.rs +++ b/src/bin/languageserver/mod.rs @@ -188,7 +188,7 @@ impl GlobalCache { // This requires a data structure that shows import dependencies between different files in the namespace. // 2. Need a way to safely remove stored Definitions that are no longer used by any of the References // -// More information can be found here: https://github.com/hyperledger/solang/pull/1411 +// More information can be found here: https://github.com/hyperledger-solang/solang/pull/1411 pub struct SolangServer { client: Client, target: Target, diff --git a/src/codegen/encoding/mod.rs b/src/codegen/encoding/mod.rs index bd83c6e30..dab27bb6f 100644 --- a/src/codegen/encoding/mod.rs +++ b/src/codegen/encoding/mod.rs @@ -621,7 +621,7 @@ pub(crate) trait AbiEncoding { if dims[dimension] == ArrayLength::Dynamic && !self.is_packed() { // TODO: This is wired up for the support of dynamic multidimensional arrays, like // TODO: 'int[3][][4] vec', but it needs testing, as soon as Solang works with them. - // TODO: A discussion about this is under way here: https://github.com/hyperledger/solang/issues/932 + // TODO: A discussion about this is under way here: https://github.com/hyperledger-solang/solang/issues/932 // We only support dynamic arrays whose non-constant length is the outer one. let sub_array = index_array(arr.clone(), dims, indexes, false); @@ -1141,7 +1141,7 @@ pub(crate) trait AbiEncoding { } } else { // TODO: This is wired up for multidimensional dynamic arrays, but they do no work yet - // Check https://github.com/hyperledger/solang/issues/932 for more information + // Check https://github.com/hyperledger-solang/solang/issues/932 for more information let sub_arr = index_array(array_var.clone(), dims, indexes, true); cfg.add( vartab, diff --git a/src/codegen/revert.rs b/src/codegen/revert.rs index 1c0750e1f..a9647ac2e 100644 --- a/src/codegen/revert.rs +++ b/src/codegen/revert.rs @@ -160,7 +160,7 @@ impl SolidityError { /// * StorageBytesEncodingIncorrect /// * OutOfMemory /// -/// Tracking issue: +/// Tracking issue: #[derive(Display, Debug, PartialEq, Clone, Copy)] #[non_exhaustive] #[repr(u8)] diff --git a/src/codegen/strength_reduce/reaching_values.rs b/src/codegen/strength_reduce/reaching_values.rs index 387eb60b6..722231a29 100644 --- a/src/codegen/strength_reduce/reaching_values.rs +++ b/src/codegen/strength_reduce/reaching_values.rs @@ -87,7 +87,7 @@ pub(super) fn reaching_values( /// Update the Variable's map based on the incoming set of values. Returns true if there was any /// changes in the set. -/// There is a discussion to improve this function: https://github.com/hyperledger/solang/issues/934 +/// There is a discussion to improve this function: https://github.com/hyperledger-solang/solang/issues/934 fn update_map(var_no: usize, set: &HashSet, map: &mut Variables) -> bool { return if let Some(existing) = map.get_mut(&var_no) { if existing.iter().next().map_or(false, |v| v.all_unknown()) { diff --git a/src/sema/yul/expression.rs b/src/sema/yul/expression.rs index b8e767a1e..f9180bfd6 100644 --- a/src/sema/yul/expression.rs +++ b/src/sema/yul/expression.rs @@ -393,7 +393,7 @@ pub(crate) fn resolve_function_call( func_call.loc, format!( "builtin '{}' is not available for target {}. Please, open a GitHub issue \ - at https://github.com/hyperledger/solang/issues \ + at https://github.com/hyperledger-solang/solang/issues \ if there is need to support this function", prototype.name, ns.target ), @@ -697,7 +697,7 @@ pub(crate) fn check_type( Some(Diagnostic::error( expr.loc(), "assignment to length is not implemented. If there is need for this feature, please file a Github issue \ - at https://github.com/hyperledger/solang/issues\ + at https://github.com/hyperledger-solang/solang/issues\ ".to_string(), )) } else { diff --git a/src/sema/yul/tests/expression.rs b/src/sema/yul/tests/expression.rs index 65e0041c8..9c93ab13e 100644 --- a/src/sema/yul/tests/expression.rs +++ b/src/sema/yul/tests/expression.rs @@ -1126,7 +1126,7 @@ contract testTypes { let ns = parse(file); assert!(ns .diagnostics - .contains_message("assignment to length is not implemented. If there is need for this feature, please file a Github issue at https://github.com/hyperledger/solang/issues")); + .contains_message("assignment to length is not implemented. If there is need for this feature, please file a Github issue at https://github.com/hyperledger-solang/solang/issues")); let file = r#" contract testTypes { @@ -1672,7 +1672,7 @@ contract foo { let ns = parse_and_resolve(OsStr::new("test.sol"), &mut cache, Target::Solana); - assert!(ns.diagnostics.contains_message("builtin 'gaslimit' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function")); + assert!(ns.diagnostics.contains_message("builtin 'gaslimit' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger-solang/solang/issues if there is need to support this function")); let file = r#" contract foo { @@ -1696,7 +1696,7 @@ contract foo { }, ); - assert!(ns.diagnostics.contains_message("builtin 'coinbase' is not available for target Polkadot. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function")); + assert!(ns.diagnostics.contains_message("builtin 'coinbase' is not available for target Polkadot. Please, open a GitHub issue at https://github.com/hyperledger-solang/solang/issues if there is need to support this function")); let file = r#" contract foo { @@ -1713,5 +1713,5 @@ contract foo { let ns = parse_and_resolve(OsStr::new("test.sol"), &mut cache, Target::Solana); - assert!(ns.diagnostics.contains_message("builtin 'log0' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function")); + assert!(ns.diagnostics.contains_message("builtin 'log0' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger-solang/solang/issues if there is need to support this function")); } diff --git a/tests/contract_testcases/polkadot/arrays/multi_dim.sol b/tests/contract_testcases/polkadot/arrays/multi_dim.sol index da855eedf..05188db12 100644 --- a/tests/contract_testcases/polkadot/arrays/multi_dim.sol +++ b/tests/contract_testcases/polkadot/arrays/multi_dim.sol @@ -1,4 +1,4 @@ -// https://github.com/hyperledger/solang/issues/860 +// https://github.com/hyperledger-solang/solang/issues/860 contract c { function test() public pure returns (uint256 ret1) { uint256[3][] vec; diff --git a/tests/contract_testcases/polkadot/arrays/push_array_literal.sol b/tests/contract_testcases/polkadot/arrays/push_array_literal.sol index 2213caac4..9bed2d4c2 100644 --- a/tests/contract_testcases/polkadot/arrays/push_array_literal.sol +++ b/tests/contract_testcases/polkadot/arrays/push_array_literal.sol @@ -1,4 +1,4 @@ -// https://github.com/hyperledger/solang/issues/859 +// https://github.com/hyperledger-solang/solang/issues/859 contract c { uint256[3][] s_vec; function test() public returns (uint256 ret1) { diff --git a/tests/contract_testcases/solana/destructure_assign_struct_member.sol b/tests/contract_testcases/solana/destructure_assign_struct_member.sol index e811fbf8e..5a43b6343 100644 --- a/tests/contract_testcases/solana/destructure_assign_struct_member.sol +++ b/tests/contract_testcases/solana/destructure_assign_struct_member.sol @@ -1,4 +1,4 @@ -// https://github.com/hyperledger/solang/issues/731 +// https://github.com/hyperledger-solang/solang/issues/731 contract TestContract { struct Data { bytes32 a1; diff --git a/tests/contract_testcases/solana/destructure_assign_struct_member_2.sol b/tests/contract_testcases/solana/destructure_assign_struct_member_2.sol index 279c39032..5614cacc7 100644 --- a/tests/contract_testcases/solana/destructure_assign_struct_member_2.sol +++ b/tests/contract_testcases/solana/destructure_assign_struct_member_2.sol @@ -1,4 +1,4 @@ -// https://github.com/hyperledger/solang/issues/731 +// https://github.com/hyperledger-solang/solang/issues/731 pragma solidity 0.6.12; interface IUniswapV2Pair { diff --git a/tests/contract_testcases/solana/large_contract.sol b/tests/contract_testcases/solana/large_contract.sol index 3a36e3ad2..47a15d24b 100644 --- a/tests/contract_testcases/solana/large_contract.sol +++ b/tests/contract_testcases/solana/large_contract.sol @@ -1,5 +1,5 @@ -// This is a test for issue #1367: https://github.com/hyperledger/solang/issues/1367 +// This is a test for issue #1367: https://github.com/hyperledger-solang/solang/issues/1367 // This contract used to generate so many calls to 'vector_new' for allocating error strings that it caused a LLVM ERROR: Branch target out of insn range import "solana"; diff --git a/tests/contract_testcases/solana/rational/rational.sol b/tests/contract_testcases/solana/rational/rational.sol index 446f11749..3ed4539c4 100644 --- a/tests/contract_testcases/solana/rational/rational.sol +++ b/tests/contract_testcases/solana/rational/rational.sol @@ -5,7 +5,7 @@ contract foo { } // Ensure - after scientific notation is not lexed - // https://github.com/hyperledger/solang/issues/1065 + // https://github.com/hyperledger-solang/solang/issues/1065 function test2() external { uint256 b = 500; uint256 a1 = 1e18-b; diff --git a/tests/contract_testcases/solana/shift_struct_member.sol b/tests/contract_testcases/solana/shift_struct_member.sol index 1cdffe2aa..7018fffcc 100644 --- a/tests/contract_testcases/solana/shift_struct_member.sol +++ b/tests/contract_testcases/solana/shift_struct_member.sol @@ -1,4 +1,4 @@ -// Test case for https://github.com/hyperledger/solang/issues/732 +// Test case for https://github.com/hyperledger-solang/solang/issues/732 library FixedPoint { struct uq144x112 { diff --git a/tests/contract_testcases/solana/yul/parse.sol b/tests/contract_testcases/solana/yul/parse.sol index 23969da85..68855a456 100644 --- a/tests/contract_testcases/solana/yul/parse.sol +++ b/tests/contract_testcases/solana/yul/parse.sol @@ -8,4 +8,4 @@ } } // ---- Expect: diagnostics ---- -// error: 5:44-55: builtin 'mload' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function +// error: 5:44-55: builtin 'mload' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger-solang/solang/issues if there is need to support this function diff --git a/tests/contract_testcases/solana/yul/return_in_asm.sol b/tests/contract_testcases/solana/yul/return_in_asm.sol index e1b80bf32..ae74f155b 100644 --- a/tests/contract_testcases/solana/yul/return_in_asm.sol +++ b/tests/contract_testcases/solana/yul/return_in_asm.sol @@ -8,4 +8,4 @@ contract Contract { // ---- Expect: diagnostics ---- // warning: 3:19-32: flag 'memory-safe' not supported -// error: 4:13-25: builtin 'return' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function +// error: 4:13-25: builtin 'return' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger-solang/solang/issues if there is need to support this function diff --git a/tests/optimization_testcases/programs/51310a0c4760ecd6751c916245de2ef625696f7b.sol b/tests/optimization_testcases/programs/51310a0c4760ecd6751c916245de2ef625696f7b.sol index 6e738ced8..d54e10599 100644 --- a/tests/optimization_testcases/programs/51310a0c4760ecd6751c916245de2ef625696f7b.sol +++ b/tests/optimization_testcases/programs/51310a0c4760ecd6751c916245de2ef625696f7b.sol @@ -1,7 +1,7 @@ contract foo { // make sure incrementer has a base contract with an empty constructor // is to check that the correct constructor is selected at emit time - // https://github.com/hyperledger/solang/issues/487 + // https://github.com/hyperledger-solang/solang/issues/487 constructor() {} } diff --git a/tests/polkadot_tests/expressions.rs b/tests/polkadot_tests/expressions.rs index 8f5ecaec2..103ae07f9 100644 --- a/tests/polkadot_tests/expressions.rs +++ b/tests/polkadot_tests/expressions.rs @@ -1534,7 +1534,7 @@ fn div() { } function test2() public { - // see https://github.com/hyperledger/burrow/pull/1367#issue-399914366 + // see https://github.com/hyperledger-solang/burrow/pull/1367#issue-399914366 assert(int256(7) / int256(3) == int256(2)); assert(int256(7) / int256(-3) == int256(-2)); assert(int256(-7) / int256(3) == int256(-2)); diff --git a/tests/polkadot_tests/primitives.rs b/tests/polkadot_tests/primitives.rs index 71d438817..33996d308 100644 --- a/tests/polkadot_tests/primitives.rs +++ b/tests/polkadot_tests/primitives.rs @@ -404,7 +404,7 @@ fn signed_literal_unsigned_cast() { #[test] fn mul() { - // https://github.com/hyperledger/solang/issues/1507 + // https://github.com/hyperledger-solang/solang/issues/1507 let mut runtime = build_solidity( r#" contract Test { diff --git a/tests/solana_tests/simple.rs b/tests/solana_tests/simple.rs index f37525bdb..505452fa6 100644 --- a/tests/solana_tests/simple.rs +++ b/tests/solana_tests/simple.rs @@ -252,7 +252,7 @@ fn incrementer() { contract foo { // make sure incrementer has a base contract with an empty constructor // is to check that the correct constructor is selected at emit time - // https://github.com/hyperledger/solang/issues/487 + // https://github.com/hyperledger-solang/solang/issues/487 constructor() {} } diff --git a/vscode/README.md b/vscode/README.md index de2ae009a..736064e77 100644 --- a/vscode/README.md +++ b/vscode/README.md @@ -16,7 +16,7 @@ For more information on Solang itself and the extension, please go to the [docum ## Dependencies The solang compiler executable needs to be installed, which can be downloaded from -the [Solang Releases Page](https://github.com/hyperledger/solang/releases). Then +the [Solang Releases Page](https://github.com/hyperledger-solang/solang/releases). Then you have to configure the path to the solang executable extension settings, and also which target you wish to compile file. diff --git a/vscode/package.json b/vscode/package.json index 84aec8c79..2d5236381 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -117,6 +117,7 @@ "glob": "^7.1.6", "mocha": "^7.1.2", "tap": "^21.0.1", + "tape": "^5.9.0", "typescript": "^5.3.3" }, "__metadata": {