Skip to content

Commit

Permalink
Merge branch 'hover-formatting' into goto-definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
chioni16 committed Jul 16, 2023
2 parents 0486bc3 + b1ce7a3 commit e5c6d7a
Show file tree
Hide file tree
Showing 844 changed files with 5,916 additions and 3,012 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. What ledger are you using, e.g. Solana or Substrate
1. What ledger are you using, e.g. Solana or Polkadot
2. Provide both Solidity source and client code (e.g. TypeScript)
3. Provide Solang version number (output of `solang --version`)
3. What behavior are you seeing?
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
linux-x86-64:
name: Linux x86-64
runs-on: solang-ubuntu-latest
container: ghcr.io/hyperledger/solang-llvm:ci-3
container: ghcr.io/hyperledger/solang-llvm:ci-4
steps:
- name: Checkout sources
uses: actions/[email protected]
Expand All @@ -33,7 +33,7 @@ jobs:
name: Linux arm64
runs-on: linux-arm64
if: ${{ github.repository_owner == 'hyperledger' }}
container: ghcr.io/hyperledger/solang-llvm:ci-3
container: ghcr.io/hyperledger/solang-llvm:ci-4
steps:
- name: Checkout sources
uses: actions/[email protected]
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
lints:
name: Lints
runs-on: solang-ubuntu-latest
container: ghcr.io/hyperledger/solang-llvm:ci-3
container: ghcr.io/hyperledger/solang-llvm:ci-4
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
linux-x86-64:
name: Linux x86-64
runs-on: solang-ubuntu-latest
container: ghcr.io/hyperledger/solang-llvm:ci-3
container: ghcr.io/hyperledger/solang-llvm:ci-4
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -86,14 +86,14 @@ jobs:
- uses: actions/[email protected]
with:
name: solang-linux-x86-64
path: ./target/debug/solang
path: ./target/debug/solang


linux-arm:
name: Linux Arm
runs-on: linux-arm64
if: ${{ github.repository_owner == 'hyperledger' }}
container: ghcr.io/hyperledger/solang-llvm:ci-3
container: ghcr.io/hyperledger/solang-llvm:ci-4
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand Down Expand Up @@ -226,12 +226,12 @@ jobs:
--provenance=false \
--tag ghcr.io/${GITHUB_REPOSITORY}:latest \
--platform linux/arm64,linux/amd64 \
--label org.opencontainers.image.description="Solidity Compiler for Solana and Substrate version $(git describe --tags)"
--label org.opencontainers.image.description="Solidity Compiler for Solana and Polkadot version $(git describe --tags)"
anchor:
name: Anchor Integration test
runs-on: solang-ubuntu-latest
container: ghcr.io/hyperledger/solang-llvm:ci-3
container: ghcr.io/hyperledger/solang-llvm:ci-4
needs: linux-x86-64
steps:
- name: Checkout sources
Expand Down Expand Up @@ -278,7 +278,7 @@ jobs:
solana:
name: Solana Integration test
runs-on: solang-ubuntu-latest
container: ghcr.io/hyperledger/solang-llvm:ci-3
container: ghcr.io/hyperledger/solang-llvm:ci-4
needs: linux-x86-64
steps:
- name: Checkout sources
Expand Down Expand Up @@ -309,18 +309,18 @@ jobs:
run: npm run test
working-directory: ./integration/solana

substrate:
name: Substrate Integration test
polkadot:
name: Polkadot Integration test
runs-on: solang-ubuntu-latest
needs: linux-x86-64
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
# We can't run substrate as a github actions service, since it requires
# We can't run substrate node as a github actions service, since it requires
# command line arguments. See https://github.com/actions/runner/pull/1152
- name: Start substrate
- name: Start substrate contracts node
run: echo id=$(docker run -d -p 9944:9944 ghcr.io/hyperledger/solang-substrate-ci:e41a9c0 substrate-contracts-node --dev --ws-external) >> $GITHUB_OUTPUT
id: substrate
- uses: actions/setup-node@v3
Expand All @@ -334,28 +334,28 @@ jobs:
chmod 755 ./bin/solang
echo "$(pwd)/bin" >> $GITHUB_PATH
- run: npm install
working-directory: ./integration/substrate
working-directory: ./integration/polkadot
- name: Build ink! contracts
run: npm run build-ink
working-directory: ./integration/substrate
working-directory: ./integration/polkadot
- name: Build Solang contracts
run: npm run build
working-directory: ./integration/substrate
working-directory: ./integration/polkadot
- name: Deploy and test contracts
run: npm run test
working-directory: ./integration/substrate
working-directory: ./integration/polkadot
- name: cleanup
if: always()
run: docker kill ${{steps.substrate.outputs.id}}

substrate-subxt:
name: Substrate Integration test with subxt
polkadot-subxt:
name: Polkadot Integration test with subxt
runs-on: ubuntu-22.04
needs: linux-x86-64
steps:
- name: Checkout sources
uses: actions/checkout@v2
# We can't run substrate as a github actions service, since it requires
# We can't run substrate node as a github actions service, since it requires
# command line arguments. See https://github.com/actions/runner/pull/1152
- name: Start substrate
run: echo id=$(docker run -d -p 9944:9944 ghcr.io/hyperledger/solang-substrate-ci:e41a9c0 substrate-contracts-node --dev --ws-external) >> $GITHUB_OUTPUT
Expand All @@ -372,8 +372,8 @@ jobs:
with:
toolchain: stable
default: true
override: true
- run: 'parallel solang compile -v --target substrate --release -o ./contracts/ ::: ../substrate/*.sol ../substrate/test/*.sol'
override: true
- run: 'parallel solang compile -v --target polkadot --wasm-opt z -o ./contracts/ ::: ../polkadot/*.sol ../polkadot/test/*.sol'
working-directory: ./integration/subxt-tests
- name: Deploy and test contracts
run: cargo test -- --test-threads=1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Cargo.lock
/target
**/*.rs.bk
bundle.ll
tests/.tmp*

.helix/
.vscode/
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "solang-parser/testdata/solidity"]
path = testdata/solidity
url = https://github.com/ethereum/solidity
[submodule "integration/substrate/tornado/tornado-cli"]
path = integration/substrate/tornado/tornado-cli
[submodule "integration/polkadot/tornado/tornado-cli"]
path = integration/polkadot/tornado/tornado-cli
url = https://github.com/tornadocash/tornado-cli.git
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,61 @@
All notable changes to [Solang](https://github.com/hyperledger/solang/)
will be documented here.

## v0.3.1 Göttingen

### Added
- Write environment configuration into Substrate metadata. [xermicus](https://github.com/xermicus)
- Tornado cash as an exemplary integration test for Substrate chain extensions. [xermicus](https://github.com/xermicus)
- `is_contract` runtime API is available as a builtin for Substrate. [xermicus](https://github.com/xermicus)
- The `wasm-opt` optimizer now optimizes the Wasm bytecode on the Substrate target. [xermicus](https://github.com/xermicus)
- Call flags are now available for Substrate. [xermicus](https://github.com/xermicus)
- Read compiler configurations from toml file. [salaheldinsoliman](https://github.com/salaheldinsoliman)
- Accounts declared with `@payer(my_account)` can be accessed with the
syntax `tx.accounts.my_account`. [LucasSte](https://github.com/LucasSte)
- `delegatecall()` builtin has been added for Substrate. [xermicus](https://github.com/xermicus)
- `get_contents_of_file_no` for Solang parser. [BenTheKush](https://github.com/BenTheKush)
- `set_code_hash()` builtin has been aded for Substrate. [xermicus](https://github.com/xermicus)

### Fixed
- Diagnostics do not include large numbers anymore. [seanyoung](https://github.com/seanyoung)
- Correctly parse and resolve `require(i < 2**255)`. [seanyoung](https://github.com/seanyoung)
- Virtual function are available for call. [xermicus](https://github.com/xermicus)
- Allow `.wrap()` and `.unwrap()` user defined type methods in constants. [xermicus](https://github.com/xermicus)
- `@inheritdoc` now works with bases of bases. [seanyoung](https://github.com/seanyoung)
- Allow destructures to assign to storage variables. [seanyoung](https://github.com/seanyoung)
- Do not allow push and pop in fixed length arrays. [LucasSte](https://github.com/LucasSte)
- Improve unused variable elimination to remove unused arrays. [LucasSte](https://github.com/LucasSte)
- Salt argument should be of type `bytes32`. [seanyoung](https://github.com/seanyoung)
- Allow return vallues to be ignored in try-catch statements. [seanyoung](https://github.com/seanyoung)
- Optimize modifiers' CFGs. [xermicus](https://github.com/xermicus)
- Fix an error whereby building large contracts would cause an LLVM error. [LucasSte](https://github.com/LucasSte)
- A constructor for a Solana contract cannot run twice on the same data account. [seanyoung](https://github.com/seanyoung)
- Split the `call` and `deploy` dispatches on Substrate. [xermicus](https://github.com/xermicus)

### Changed
- Minimum Supported Rust Version (MSRV) is Rust `1.68`.
- `@payer` annotation declares an account in a constructor. [LucasSte](https://github.com/LucasSte)
- Do not allow `.call()` functions in functions declared as view. [seanyoung](https://github.com/seanyoung)
- Storage accessor function matches solc, and returns struct members if the sole return value is a single struct [seanyoung](https://github.com/seanyoung)
- **breaking** Constructor annotations above a constructor can either declare an account or receive a literal parameter. [LucasSte](https://github.com/LucasSte)
```
contract MyContract {
@payer(acc) // Declares account acc
@space(2+3) // Only literals or constant expressions allowed
@seed(myseed) // NOT ALLOWED
constructor(bytes myseed) {}
}
```
- Annotations placed before constructor arguments refer to the latter. [LucasSte](https://github.com/LucasSte)
```
contract MyContract {
@payer(acc) // Declares account acc
@space(2+3) // Only literals or constant expressions allowed
constructor(@seed bytes myseed) {}
// When an annotations refers to a parameter, the former must appear right before the latter.
}
```

## v0.3.0 Venice

The parser and semantic analysis stage of Solang have gone through
Expand Down
4 changes: 2 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

* @seanyoung @xermicus @LucasSte
src/emit/substrate/ @xermicus
src/emit/polkadot/ @xermicus
src/emit/solana/ @LucasSte @seanyoung
integration/substrate/ @xermicus
integration/polkadot/ @xermicus
integration/subxt-tests/ @xermicus
integration/solana/ @LucasSte @seanyoung
integration/anchor/ @LucasSte @seanyoung
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "solang"
version = "0.3.0"
version = "0.3.1"
authors = ["Sean Young <[email protected]>", "Lucas Steuernagel <[email protected]>", "Cyrill Leutwiler <[email protected]>"]
homepage = "https://github.com/hyperledger/solang"
documentation = "https://solang.readthedocs.io/"
license = "Apache-2.0"
build = "build.rs"
description = "Solang Solidity Compiler"
keywords = [ "solidity", "compiler", "solana", "substrate" ]
keywords = [ "solidity", "compiler", "solana", "polkadot", "substrate" ]
rust-version = "1.68.0"
edition = "2021"
exclude = [ "/.*", "/docs", "/examples", "/solana-library", "/tests", "/integration", "/vscode", "/testdata" ]
Expand All @@ -31,7 +31,7 @@ serde_derive = { version = "1.0" }
inkwell = { version = "0.2.0", features = ["target-webassembly", "no-libffi-linking", "llvm15-0"], optional = true }
blake2-rfc = "0.2.18"
handlebars = "4.3"
contract-metadata = "2.1"
contract-metadata = "3.0"
semver = { version = "1.0", features = ["serde"] }
tempfile = "3.4"
libc = { version = "0.2", optional = true }
Expand All @@ -42,38 +42,38 @@ sha2 = "0.10"
ripemd = "0.1"
bitvec = "1"
funty = "2.0"
itertools = "0.10"
itertools = "0.11"
num-rational = "0.4"
indexmap = "1.9"
indexmap = "2.0"
once_cell = "1.17"
solang-parser = { path = "solang-parser", version = "0.3.0" }
solang-parser = { path = "solang-parser", version = "0.3.1" }
codespan-reporting = "0.11"
phf = { version = "0.11", features = ["macros"] }
rust-lapper = "1.1"
anchor-syn = { version = "0.27.0", features = ["idl"] }
anchor-syn = { version = "0.28.0", features = ["idl"] }
convert_case = "0.6"
parse-display = "0.8.0"
parity-scale-codec = "3.4"
ink_env = "4.2.0"
ink_metadata = "4.2.0"
scale-info = "2.4"
petgraph = "0.6.3"
wasmparser = "0.106.0"
wasm-encoder = "0.28"
wasmparser = "0.107.0"
wasm-encoder = "0.29"
toml = "0.7"
wasm-opt = { version = "0.112.0", optional = true }
contract-build = { version = "3.0.1", optional = true }


[dev-dependencies]
num-derive = "0.3"
num-derive = "0.4"
primitive-types = { version = "0.12", features = ["codec"] }
wasmi = "0.29"
wasmi = "0.30"
# rand version 0.7 is needed for ed25519_dalek::keypair::generate, used in solana_tests/signature_verify.rs
rand_07 = { package = "rand", version = "0.7" }
sha2 = "0.10"
# solana_rbpf makes api changes in patch versions
solana_rbpf = "=0.2.38"
solana_rbpf = "=0.5.0"
byteorder = "1.4"
assert_cmd = "2.0"
bincode = "1.3"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/hyperledger/solang-llvm:ci-3 as builder
FROM ghcr.io/hyperledger/solang-llvm:ci-4 as builder

COPY . src
WORKDIR /src/stdlib/
Expand All @@ -9,7 +9,7 @@ RUN rustup default 1.68.0
WORKDIR /src
RUN cargo build --release

FROM ubuntu:20.04
FROM ubuntu:22.04
COPY --from=builder /src/target/release/solang /usr/bin/solang

LABEL org.opencontainers.image.title="Solang Solidity Compiler" \
Expand Down
Loading

0 comments on commit e5c6d7a

Please sign in to comment.