mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 02:11:08 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 046455db06 | |||
| 70037e1136 | |||
| c0cdde5a5a | |||
| df1921ba93 | |||
| 84018c18ae | |||
| 42cac55be8 | |||
| 6549a4f825 | |||
| f46bea6a96 | |||
| 2090830858 | |||
| 93c6387dae | |||
| 7346d82dfa | |||
| 39a6db7266 | |||
| 8240163be0 |
@@ -1,4 +1,5 @@
|
|||||||
name: Nightly Release
|
name: Nightly Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# Run every day at 01:00 UTC
|
# Run every day at 01:00 UTC
|
||||||
@@ -10,10 +11,8 @@ concurrency:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
RUST_MUSL_CROSS_IMAGE: messense/rust-musl-cross@sha256:c0154e992adb791c3b848dd008939d19862549204f8cb26f5ca7a00f629e6067
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# check if there were commits yesterday
|
|
||||||
check_commits:
|
check_commits:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
@@ -22,7 +21,7 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Fetch full history to check previous commits
|
fetch-depth: 0
|
||||||
ref: "main"
|
ref: "main"
|
||||||
|
|
||||||
- name: Check for commits from yesterday
|
- name: Check for commits from yesterday
|
||||||
@@ -47,229 +46,12 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
build:
|
build:
|
||||||
# github actions matrix jobs don't support multiple outputs
|
|
||||||
# ugly workaround from https://github.com/orgs/community/discussions/17245#discussioncomment-11222880
|
|
||||||
if: ${{ needs.check_commits.outputs.has_commits == 'true' }}
|
if: ${{ needs.check_commits.outputs.has_commits == 'true' }}
|
||||||
outputs:
|
|
||||||
resolc-x86_64-unknown-linux-musl_url: ${{ steps.set-output.outputs.resolc-x86_64-unknown-linux-musl_url }}
|
|
||||||
resolc-x86_64-unknown-linux-musl_sha: ${{ steps.set-output.outputs.resolc-x86_64-unknown-linux-musl_sha }}
|
|
||||||
resolc-aarch64-apple-darwin_url: ${{ steps.set-output.outputs.resolc-aarch64-apple-darwin_url }}
|
|
||||||
resolc-aarch64-apple-darwin_sha: ${{ steps.set-output.outputs.resolc-aarch64-apple-darwin_sha }}
|
|
||||||
resolc-x86_64-apple-darwin_url: ${{ steps.set-output.outputs.resolc-x86_64-apple-darwin_url }}
|
|
||||||
resolc-x86_64-apple-darwin_sha: ${{ steps.set-output.outputs.resolc-x86_64-apple-darwin_sha }}
|
|
||||||
resolc-x86_64-pc-windows-msvc_url: ${{ steps.set-output.outputs.resolc-x86_64-pc-windows-msvc_url }}
|
|
||||||
resolc-x86_64-pc-windows-msvc_sha: ${{ steps.set-output.outputs.resolc-x86_64-pc-windows-msvc_sha }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
target:
|
|
||||||
[
|
|
||||||
x86_64-unknown-linux-musl,
|
|
||||||
aarch64-apple-darwin,
|
|
||||||
x86_64-apple-darwin,
|
|
||||||
x86_64-pc-windows-msvc,
|
|
||||||
]
|
|
||||||
include:
|
|
||||||
- target: x86_64-unknown-linux-musl
|
|
||||||
type: musl
|
|
||||||
runner: ubuntu-24.04
|
|
||||||
- target: aarch64-apple-darwin
|
|
||||||
type: native
|
|
||||||
runner: macos-14
|
|
||||||
- target: x86_64-apple-darwin
|
|
||||||
type: native
|
|
||||||
runner: macos-13
|
|
||||||
- target: x86_64-pc-windows-msvc
|
|
||||||
type: native
|
|
||||||
runner: windows-2022
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
needs: [check_commits]
|
needs: [check_commits]
|
||||||
steps:
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
- uses: actions/checkout@v4
|
with:
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
is_release: false
|
||||||
with:
|
retention_days: 40
|
||||||
# without this it will override our rust flags
|
|
||||||
rustflags: ""
|
|
||||||
cache-key: ${{ matrix.target }}
|
|
||||||
|
|
||||||
- name: Download LLVM
|
|
||||||
uses: ./.github/actions/get-llvm
|
|
||||||
with:
|
|
||||||
target: ${{ matrix.target }}
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
if: ${{ matrix.type == 'native' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
export LLVM_SYS_181_PREFIX=$PWD/llvm-${{ matrix.target }}
|
|
||||||
make install-bin
|
|
||||||
mv target/release/resolc resolc-${{ matrix.target }} || mv target/release/resolc.exe resolc-${{ matrix.target }}.exe
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
if: ${{ matrix.type == 'musl' }}
|
|
||||||
run: |
|
|
||||||
docker run -v $PWD:/opt/revive $RUST_MUSL_CROSS_IMAGE /bin/bash -c "
|
|
||||||
cd /opt/revive
|
|
||||||
chown -R root:root .
|
|
||||||
apt update && apt upgrade -y && apt install -y pkg-config
|
|
||||||
export LLVM_SYS_181_PREFIX=/opt/revive/llvm-${{ matrix.target }}
|
|
||||||
make install-bin
|
|
||||||
mv target/${{ matrix.target }}/release/resolc resolc-${{ matrix.target }}
|
|
||||||
"
|
|
||||||
sudo chown -R $(id -u):$(id -g) .
|
|
||||||
|
|
||||||
- name: Install Solc
|
|
||||||
uses: ./.github/actions/get-solc
|
|
||||||
|
|
||||||
- name: Basic Sanity Check
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
result=$(./resolc-${{ matrix.target }} --bin crates/integration/contracts/flipper.sol)
|
|
||||||
echo $result
|
|
||||||
if [[ $result == *'50564d'* ]]; then exit 0; else exit 1; fi
|
|
||||||
|
|
||||||
- name: Upload artifacts (nightly)
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
id: artifact-upload-step
|
|
||||||
with:
|
|
||||||
name: resolc-${{ matrix.target }}
|
|
||||||
path: resolc-${{ matrix.target }}*
|
|
||||||
retention-days: 40
|
|
||||||
|
|
||||||
- name: Set output variables (nightly)
|
|
||||||
id: set-output
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "Artifact URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}"
|
|
||||||
echo "Artifact SHA is ${{ steps.artifact-upload-step.outputs.artifact-digest }}"
|
|
||||||
echo "resolc-${{ matrix.target }}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}"
|
|
||||||
echo "resolc-${{ matrix.target }}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "resolc-${{ matrix.target }}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}"
|
|
||||||
echo "resolc-${{ matrix.target }}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
build-wasm:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: [check_commits]
|
|
||||||
if: ${{ needs.check_commits.outputs.has_commits == 'true' }}
|
|
||||||
outputs:
|
|
||||||
resolc-web.js_url: ${{ steps.set-output.outputs.resolc_web_js_url }}
|
|
||||||
resolc-web.js_sha: ${{ steps.set-output.outputs.resolc_web_js_sha }}
|
|
||||||
env:
|
|
||||||
RELEASE_RESOLC_WASM_URI: https://github.com/paritytech/revive/releases/download/${{ github.ref_name }}/resolc.wasm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
||||||
with:
|
|
||||||
target: wasm32-unknown-emscripten
|
|
||||||
# without this it will override our rust flags
|
|
||||||
rustflags: ""
|
|
||||||
|
|
||||||
- name: Download Host LLVM
|
|
||||||
uses: ./.github/actions/get-llvm
|
|
||||||
with:
|
|
||||||
target: x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Download Wasm LLVM
|
|
||||||
uses: ./.github/actions/get-llvm
|
|
||||||
with:
|
|
||||||
target: wasm32-unknown-emscripten
|
|
||||||
|
|
||||||
- name: Download EMSDK
|
|
||||||
uses: ./.github/actions/get-emsdk
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
export LLVM_SYS_181_PREFIX=$PWD/llvm-x86_64-unknown-linux-gnu
|
|
||||||
export REVIVE_LLVM_TARGET_PREFIX=$PWD/llvm-wasm32-unknown-emscripten
|
|
||||||
source emsdk/emsdk_env.sh
|
|
||||||
make install-wasm
|
|
||||||
chmod -x ./target/wasm32-unknown-emscripten/release/resolc.wasm
|
|
||||||
|
|
||||||
- name: Set Up Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "20"
|
|
||||||
|
|
||||||
- name: Basic Sanity Check
|
|
||||||
run: |
|
|
||||||
mkdir -p solc
|
|
||||||
curl -sSLo solc/soljson.js https://github.com/ethereum/solidity/releases/download/v0.8.30/soljson.js
|
|
||||||
node -e "
|
|
||||||
const soljson = require('solc/soljson');
|
|
||||||
const createRevive = require('./target/wasm32-unknown-emscripten/release/resolc.js');
|
|
||||||
|
|
||||||
const compiler = createRevive();
|
|
||||||
compiler.soljson = soljson;
|
|
||||||
|
|
||||||
const standardJsonInput =
|
|
||||||
{
|
|
||||||
language: 'Solidity',
|
|
||||||
sources: {
|
|
||||||
'MyContract.sol': {
|
|
||||||
content: 'pragma solidity ^0.8.0; contract MyContract { function greet() public pure returns (string memory) { return \'Hello\'; } }',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
settings: { optimizer: { enabled: false } }
|
|
||||||
};
|
|
||||||
|
|
||||||
compiler.writeToStdin(JSON.stringify(standardJsonInput));
|
|
||||||
compiler.callMain(['--standard-json']);
|
|
||||||
|
|
||||||
// Collect output
|
|
||||||
const stdout = compiler.readFromStdout();
|
|
||||||
const stderr = compiler.readFromStderr();
|
|
||||||
|
|
||||||
if (stderr) { console.error(stderr); process.exit(1); }
|
|
||||||
|
|
||||||
let out = JSON.parse(stdout);
|
|
||||||
let bytecode = out.contracts['MyContract.sol']['MyContract'].evm.bytecode.object
|
|
||||||
console.log(bytecode);
|
|
||||||
|
|
||||||
if(!bytecode.startsWith('50564d')) { process.exit(1); }
|
|
||||||
"
|
|
||||||
|
|
||||||
- name: Compress Artifact
|
|
||||||
run: |
|
|
||||||
mkdir -p resolc-wasm32-unknown-emscripten
|
|
||||||
mv ./target/wasm32-unknown-emscripten/release/resolc.js ./resolc-wasm32-unknown-emscripten/
|
|
||||||
mv ./target/wasm32-unknown-emscripten/release/resolc.wasm ./resolc-wasm32-unknown-emscripten/
|
|
||||||
mv ./target/wasm32-unknown-emscripten/release/resolc_web.js ./resolc-wasm32-unknown-emscripten/
|
|
||||||
|
|
||||||
# There is no way to upload several files as several artifacts with a single upload-artifact step
|
|
||||||
# It's needed to have resolc_web.js separately for night builds for resolc-bin repo
|
|
||||||
# https://github.com/actions/upload-artifact/issues/331
|
|
||||||
- name: Upload artifact resolc.js (nightly)
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: resolc.js
|
|
||||||
path: resolc-wasm32-unknown-emscripten/resolc.js
|
|
||||||
retention-days: 40
|
|
||||||
|
|
||||||
- name: Upload artifacts resolc.wasm (nightly)
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: resolc.wasm
|
|
||||||
path: resolc-wasm32-unknown-emscripten/resolc.wasm
|
|
||||||
retention-days: 40
|
|
||||||
|
|
||||||
- name: Upload artifacts resolc_web.js (nightly)
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
id: artifact-upload-step
|
|
||||||
with:
|
|
||||||
name: resolc_web.js
|
|
||||||
path: resolc-wasm32-unknown-emscripten/resolc_web.js
|
|
||||||
retention-days: 40
|
|
||||||
|
|
||||||
- name: Set output variables
|
|
||||||
id: set-output
|
|
||||||
env:
|
|
||||||
TARGET: resolc_web_js
|
|
||||||
run: |
|
|
||||||
echo "Artifact URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}"
|
|
||||||
echo "Artifact SHA is ${{ steps.artifact-upload-step.outputs.artifact-digest }}"
|
|
||||||
echo "${TARGET}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}"
|
|
||||||
echo "${TARGET}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "${TARGET}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}""
|
|
||||||
echo "${TARGET}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}"" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
create-macos-fat-binary:
|
create-macos-fat-binary:
|
||||||
if: ${{ needs.check_commits.outputs.has_commits == 'true' }}
|
if: ${{ needs.check_commits.outputs.has_commits == 'true' }}
|
||||||
@@ -303,18 +85,14 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TARGET: resolc-universal-apple-darwin
|
TARGET: resolc-universal-apple-darwin
|
||||||
run: |
|
run: |
|
||||||
echo "Artifact URL is ${{ steps.artifact-upload-step.outputs.artifact-url }}"
|
|
||||||
echo "Artifact SHA is ${{ steps.artifact-upload-step.outputs.artifact-digest }}"
|
|
||||||
echo "${TARGET}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}"
|
|
||||||
echo "${TARGET}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}" >> "$GITHUB_OUTPUT"
|
echo "${TARGET}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "${TARGET}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}""
|
echo "${TARGET}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "${TARGET}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}"" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
generate-nightly-json:
|
generate-nightly-json:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
if: ${{ needs.check_commits.outputs.has_commits == 'true' }}
|
if: ${{ needs.check_commits.outputs.has_commits == 'true' }}
|
||||||
environment: tags
|
environment: tags
|
||||||
needs: [build-wasm, build, create-macos-fat-binary, check_commits]
|
needs: [build, create-macos-fat-binary, check_commits]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout revive
|
- name: Checkout revive
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -352,8 +130,6 @@ jobs:
|
|||||||
echo '[' > data.json
|
echo '[' > data.json
|
||||||
echo '${{ toJSON(needs.build.outputs) }}' >> data.json
|
echo '${{ toJSON(needs.build.outputs) }}' >> data.json
|
||||||
echo ',' >> data.json
|
echo ',' >> data.json
|
||||||
echo '${{ toJSON(needs.build-wasm.outputs) }}' >> data.json
|
|
||||||
echo ',' >> data.json
|
|
||||||
echo '${{ toJSON(needs.create-macos-fat-binary.outputs) }}' >> data.json
|
echo '${{ toJSON(needs.create-macos-fat-binary.outputs) }}' >> data.json
|
||||||
echo ']' >> data.json
|
echo ']' >> data.json
|
||||||
chmod +x bins/resolc-x86_64-unknown-linux-musl
|
chmod +x bins/resolc-x86_64-unknown-linux-musl
|
||||||
|
|||||||
+19
-183
@@ -1,4 +1,5 @@
|
|||||||
name: Build & Release
|
name: Build & Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
@@ -14,8 +15,6 @@ concurrency:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
# if changed, dont forget to update the env var in release-nightly.yml
|
|
||||||
RUST_MUSL_CROSS_IMAGE: messense/rust-musl-cross@sha256:c0154e992adb791c3b848dd008939d19862549204f8cb26f5ca7a00f629e6067
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-version-changed:
|
check-version-changed:
|
||||||
@@ -29,33 +28,28 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
# Check that tag and version in Cargo.toml match
|
|
||||||
- name: Check versions
|
- name: Check versions
|
||||||
id: versions
|
id: versions
|
||||||
run: |
|
run: |
|
||||||
if [[ $CURRENT_TAG == 'main' ]];
|
if [[ $CURRENT_TAG == 'main' ]]; then
|
||||||
then
|
echo "::notice::Tag $CURRENT_TAG is not a release tag, skipping the check in the main branch"
|
||||||
echo "::notice::Tag $CURRENT_TAG is not a release tag, skipping the check in the main branch";
|
exit 0
|
||||||
exit 0
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $CURRENT_TAG != "v"* ]];
|
if [[ $CURRENT_TAG != "v"* ]]; then
|
||||||
then
|
echo "::notice::Tag $CURRENT_TAG is not a release tag, skipping the check in a PR"
|
||||||
echo "::notice::Tag $CURRENT_TAG is not a release tag, skipping the check in a PR";
|
exit 0
|
||||||
exit 0
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
export PKG_VER=v$(cat crates/resolc/Cargo.toml | grep -A 5 package] | grep version | cut -d '=' -f 2 | tr -d '"' | tr -d " ")
|
export PKG_VER=v$(cat crates/resolc/Cargo.toml | grep -A 5 package] | grep version | cut -d '=' -f 2 | tr -d '"' | tr -d " ")
|
||||||
echo "Current tag $CURRENT_TAG"
|
echo "Current tag $CURRENT_TAG"
|
||||||
echo "Package version $PKG_VER"
|
echo "Package version $PKG_VER"
|
||||||
#
|
|
||||||
if [[ $CURRENT_TAG != $PKG_VER ]];
|
|
||||||
then
|
|
||||||
echo "::error::Tag $CURRENT_TAG doesn't match package version $PKG_VER in Cargo.toml, please fix";
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generating release notes early, in order to avoid checkout at the last step
|
if [[ $CURRENT_TAG != $PKG_VER ]]; then
|
||||||
|
echo "::error::Tag $CURRENT_TAG doesn't match package version $PKG_VER in Cargo.toml, please fix"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
export RELEASE_NOTES="$(sed '/^## '${CURRENT_TAG}'/,/^## v/!d' CHANGELOG.md | sed -e '1d' -e '$d')"
|
export RELEASE_NOTES="$(sed '/^## '${CURRENT_TAG}'/,/^## v/!d' CHANGELOG.md | sed -e '1d' -e '$d')"
|
||||||
|
|
||||||
echo "Release notes:"
|
echo "Release notes:"
|
||||||
@@ -66,173 +60,15 @@ jobs:
|
|||||||
echo 'EOF' >> $GITHUB_OUTPUT
|
echo 'EOF' >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
build:
|
build:
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
target:
|
|
||||||
[
|
|
||||||
x86_64-unknown-linux-musl,
|
|
||||||
aarch64-apple-darwin,
|
|
||||||
x86_64-apple-darwin,
|
|
||||||
x86_64-pc-windows-msvc,
|
|
||||||
]
|
|
||||||
include:
|
|
||||||
- target: x86_64-unknown-linux-musl
|
|
||||||
type: musl
|
|
||||||
runner: ubuntu-24.04
|
|
||||||
- target: aarch64-apple-darwin
|
|
||||||
type: native
|
|
||||||
runner: macos-14
|
|
||||||
- target: x86_64-apple-darwin
|
|
||||||
type: native
|
|
||||||
runner: macos-13
|
|
||||||
- target: x86_64-pc-windows-msvc
|
|
||||||
type: native
|
|
||||||
runner: windows-2022
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
needs: [check-version-changed]
|
needs: [check-version-changed]
|
||||||
steps:
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
- uses: actions/checkout@v4
|
with:
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
is_release: true
|
||||||
with:
|
retention_days: 1
|
||||||
# without this it will override our rust flags
|
|
||||||
rustflags: ""
|
|
||||||
cache-key: ${{ matrix.target }}
|
|
||||||
|
|
||||||
- name: Download LLVM
|
|
||||||
uses: ./.github/actions/get-llvm
|
|
||||||
with:
|
|
||||||
target: ${{ matrix.target }}
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
if: ${{ matrix.type == 'native' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
export LLVM_SYS_181_PREFIX=$PWD/llvm-${{ matrix.target }}
|
|
||||||
make install-bin
|
|
||||||
mv target/release/resolc resolc-${{ matrix.target }} || mv target/release/resolc.exe resolc-${{ matrix.target }}.exe
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
if: ${{ matrix.type == 'musl' }}
|
|
||||||
run: |
|
|
||||||
docker run -v $PWD:/opt/revive $RUST_MUSL_CROSS_IMAGE /bin/bash -c "
|
|
||||||
cd /opt/revive
|
|
||||||
chown -R root:root .
|
|
||||||
apt update && apt upgrade -y && apt install -y pkg-config
|
|
||||||
export LLVM_SYS_181_PREFIX=/opt/revive/llvm-${{ matrix.target }}
|
|
||||||
make install-bin
|
|
||||||
mv target/${{ matrix.target }}/release/resolc resolc-${{ matrix.target }}
|
|
||||||
"
|
|
||||||
sudo chown -R $(id -u):$(id -g) .
|
|
||||||
|
|
||||||
- name: Install Solc
|
|
||||||
uses: ./.github/actions/get-solc
|
|
||||||
|
|
||||||
- name: Basic Sanity Check
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
result=$(./resolc-${{ matrix.target }} --bin crates/integration/contracts/flipper.sol)
|
|
||||||
echo $result
|
|
||||||
if [[ $result == *'50564d'* ]]; then exit 0; else exit 1; fi
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: resolc-${{ matrix.target }}
|
|
||||||
path: resolc-${{ matrix.target }}*
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
build-wasm:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: [check-version-changed]
|
|
||||||
env:
|
|
||||||
RELEASE_RESOLC_WASM_URI: https://github.com/paritytech/revive/releases/download/${{ github.ref_name }}/resolc.wasm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
||||||
with:
|
|
||||||
target: wasm32-unknown-emscripten
|
|
||||||
# without this it will override our rust flags
|
|
||||||
rustflags: ""
|
|
||||||
|
|
||||||
- name: Download Host LLVM
|
|
||||||
uses: ./.github/actions/get-llvm
|
|
||||||
with:
|
|
||||||
target: x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Download Wasm LLVM
|
|
||||||
uses: ./.github/actions/get-llvm
|
|
||||||
with:
|
|
||||||
target: wasm32-unknown-emscripten
|
|
||||||
|
|
||||||
- name: Download EMSDK
|
|
||||||
uses: ./.github/actions/get-emsdk
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
export LLVM_SYS_181_PREFIX=$PWD/llvm-x86_64-unknown-linux-gnu
|
|
||||||
export REVIVE_LLVM_TARGET_PREFIX=$PWD/llvm-wasm32-unknown-emscripten
|
|
||||||
source emsdk/emsdk_env.sh
|
|
||||||
make install-wasm
|
|
||||||
chmod -x ./target/wasm32-unknown-emscripten/release/resolc.wasm
|
|
||||||
|
|
||||||
- name: Set Up Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "20"
|
|
||||||
|
|
||||||
- name: Basic Sanity Check
|
|
||||||
run: |
|
|
||||||
mkdir -p solc
|
|
||||||
curl -sSLo solc/soljson.js https://github.com/ethereum/solidity/releases/download/v0.8.30/soljson.js
|
|
||||||
node -e "
|
|
||||||
const soljson = require('solc/soljson');
|
|
||||||
const createRevive = require('./target/wasm32-unknown-emscripten/release/resolc.js');
|
|
||||||
|
|
||||||
const compiler = createRevive();
|
|
||||||
compiler.soljson = soljson;
|
|
||||||
|
|
||||||
const standardJsonInput =
|
|
||||||
{
|
|
||||||
language: 'Solidity',
|
|
||||||
sources: {
|
|
||||||
'MyContract.sol': {
|
|
||||||
content: 'pragma solidity ^0.8.0; contract MyContract { function greet() public pure returns (string memory) { return \'Hello\'; } }',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
settings: { optimizer: { enabled: false } }
|
|
||||||
};
|
|
||||||
|
|
||||||
compiler.writeToStdin(JSON.stringify(standardJsonInput));
|
|
||||||
compiler.callMain(['--standard-json']);
|
|
||||||
|
|
||||||
// Collect output
|
|
||||||
const stdout = compiler.readFromStdout();
|
|
||||||
const stderr = compiler.readFromStderr();
|
|
||||||
|
|
||||||
if (stderr) { console.error(stderr); process.exit(1); }
|
|
||||||
|
|
||||||
let out = JSON.parse(stdout);
|
|
||||||
let bytecode = out.contracts['MyContract.sol']['MyContract'].evm.bytecode.object
|
|
||||||
console.log(bytecode);
|
|
||||||
|
|
||||||
if(!bytecode.startsWith('50564d')) { process.exit(1); }
|
|
||||||
"
|
|
||||||
|
|
||||||
- name: Compress Artifact
|
|
||||||
run: |
|
|
||||||
mkdir -p resolc-wasm32-unknown-emscripten
|
|
||||||
mv ./target/wasm32-unknown-emscripten/release/resolc.js ./resolc-wasm32-unknown-emscripten/
|
|
||||||
mv ./target/wasm32-unknown-emscripten/release/resolc.wasm ./resolc-wasm32-unknown-emscripten/
|
|
||||||
mv ./target/wasm32-unknown-emscripten/release/resolc_web.js ./resolc-wasm32-unknown-emscripten/
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: resolc-wasm32-unknown-emscripten
|
|
||||||
path: resolc-wasm32-unknown-emscripten/*
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
if: startsWith(github.ref_name, 'v')
|
if: startsWith(github.ref_name, 'v')
|
||||||
needs: [check-version-changed, build-wasm]
|
needs: [check-version-changed, build]
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
environment: tags
|
environment: tags
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -0,0 +1,262 @@
|
|||||||
|
name: Reusable Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
is_release:
|
||||||
|
description: "Whether this is a release build"
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
retention_days:
|
||||||
|
description: "Artifact retention days"
|
||||||
|
required: false
|
||||||
|
type: number
|
||||||
|
default: 1
|
||||||
|
outputs:
|
||||||
|
resolc-x86_64-unknown-linux-musl_url:
|
||||||
|
value: ${{ jobs.build.outputs.resolc-x86_64-unknown-linux-musl_url }}
|
||||||
|
resolc-x86_64-unknown-linux-musl_sha:
|
||||||
|
value: ${{ jobs.build.outputs.resolc-x86_64-unknown-linux-musl_sha }}
|
||||||
|
resolc-aarch64-apple-darwin_url:
|
||||||
|
value: ${{ jobs.build.outputs.resolc-aarch64-apple-darwin_url }}
|
||||||
|
resolc-aarch64-apple-darwin_sha:
|
||||||
|
value: ${{ jobs.build.outputs.resolc-aarch64-apple-darwin_sha }}
|
||||||
|
resolc-x86_64-apple-darwin_url:
|
||||||
|
value: ${{ jobs.build.outputs.resolc-x86_64-apple-darwin_url }}
|
||||||
|
resolc-x86_64-apple-darwin_sha:
|
||||||
|
value: ${{ jobs.build.outputs.resolc-x86_64-apple-darwin_sha }}
|
||||||
|
resolc-x86_64-pc-windows-msvc_url:
|
||||||
|
value: ${{ jobs.build.outputs.resolc-x86_64-pc-windows-msvc_url }}
|
||||||
|
resolc-x86_64-pc-windows-msvc_sha:
|
||||||
|
value: ${{ jobs.build.outputs.resolc-x86_64-pc-windows-msvc_sha }}
|
||||||
|
resolc-web_js_url:
|
||||||
|
value: ${{ jobs.build-wasm.outputs.resolc_web_js_url }}
|
||||||
|
resolc-web_js_sha:
|
||||||
|
value: ${{ jobs.build-wasm.outputs.resolc_web_js_sha }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
RUST_MUSL_CROSS_IMAGE: messense/rust-musl-cross@sha256:c0154e992adb791c3b848dd008939d19862549204f8cb26f5ca7a00f629e6067
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
# github actions matrix jobs don't support multiple outputs
|
||||||
|
# ugly workaround from https://github.com/orgs/community/discussions/17245#discussioncomment-11222880
|
||||||
|
outputs:
|
||||||
|
resolc-x86_64-unknown-linux-musl_url: ${{ steps.set-output.outputs.resolc-x86_64-unknown-linux-musl_url }}
|
||||||
|
resolc-x86_64-unknown-linux-musl_sha: ${{ steps.set-output.outputs.resolc-x86_64-unknown-linux-musl_sha }}
|
||||||
|
resolc-aarch64-apple-darwin_url: ${{ steps.set-output.outputs.resolc-aarch64-apple-darwin_url }}
|
||||||
|
resolc-aarch64-apple-darwin_sha: ${{ steps.set-output.outputs.resolc-aarch64-apple-darwin_sha }}
|
||||||
|
resolc-x86_64-apple-darwin_url: ${{ steps.set-output.outputs.resolc-x86_64-apple-darwin_url }}
|
||||||
|
resolc-x86_64-apple-darwin_sha: ${{ steps.set-output.outputs.resolc-x86_64-apple-darwin_sha }}
|
||||||
|
resolc-x86_64-pc-windows-msvc_url: ${{ steps.set-output.outputs.resolc-x86_64-pc-windows-msvc_url }}
|
||||||
|
resolc-x86_64-pc-windows-msvc_sha: ${{ steps.set-output.outputs.resolc-x86_64-pc-windows-msvc_sha }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
[
|
||||||
|
x86_64-unknown-linux-musl,
|
||||||
|
aarch64-apple-darwin,
|
||||||
|
x86_64-apple-darwin,
|
||||||
|
x86_64-pc-windows-msvc,
|
||||||
|
]
|
||||||
|
include:
|
||||||
|
- target: x86_64-unknown-linux-musl
|
||||||
|
type: musl
|
||||||
|
runner: ubuntu-24.04
|
||||||
|
- target: aarch64-apple-darwin
|
||||||
|
type: native
|
||||||
|
runner: macos-14
|
||||||
|
- target: x86_64-apple-darwin
|
||||||
|
type: native
|
||||||
|
runner: macos-13
|
||||||
|
- target: x86_64-pc-windows-msvc
|
||||||
|
type: native
|
||||||
|
runner: windows-2022
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
rustflags: ""
|
||||||
|
cache-key: ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Download LLVM
|
||||||
|
uses: ./.github/actions/get-llvm
|
||||||
|
with:
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Build (Native)
|
||||||
|
if: ${{ matrix.type == 'native' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export LLVM_SYS_181_PREFIX=$PWD/llvm-${{ matrix.target }}
|
||||||
|
make install-bin
|
||||||
|
mv target/release/resolc resolc-${{ matrix.target }} || mv target/release/resolc.exe resolc-${{ matrix.target }}.exe
|
||||||
|
|
||||||
|
- name: Build (MUSL)
|
||||||
|
if: ${{ matrix.type == 'musl' }}
|
||||||
|
run: |
|
||||||
|
docker run -v $PWD:/opt/revive $RUST_MUSL_CROSS_IMAGE /bin/bash -c "
|
||||||
|
cd /opt/revive
|
||||||
|
chown -R root:root .
|
||||||
|
apt update && apt upgrade -y && apt install -y pkg-config
|
||||||
|
export LLVM_SYS_181_PREFIX=/opt/revive/llvm-${{ matrix.target }}
|
||||||
|
make install-bin
|
||||||
|
mv target/${{ matrix.target }}/release/resolc resolc-${{ matrix.target }}
|
||||||
|
"
|
||||||
|
sudo chown -R $(id -u):$(id -g) .
|
||||||
|
|
||||||
|
- name: Install Solc
|
||||||
|
uses: ./.github/actions/get-solc
|
||||||
|
|
||||||
|
- name: Basic Sanity Check
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
result=$(./resolc-${{ matrix.target }} --bin crates/integration/contracts/flipper.sol)
|
||||||
|
echo $result
|
||||||
|
if [[ $result == *'50564d'* ]]; then exit 0; else exit 1; fi
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
id: artifact-upload-step
|
||||||
|
with:
|
||||||
|
name: resolc-${{ matrix.target }}
|
||||||
|
path: resolc-${{ matrix.target }}*
|
||||||
|
retention-days: ${{ inputs.retention_days }}
|
||||||
|
|
||||||
|
- name: Set output variables
|
||||||
|
if: ${{ !inputs.is_release }}
|
||||||
|
id: set-output
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "resolc-${{ matrix.target }}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "resolc-${{ matrix.target }}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
build-wasm:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
outputs:
|
||||||
|
resolc_web_js_url: ${{ steps.set-output.outputs.resolc_web_js_url }}
|
||||||
|
resolc_web_js_sha: ${{ steps.set-output.outputs.resolc_web_js_sha }}
|
||||||
|
env:
|
||||||
|
RELEASE_RESOLC_WASM_URI: https://github.com/paritytech/revive/releases/download/${{ github.ref_name }}/resolc.wasm
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
target: wasm32-unknown-emscripten
|
||||||
|
rustflags: ""
|
||||||
|
|
||||||
|
- name: Download Host LLVM
|
||||||
|
uses: ./.github/actions/get-llvm
|
||||||
|
with:
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
|
- name: Download Wasm LLVM
|
||||||
|
uses: ./.github/actions/get-llvm
|
||||||
|
with:
|
||||||
|
target: wasm32-unknown-emscripten
|
||||||
|
|
||||||
|
- name: Download EMSDK
|
||||||
|
uses: ./.github/actions/get-emsdk
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
export LLVM_SYS_181_PREFIX=$PWD/llvm-x86_64-unknown-linux-gnu
|
||||||
|
export REVIVE_LLVM_TARGET_PREFIX=$PWD/llvm-wasm32-unknown-emscripten
|
||||||
|
source emsdk/emsdk_env.sh
|
||||||
|
make install-wasm
|
||||||
|
chmod -x ./target/wasm32-unknown-emscripten/release/resolc.wasm
|
||||||
|
|
||||||
|
- name: Set Up Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "20"
|
||||||
|
|
||||||
|
- name: Basic Sanity Check
|
||||||
|
run: |
|
||||||
|
mkdir -p solc
|
||||||
|
curl -sSLo solc/soljson.js https://github.com/ethereum/solidity/releases/download/v0.8.30/soljson.js
|
||||||
|
node -e "
|
||||||
|
const soljson = require('solc/soljson');
|
||||||
|
const createRevive = require('./target/wasm32-unknown-emscripten/release/resolc.js');
|
||||||
|
|
||||||
|
const compiler = createRevive();
|
||||||
|
compiler.soljson = soljson;
|
||||||
|
|
||||||
|
const standardJsonInput =
|
||||||
|
{
|
||||||
|
language: 'Solidity',
|
||||||
|
sources: {
|
||||||
|
'MyContract.sol': {
|
||||||
|
content: 'pragma solidity ^0.8.0; contract MyContract { function greet() public pure returns (string memory) { return \'Hello\'; } }',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
settings: { optimizer: { enabled: false } }
|
||||||
|
};
|
||||||
|
|
||||||
|
compiler.writeToStdin(JSON.stringify(standardJsonInput));
|
||||||
|
compiler.callMain(['--standard-json']);
|
||||||
|
|
||||||
|
const stdout = compiler.readFromStdout();
|
||||||
|
const stderr = compiler.readFromStderr();
|
||||||
|
|
||||||
|
if (stderr) { console.error(stderr); process.exit(1); }
|
||||||
|
|
||||||
|
let out = JSON.parse(stdout);
|
||||||
|
let bytecode = out.contracts['MyContract.sol']['MyContract'].evm.bytecode.object
|
||||||
|
console.log(bytecode);
|
||||||
|
|
||||||
|
if(!bytecode.startsWith('50564d')) { process.exit(1); }
|
||||||
|
"
|
||||||
|
|
||||||
|
- name: Compress Artifact
|
||||||
|
run: |
|
||||||
|
mkdir -p resolc-wasm32-unknown-emscripten
|
||||||
|
mv ./target/wasm32-unknown-emscripten/release/resolc.js ./resolc-wasm32-unknown-emscripten/
|
||||||
|
mv ./target/wasm32-unknown-emscripten/release/resolc.wasm ./resolc-wasm32-unknown-emscripten/
|
||||||
|
mv ./target/wasm32-unknown-emscripten/release/resolc_web.js ./resolc-wasm32-unknown-emscripten/
|
||||||
|
|
||||||
|
- name: Upload artifacts (Release)
|
||||||
|
if: ${{ inputs.is_release }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: resolc-wasm32-unknown-emscripten
|
||||||
|
path: resolc-wasm32-unknown-emscripten/*
|
||||||
|
retention-days: ${{ inputs.retention_days }}
|
||||||
|
|
||||||
|
# There is no way to upload several files as several artifacts with a single upload-artifact step
|
||||||
|
# It's needed to have resolc_web.js separately for night builds for resolc-bin repo
|
||||||
|
# https://github.com/actions/upload-artifact/issues/331
|
||||||
|
- name: Upload artifact resolc.js (Nightly)
|
||||||
|
if: ${{ !inputs.is_release }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: resolc.js
|
||||||
|
path: resolc-wasm32-unknown-emscripten/resolc.js
|
||||||
|
retention-days: ${{ inputs.retention_days }}
|
||||||
|
|
||||||
|
- name: Upload artifacts resolc.wasm (Nightly)
|
||||||
|
if: ${{ !inputs.is_release }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: resolc.wasm
|
||||||
|
path: resolc-wasm32-unknown-emscripten/resolc.wasm
|
||||||
|
retention-days: ${{ inputs.retention_days }}
|
||||||
|
|
||||||
|
- name: Upload artifacts resolc_web.js (Nightly)
|
||||||
|
if: ${{ !inputs.is_release }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
id: artifact-upload-step
|
||||||
|
with:
|
||||||
|
name: resolc_web.js
|
||||||
|
path: resolc-wasm32-unknown-emscripten/resolc_web.js
|
||||||
|
retention-days: ${{ inputs.retention_days }}
|
||||||
|
|
||||||
|
- name: Set output variables
|
||||||
|
if: ${{ !inputs.is_release }}
|
||||||
|
id: set-output
|
||||||
|
env:
|
||||||
|
TARGET: resolc_web_js
|
||||||
|
run: |
|
||||||
|
echo "${TARGET}_url=${{ steps.artifact-upload-step.outputs.artifact-url }}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "${TARGET}_sha=${{ steps.artifact-upload-step.outputs.artifact-digest }}" >> "$GITHUB_OUTPUT"
|
||||||
@@ -4,8 +4,35 @@
|
|||||||
|
|
||||||
This is a development pre-release.
|
This is a development pre-release.
|
||||||
|
|
||||||
|
Supported `polkadot-sdk` rev: `2509.0.0`
|
||||||
|
|
||||||
|
## v0.5.0
|
||||||
|
|
||||||
|
This is a development pre-release.
|
||||||
|
|
||||||
|
Supported `polkadot-sdk` rev: `2509.0.0`
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Support for `SELFDESTRUCT`.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Emulated EVM heap memory accesses of zero length are never out of bounds.
|
||||||
|
- Switched to newer and cheaper storage syscalls (omits reads and writes of `0` values).
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Introduced a workaround avoiding compiler crashes caused by a bug in LLVM affecting `SDIV`.
|
||||||
|
- An off-by-one bug affecting `SDIV` overflow semantics.
|
||||||
|
|
||||||
|
## v0.4.1
|
||||||
|
|
||||||
|
This is a development pre-release.
|
||||||
|
|
||||||
Supported `polkadot-sdk` rev: `2503.0.1`
|
Supported `polkadot-sdk` rev: `2503.0.1`
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- The `ast` output is no longer pruned in standard JSON mode (required for foundry).
|
||||||
|
- Support `standard_json.output_selection` to also look at per file settings.
|
||||||
|
|
||||||
## v0.4.0
|
## v0.4.0
|
||||||
|
|
||||||
This is a development pre-release.
|
This is a development pre-release.
|
||||||
|
|||||||
Generated
+2567
-1928
File diff suppressed because it is too large
Load Diff
+25
-25
@@ -14,22 +14,22 @@ repository = "https://github.com/paritytech/revive"
|
|||||||
rust-version = "1.85.0"
|
rust-version = "1.85.0"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
resolc = { version = "0.4.0", path = "crates/resolc", default-features = false }
|
|
||||||
revive-benchmarks = { version = "0.1.0", path = "crates/benchmarks" }
|
|
||||||
revive-builtins = { version = "0.1.0", path = "crates/builtins" }
|
|
||||||
revive-common = { version = "0.2.0", path = "crates/common" }
|
|
||||||
revive-differential = { version = "0.1.0", path = "crates/differential" }
|
|
||||||
revive-explorer = { version = "0.1.0", path = "crates/explore" }
|
|
||||||
revive-integration = { version = "0.1.1", path = "crates/integration" }
|
|
||||||
revive-linker = { version = "0.2.0", path = "crates/linker" }
|
|
||||||
lld-sys = { version = "0.1.0", path = "crates/lld-sys" }
|
lld-sys = { version = "0.1.0", path = "crates/lld-sys" }
|
||||||
revive-llvm-context = { version = "0.4.0", path = "crates/llvm-context" }
|
resolc = { version = "0.5.0", path = "crates/resolc", default-features = false }
|
||||||
revive-runtime-api = { version = "0.2.0", path = "crates/runtime-api" }
|
revive-benchmarks = { version = "0.1.0", path = "crates/benchmarks" }
|
||||||
revive-runner = { version = "0.1.0", path = "crates/runner" }
|
revive-build-utils = { version = "0.2.0", path = "crates/build-utils" }
|
||||||
revive-solc-json-interface = { version = "0.3.0", path = "crates/solc-json-interface", default-features = false }
|
revive-builtins = { version = "0.1.0", path = "crates/builtins" }
|
||||||
revive-stdlib = { version = "0.1.1", path = "crates/stdlib" }
|
revive-common = { version = "0.2.1", path = "crates/common" }
|
||||||
revive-build-utils = { version = "0.1.0", path = "crates/build-utils" }
|
revive-differential = { version = "0.2.0", path = "crates/differential" }
|
||||||
revive-yul = { version = "0.3.0", path = "crates/yul" }
|
revive-explorer = { version = "0.1.0", path = "crates/explore" }
|
||||||
|
revive-integration = { version = "0.3.0", path = "crates/integration" }
|
||||||
|
revive-linker = { version = "0.2.0", path = "crates/linker" }
|
||||||
|
revive-llvm-context = { version = "0.5.0", path = "crates/llvm-context" }
|
||||||
|
revive-runner = { version = "0.3.0", path = "crates/runner" }
|
||||||
|
revive-runtime-api = { version = "0.4.0", path = "crates/runtime-api" }
|
||||||
|
revive-solc-json-interface = { version = "0.4.0", path = "crates/solc-json-interface", default-features = false }
|
||||||
|
revive-stdlib = { version = "0.2.0", path = "crates/stdlib" }
|
||||||
|
revive-yul = { version = "0.4.0", path = "crates/yul" }
|
||||||
|
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
cc = "1.2"
|
cc = "1.2"
|
||||||
@@ -46,21 +46,21 @@ num = "0.4.3"
|
|||||||
sha1 = "0.10"
|
sha1 = "0.10"
|
||||||
sha3 = "0.10"
|
sha3 = "0.10"
|
||||||
thiserror = "2.0"
|
thiserror = "2.0"
|
||||||
which = "7.0"
|
which = "8.0"
|
||||||
path-slash = "0.2"
|
path-slash = "0.2"
|
||||||
rayon = "1.10"
|
rayon = "1.10"
|
||||||
clap = { version = "4", default-features = false, features = ["derive"] }
|
clap = { version = "4", default-features = false, features = ["derive"] }
|
||||||
polkavm-common = "0.24.0"
|
polkavm-common = "0.29.0"
|
||||||
polkavm-linker = "0.24.0"
|
polkavm-linker = "0.29.0"
|
||||||
polkavm-disassembler = "0.24.0"
|
polkavm-disassembler = "0.29.0"
|
||||||
polkavm = "0.24.0"
|
polkavm = "0.29.0"
|
||||||
alloy-primitives = { version = "1.1", features = ["serde"] }
|
alloy-primitives = { version = "1.1", features = ["serde"] }
|
||||||
alloy-sol-types = "1.1"
|
alloy-sol-types = "1.1"
|
||||||
alloy-genesis = "1.0"
|
alloy-genesis = "1.0.41"
|
||||||
alloy-serde = "1.0"
|
alloy-serde = "1.0"
|
||||||
env_logger = { version = "0.11.8", default-features = false }
|
env_logger = { version = "0.11.8", default-features = false }
|
||||||
serde_stacker = "0.1.12"
|
serde_stacker = "0.1.12"
|
||||||
criterion = { version = "0.6", features = ["html_reports"] }
|
criterion = { version = "0.7", features = ["html_reports"] }
|
||||||
log = { version = "0.4.27" }
|
log = { version = "0.4.27" }
|
||||||
git2 = { version = "0.20.2", default-features = false }
|
git2 = { version = "0.20.2", default-features = false }
|
||||||
downloader = "0.2.8"
|
downloader = "0.2.8"
|
||||||
@@ -68,15 +68,15 @@ flate2 = "1.1"
|
|||||||
fs_extra = "1.3"
|
fs_extra = "1.3"
|
||||||
num_cpus = "1"
|
num_cpus = "1"
|
||||||
tar = "0.4"
|
tar = "0.4"
|
||||||
toml = "0.8"
|
toml = "0.9"
|
||||||
assert_cmd = "2.0"
|
assert_cmd = "2"
|
||||||
assert_fs = "1.1"
|
assert_fs = "1.1"
|
||||||
normpath = "1.3"
|
normpath = "1.3"
|
||||||
|
|
||||||
# polkadot-sdk and friends
|
# polkadot-sdk and friends
|
||||||
codec = { version = "3.7.5", default-features = false, package = "parity-scale-codec" }
|
codec = { version = "3.7.5", default-features = false, package = "parity-scale-codec" }
|
||||||
scale-info = { version = "2.11.6", default-features = false }
|
scale-info = { version = "2.11.6", default-features = false }
|
||||||
polkadot-sdk = { version = "2503.0.1" }
|
polkadot-sdk = { version = "2509.0.0" }
|
||||||
|
|
||||||
# llvm
|
# llvm
|
||||||
[workspace.dependencies.inkwell]
|
[workspace.dependencies.inkwell]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-build-utils"
|
name = "revive-build-utils"
|
||||||
version.workspace = true
|
version = "0.2.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-common"
|
name = "revive-common"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ impl FromStr for ObjectFormat {
|
|||||||
"PVM" => Ok(Self::PVM),
|
"PVM" => Ok(Self::PVM),
|
||||||
_ => anyhow::bail!(
|
_ => anyhow::bail!(
|
||||||
"Unknown object format: {value}. Supported formats: {}, {}",
|
"Unknown object format: {value}. Supported formats: {}, {}",
|
||||||
Self::ELF.to_string(),
|
Self::ELF,
|
||||||
Self::PVM.to_string()
|
Self::PVM,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-differential"
|
name = "revive-differential"
|
||||||
description = "utilities for differential testing the revive compiler against EVM"
|
description = "utilities for differential testing the revive compiler against EVM"
|
||||||
version.workspace = true
|
version = "0.2.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-explorer"
|
name = "revive-explorer"
|
||||||
version.workspace = true
|
version = "0.1.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-integration"
|
name = "revive-integration"
|
||||||
version = "0.1.1"
|
version = "0.3.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"Baseline": 932,
|
"Baseline": 914,
|
||||||
"Computation": 2313,
|
"Computation": 2295,
|
||||||
"DivisionArithmetics": 8959,
|
"DivisionArithmetics": 14496,
|
||||||
"ERC20": 16993,
|
"ERC20": 17482,
|
||||||
"Events": 1692,
|
"Events": 1674,
|
||||||
"FibonacciIterative": 1474,
|
"FibonacciIterative": 1490,
|
||||||
"Flipper": 2098,
|
"Flipper": 2086,
|
||||||
"SHA1": 7751
|
"SHA1": 8158
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
pragma solidity ^0.8.24;
|
||||||
|
|
||||||
|
/* runner.json
|
||||||
|
{
|
||||||
|
"differential": true,
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"Instantiate": {
|
||||||
|
"code": {
|
||||||
|
"Solidity": {
|
||||||
|
"contract": "MemoryBounds"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Call": {
|
||||||
|
"dest": {
|
||||||
|
"Instantiated": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
contract MemoryBounds {
|
||||||
|
fallback() external {
|
||||||
|
assembly {
|
||||||
|
// Accessing OOB offsets should always work when the length is 0.
|
||||||
|
return(100000, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
pragma solidity ^0.8;
|
||||||
|
|
||||||
|
// TODO: This currently fails the differential test.
|
||||||
|
// The pallet doesn't send the correct balance back.
|
||||||
|
|
||||||
|
/* runner.json
|
||||||
|
{
|
||||||
|
"differential": false,
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"Upload": {
|
||||||
|
"code": {
|
||||||
|
"Solidity": {
|
||||||
|
"contract": "SelfdestructTester"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Instantiate": {
|
||||||
|
"code": {
|
||||||
|
"Solidity": {
|
||||||
|
"contract": "Selfdestruct"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"value": 123456789
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Call": {
|
||||||
|
"dest": {
|
||||||
|
"Instantiated": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
contract Selfdestruct {
|
||||||
|
address tester;
|
||||||
|
uint value;
|
||||||
|
|
||||||
|
constructor() payable {
|
||||||
|
require(msg.value > 0, "the test should have value");
|
||||||
|
value = msg.value;
|
||||||
|
|
||||||
|
SelfdestructTester s = new SelfdestructTester{value: msg.value}();
|
||||||
|
tester = address(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
fallback() external {
|
||||||
|
(bool success, ) = tester.call(hex"");
|
||||||
|
require(success, "the call to the self destructing contract should succeed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
contract SelfdestructTester {
|
||||||
|
constructor() payable {}
|
||||||
|
|
||||||
|
fallback() external {
|
||||||
|
selfdestruct(payable(msg.sender));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,6 +62,8 @@ test_spec!(function_type, "FunctionType", "FunctionType.sol");
|
|||||||
test_spec!(layout_at, "LayoutAt", "LayoutAt.sol");
|
test_spec!(layout_at, "LayoutAt", "LayoutAt.sol");
|
||||||
test_spec!(shift_arithmetic_right, "SAR", "SAR.sol");
|
test_spec!(shift_arithmetic_right, "SAR", "SAR.sol");
|
||||||
test_spec!(add_mod_mul_mod, "AddModMulModTester", "AddModMulMod.sol");
|
test_spec!(add_mod_mul_mod, "AddModMulModTester", "AddModMulMod.sol");
|
||||||
|
test_spec!(memory_bounds, "MemoryBounds", "MemoryBounds.sol");
|
||||||
|
test_spec!(selfdestruct, "Selfdestruct", "Selfdestruct.sol");
|
||||||
|
|
||||||
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {
|
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {
|
||||||
vec![Instantiate {
|
vec![Instantiate {
|
||||||
@@ -168,6 +170,8 @@ fn signed_division() {
|
|||||||
(minus_five, two),
|
(minus_five, two),
|
||||||
(I256::MINUS_ONE, I256::MIN),
|
(I256::MINUS_ONE, I256::MIN),
|
||||||
(one, I256::ZERO),
|
(one, I256::ZERO),
|
||||||
|
(I256::MIN, I256::MINUS_ONE),
|
||||||
|
(I256::MIN + I256::ONE, I256::MINUS_ONE),
|
||||||
] {
|
] {
|
||||||
actions.push(Call {
|
actions.push(Call {
|
||||||
origin: TestAddress::Alice,
|
origin: TestAddress::Alice,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ authors = [
|
|||||||
"Anton Baliasnikov <aba@matterlabs.dev>",
|
"Anton Baliasnikov <aba@matterlabs.dev>",
|
||||||
"Cyrill Leutwiler <cyrill@parity.io>",
|
"Cyrill Leutwiler <cyrill@parity.io>",
|
||||||
]
|
]
|
||||||
version = "0.2.0"
|
version = "0.4.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -2,20 +2,20 @@ pub mod common;
|
|||||||
|
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
use assert_cmd::prelude::*;
|
use assert_cmd::{cargo, prelude::*};
|
||||||
|
|
||||||
/// This test verifies that the LLVM repository can be successfully cloned, built, and cleaned.
|
/// This test verifies that the LLVM repository can be successfully cloned, built, and cleaned.
|
||||||
#[test]
|
#[test]
|
||||||
fn clone_build_and_clean() -> anyhow::Result<()> {
|
fn clone_build_and_clean() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("build")
|
.arg("build")
|
||||||
.arg("--llvm-projects")
|
.arg("--llvm-projects")
|
||||||
@@ -25,13 +25,13 @@ fn clone_build_and_clean() -> anyhow::Result<()> {
|
|||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("builtins")
|
.arg("builtins")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clean")
|
.arg("clean")
|
||||||
.assert()
|
.assert()
|
||||||
@@ -47,13 +47,13 @@ fn clone_build_and_clean() -> anyhow::Result<()> {
|
|||||||
fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("build")
|
.arg("build")
|
||||||
.arg("--llvm-projects")
|
.arg("--llvm-projects")
|
||||||
@@ -63,7 +63,7 @@ fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
|||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.arg("--target-env")
|
.arg("--target-env")
|
||||||
.arg("musl")
|
.arg("musl")
|
||||||
.arg("build")
|
.arg("build")
|
||||||
@@ -75,7 +75,7 @@ fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
|||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clean")
|
.arg("clean")
|
||||||
.assert()
|
.assert()
|
||||||
@@ -91,13 +91,13 @@ fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
|||||||
fn debug_build_with_tests_coverage() -> anyhow::Result<()> {
|
fn debug_build_with_tests_coverage() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("build")
|
.arg("build")
|
||||||
.arg("--enable-coverage")
|
.arg("--enable-coverage")
|
||||||
@@ -120,13 +120,13 @@ fn debug_build_with_tests_coverage() -> anyhow::Result<()> {
|
|||||||
fn build_with_sanitizers() -> anyhow::Result<()> {
|
fn build_with_sanitizers() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("build")
|
.arg("build")
|
||||||
.arg("--sanitizer")
|
.arg("--sanitizer")
|
||||||
@@ -146,16 +146,16 @@ fn build_with_sanitizers() -> anyhow::Result<()> {
|
|||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn clone_build_and_clean_emscripten() -> anyhow::Result<()> {
|
fn clone_build_and_clean_emscripten() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
let command = Command::cargo_bin(common::REVIVE_LLVM)?;
|
let command = Command::new(cargo::cargo_bin!("revive-llvm"));
|
||||||
let program = command.get_program().to_string_lossy();
|
let program = command.get_program().to_string_lossy();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("build")
|
.arg("build")
|
||||||
.arg("--llvm-projects")
|
.arg("--llvm-projects")
|
||||||
@@ -183,7 +183,7 @@ fn clone_build_and_clean_emscripten() -> anyhow::Result<()> {
|
|||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.arg("clean")
|
.arg("clean")
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.assert()
|
.assert()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ pub mod common;
|
|||||||
|
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
use assert_cmd::prelude::*;
|
use assert_cmd::{cargo, prelude::*};
|
||||||
|
|
||||||
/// This test verifies that after cloning the LLVM repository, checking out a specific branch
|
/// This test verifies that after cloning the LLVM repository, checking out a specific branch
|
||||||
/// or reference works as expected.
|
/// or reference works as expected.
|
||||||
@@ -10,13 +10,13 @@ use assert_cmd::prelude::*;
|
|||||||
fn checkout_after_clone() -> anyhow::Result<()> {
|
fn checkout_after_clone() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("checkout")
|
.arg("checkout")
|
||||||
.assert()
|
.assert()
|
||||||
@@ -31,13 +31,13 @@ fn checkout_after_clone() -> anyhow::Result<()> {
|
|||||||
fn force_checkout() -> anyhow::Result<()> {
|
fn force_checkout() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("checkout")
|
.arg("checkout")
|
||||||
.arg("--force")
|
.arg("--force")
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ pub mod common;
|
|||||||
|
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
use assert_cmd::prelude::*;
|
use assert_cmd::{cargo, prelude::*};
|
||||||
|
|
||||||
/// This test verifies that the LLVM repository can be successfully cloned using a specific branch
|
/// This test verifies that the LLVM repository can be successfully cloned using a specific branch
|
||||||
/// and reference.
|
/// and reference.
|
||||||
@@ -10,7 +10,7 @@ use assert_cmd::prelude::*;
|
|||||||
fn clone() -> anyhow::Result<()> {
|
fn clone() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.assert()
|
.assert()
|
||||||
@@ -25,7 +25,7 @@ fn clone() -> anyhow::Result<()> {
|
|||||||
fn clone_deep() -> anyhow::Result<()> {
|
fn clone_deep() -> anyhow::Result<()> {
|
||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::new(cargo::cargo_bin!("revive-llvm"))
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clone")
|
.arg("clone")
|
||||||
.arg("--deep")
|
.arg("--deep")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-llvm-context"
|
name = "revive-llvm-context"
|
||||||
version = "0.4.0"
|
version = "0.5.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ impl RuntimeFunction for SignedDivision {
|
|||||||
"max_uint",
|
"max_uint",
|
||||||
)?;
|
)?;
|
||||||
let is_operand_1_overflow = context.builder().build_int_compare(
|
let is_operand_1_overflow = context.builder().build_int_compare(
|
||||||
inkwell::IntPredicate::EQ,
|
inkwell::IntPredicate::SLT,
|
||||||
operand_1,
|
operand_1,
|
||||||
context.builder().build_int_neg(max_uint, "min_uint")?,
|
context.builder().build_int_neg(max_uint, "min_uint")?,
|
||||||
"is_operand_1_overflow",
|
"is_operand_1_overflow",
|
||||||
|
|||||||
@@ -47,6 +47,17 @@ impl RuntimeFunction for Sbrk {
|
|||||||
let offset = Self::paramater(context, 0).into_int_value();
|
let offset = Self::paramater(context, 0).into_int_value();
|
||||||
let size = Self::paramater(context, 1).into_int_value();
|
let size = Self::paramater(context, 1).into_int_value();
|
||||||
|
|
||||||
|
let return_block = context.append_basic_block("return_pointer");
|
||||||
|
let body_block = context.append_basic_block("body");
|
||||||
|
let is_size_zero = context.builder().build_int_compare(
|
||||||
|
inkwell::IntPredicate::EQ,
|
||||||
|
size,
|
||||||
|
context.xlen_type().const_zero(),
|
||||||
|
"is_size_zero",
|
||||||
|
)?;
|
||||||
|
context.build_conditional_branch(is_size_zero, return_block, body_block)?;
|
||||||
|
|
||||||
|
context.set_basic_block(body_block);
|
||||||
let trap_block = context.append_basic_block("trap");
|
let trap_block = context.append_basic_block("trap");
|
||||||
let offset_in_bounds_block = context.append_basic_block("offset_in_bounds");
|
let offset_in_bounds_block = context.append_basic_block("offset_in_bounds");
|
||||||
let is_offset_out_of_bounds = context.builder().build_int_compare(
|
let is_offset_out_of_bounds = context.builder().build_int_compare(
|
||||||
@@ -91,7 +102,6 @@ impl RuntimeFunction for Sbrk {
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
context.set_basic_block(size_in_bounds_block);
|
context.set_basic_block(size_in_bounds_block);
|
||||||
let return_block = context.append_basic_block("return_pointer");
|
|
||||||
let new_size_block = context.append_basic_block("new_size");
|
let new_size_block = context.append_basic_block("new_size");
|
||||||
let is_new_size = context.builder().build_int_compare(
|
let is_new_size = context.builder().build_int_compare(
|
||||||
inkwell::IntPredicate::UGT,
|
inkwell::IntPredicate::UGT,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use inkwell::debug_info::AsDIScope;
|
|||||||
use inkwell::debug_info::DIScope;
|
use inkwell::debug_info::DIScope;
|
||||||
use inkwell::types::BasicType;
|
use inkwell::types::BasicType;
|
||||||
use inkwell::values::BasicValue;
|
use inkwell::values::BasicValue;
|
||||||
|
use inkwell::values::InstructionOpcode;
|
||||||
use revive_solc_json_interface::PolkaVMDefaultHeapMemorySize;
|
use revive_solc_json_interface::PolkaVMDefaultHeapMemorySize;
|
||||||
use revive_solc_json_interface::PolkaVMDefaultStackMemorySize;
|
use revive_solc_json_interface::PolkaVMDefaultStackMemorySize;
|
||||||
use revive_solc_json_interface::SolcStandardJsonInputSettingsPolkaVMMemory;
|
use revive_solc_json_interface::SolcStandardJsonInputSettingsPolkaVMMemory;
|
||||||
@@ -288,6 +289,17 @@ impl<'ctx> Context<'ctx> {
|
|||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
// Remove MinSize on functions that perform large integer div/rem to
|
||||||
|
// avoid compiler crash that happens when large integer div/rem by
|
||||||
|
// power-of-2 are not being expanded by ExpandLargeIntDivRem pass as
|
||||||
|
// it expects peephole from DAGCombine, which doesn't happen due to the
|
||||||
|
// MinSize attribute being set on the function.
|
||||||
|
// NOTE: As soon as it strips attribute from a function where large
|
||||||
|
// integer div/rem is used, it's crucial to call it after inlining.
|
||||||
|
// TODO: Remove this once LLVM fix is backported to LLVM 21 and we
|
||||||
|
// switch to corresponding inkwell version.
|
||||||
|
self.strip_minsize_for_divrem();
|
||||||
|
|
||||||
self.debug_config
|
self.debug_config
|
||||||
.dump_llvm_ir_optimized(contract_path, self.module())?;
|
.dump_llvm_ir_optimized(contract_path, self.module())?;
|
||||||
|
|
||||||
@@ -1394,4 +1406,38 @@ impl<'ctx> Context<'ctx> {
|
|||||||
name.to_string()
|
name.to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Scans all functions in the module and removes the `MinSize` attribute
|
||||||
|
/// if the function contains any large sdiv, udiv, srem, urem instructions with either unknown
|
||||||
|
/// NOTE: The check here could be relaxed by checking denominator: if the denominator is
|
||||||
|
/// unknown or is a power-of-2 constant, then need to strip the `minsize` attribute; otherwise
|
||||||
|
/// instruction can be ignored as backend will expand it correctly.
|
||||||
|
fn strip_minsize_for_divrem(&self) {
|
||||||
|
self.module().get_functions().for_each(|func| {
|
||||||
|
let has_divrem = func.get_basic_block_iter().any(|b| {
|
||||||
|
b.get_instructions().any(|inst| match inst.get_opcode() {
|
||||||
|
InstructionOpcode::SDiv
|
||||||
|
| InstructionOpcode::UDiv
|
||||||
|
| InstructionOpcode::SRem
|
||||||
|
| InstructionOpcode::URem => {
|
||||||
|
inst.get_type().into_int_type().get_bit_width() >= 256
|
||||||
|
}
|
||||||
|
_ => false,
|
||||||
|
})
|
||||||
|
});
|
||||||
|
if has_divrem
|
||||||
|
&& func
|
||||||
|
.get_enum_attribute(
|
||||||
|
inkwell::attributes::AttributeLoc::Function,
|
||||||
|
Attribute::MinSize as u32,
|
||||||
|
)
|
||||||
|
.is_some()
|
||||||
|
{
|
||||||
|
func.remove_enum_attribute(
|
||||||
|
inkwell::attributes::AttributeLoc::Function,
|
||||||
|
Attribute::MinSize as u32,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,6 +157,10 @@ fn emit_load<'ctx>(
|
|||||||
key: BasicValueEnum<'ctx>,
|
key: BasicValueEnum<'ctx>,
|
||||||
transient: bool,
|
transient: bool,
|
||||||
) -> anyhow::Result<BasicValueEnum<'ctx>> {
|
) -> anyhow::Result<BasicValueEnum<'ctx>> {
|
||||||
|
let is_transient = context.xlen_type().const_int(transient as u64, false);
|
||||||
|
let key_pointer = context.build_alloca_at_entry(context.word_type(), "key_pointer");
|
||||||
|
let value_pointer = context.build_alloca_at_entry(context.word_type(), "value_pointer");
|
||||||
|
|
||||||
let mut key = context.build_load(
|
let mut key = context.build_load(
|
||||||
super::Pointer::new(
|
super::Pointer::new(
|
||||||
context.word_type(),
|
context.word_type(),
|
||||||
@@ -168,33 +172,17 @@ fn emit_load<'ctx>(
|
|||||||
if !transient {
|
if !transient {
|
||||||
key = context.build_byte_swap(key)?;
|
key = context.build_byte_swap(key)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let key_pointer = context.build_alloca_at_entry(context.word_type(), "key_pointer");
|
|
||||||
let value_pointer = context.build_alloca_at_entry(context.word_type(), "value_pointer");
|
|
||||||
let length_pointer = context.build_alloca_at_entry(context.xlen_type(), "length_pointer");
|
|
||||||
|
|
||||||
context.builder().build_store(key_pointer.value, key)?;
|
context.builder().build_store(key_pointer.value, key)?;
|
||||||
context.build_store(value_pointer, context.word_const(0))?;
|
|
||||||
context.build_store(
|
|
||||||
length_pointer,
|
|
||||||
context
|
|
||||||
.xlen_type()
|
|
||||||
.const_int(revive_common::BYTE_LENGTH_WORD as u64, false),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
let is_transient = context.xlen_type().const_int(transient as u64, false);
|
|
||||||
|
|
||||||
let arguments = [
|
let arguments = [
|
||||||
is_transient.into(),
|
is_transient.into(),
|
||||||
key_pointer.to_int(context).into(),
|
key_pointer.to_int(context).into(),
|
||||||
context.xlen_type().const_all_ones().into(),
|
|
||||||
value_pointer.to_int(context).into(),
|
value_pointer.to_int(context).into(),
|
||||||
length_pointer.to_int(context).into(),
|
|
||||||
];
|
];
|
||||||
context.build_runtime_call(revive_runtime_api::polkavm_imports::GET_STORAGE, &arguments);
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::GET_STORAGE, &arguments);
|
||||||
|
|
||||||
// We do not to check the return value: Solidity assumes infallible loads.
|
// We do not to check the return value: Solidity assumes infallible loads.
|
||||||
// If a key doesn't exist the "zero" value is returned (ensured by above write).
|
// If a key doesn't exist the syscall returns zero.
|
||||||
|
|
||||||
let value = context.build_load(value_pointer, "storage_value")?;
|
let value = context.build_load(value_pointer, "storage_value")?;
|
||||||
Ok(if transient {
|
Ok(if transient {
|
||||||
@@ -210,6 +198,10 @@ fn emit_store<'ctx>(
|
|||||||
value: BasicValueEnum<'ctx>,
|
value: BasicValueEnum<'ctx>,
|
||||||
transient: bool,
|
transient: bool,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
let is_transient = context.xlen_type().const_int(transient as u64, false);
|
||||||
|
let key_pointer = context.build_alloca_at_entry(context.word_type(), "key_pointer");
|
||||||
|
let value_pointer = context.build_alloca_at_entry(context.word_type(), "value_pointer");
|
||||||
|
|
||||||
let mut key = context.build_load(
|
let mut key = context.build_load(
|
||||||
super::Pointer::new(
|
super::Pointer::new(
|
||||||
context.word_type(),
|
context.word_type(),
|
||||||
@@ -224,27 +216,20 @@ fn emit_store<'ctx>(
|
|||||||
Default::default(),
|
Default::default(),
|
||||||
value.into_pointer_value(),
|
value.into_pointer_value(),
|
||||||
),
|
),
|
||||||
"key",
|
"value",
|
||||||
)?;
|
)?;
|
||||||
if !transient {
|
if !transient {
|
||||||
key = context.build_byte_swap(key)?;
|
key = context.build_byte_swap(key)?;
|
||||||
value = context.build_byte_swap(value)?;
|
value = context.build_byte_swap(value)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let key_pointer = context.build_alloca_at_entry(context.word_type(), "key_pointer");
|
|
||||||
let value_pointer = context.build_alloca_at_entry(context.word_type(), "value_pointer");
|
|
||||||
|
|
||||||
context.build_store(key_pointer, key)?;
|
context.build_store(key_pointer, key)?;
|
||||||
context.build_store(value_pointer, value)?;
|
context.build_store(value_pointer, value)?;
|
||||||
|
|
||||||
let is_transient = context.xlen_type().const_int(transient as u64, false);
|
|
||||||
|
|
||||||
let arguments = [
|
let arguments = [
|
||||||
is_transient.into(),
|
is_transient.into(),
|
||||||
key_pointer.to_int(context).into(),
|
key_pointer.to_int(context).into(),
|
||||||
context.xlen_type().const_all_ones().into(),
|
|
||||||
value_pointer.to_int(context).into(),
|
value_pointer.to_int(context).into(),
|
||||||
context.integer_const(crate::polkavm::XLEN, 32).into(),
|
|
||||||
];
|
];
|
||||||
context.build_runtime_call(revive_runtime_api::polkavm_imports::SET_STORAGE, &arguments);
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::SET_STORAGE, &arguments);
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ pub fn call<'ctx>(
|
|||||||
let is_success = context.builder().build_int_compare(
|
let is_success = context.builder().build_int_compare(
|
||||||
inkwell::IntPredicate::EQ,
|
inkwell::IntPredicate::EQ,
|
||||||
success,
|
success,
|
||||||
context.integer_const(revive_common::BIT_LENGTH_X64, 0),
|
context.integer_const(revive_common::BIT_LENGTH_X32, 0),
|
||||||
"is_success",
|
"is_success",
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ pub fn delegate_call<'ctx>(
|
|||||||
let is_success = context.builder().build_int_compare(
|
let is_success = context.builder().build_int_compare(
|
||||||
inkwell::IntPredicate::EQ,
|
inkwell::IntPredicate::EQ,
|
||||||
success,
|
success,
|
||||||
context.integer_const(revive_common::BIT_LENGTH_X64, 0),
|
context.integer_const(revive_common::BIT_LENGTH_X32, 0),
|
||||||
"is_success",
|
"is_success",
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|||||||
@@ -60,3 +60,16 @@ pub fn invalid(context: &mut Context) -> anyhow::Result<()> {
|
|||||||
context.build_call(context.intrinsics().trap, &[], "invalid_trap");
|
context.build_call(context.intrinsics().trap, &[], "invalid_trap");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Translates the `selfdestruct` instruction.
|
||||||
|
pub fn selfdestruct<'ctx>(
|
||||||
|
context: &mut Context<'ctx>,
|
||||||
|
address: inkwell::values::IntValue<'ctx>,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
let address_pointer = context.build_address_argument_store(address)?;
|
||||||
|
context.build_runtime_call(
|
||||||
|
revive_runtime_api::polkavm_imports::TERMINATE,
|
||||||
|
&[address_pointer.to_int(context).into()],
|
||||||
|
);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "resolc"
|
name = "resolc"
|
||||||
version = "0.4.0"
|
version = "0.5.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ impl Compiler for SolcCompiler {
|
|||||||
anyhow::bail!(
|
anyhow::bail!(
|
||||||
"{} error: {}",
|
"{} error: {}",
|
||||||
self.executable,
|
self.executable,
|
||||||
String::from_utf8_lossy(output.stderr.as_slice()).to_string()
|
String::from_utf8_lossy(output.stderr.as_slice())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ impl Compiler for SolcCompiler {
|
|||||||
anyhow::bail!(
|
anyhow::bail!(
|
||||||
"{} error: {}",
|
"{} error: {}",
|
||||||
self.executable,
|
self.executable,
|
||||||
String::from_utf8_lossy(output.stderr.as_slice()).to_string()
|
String::from_utf8_lossy(output.stderr.as_slice())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
use crate::tests::cli::utils::{
|
use crate::tests::cli::utils::{
|
||||||
self, assert_command_failure, assert_command_success, assert_equal_exit_codes, execute_resolc,
|
self, assert_command_failure, assert_command_success, assert_equal_exit_codes, execute_resolc,
|
||||||
execute_solc, RESOLC_YUL_FLAG, SOLIDITY_CONTRACT_PATH, YUL_MEMSET_CONTRACT_PATH,
|
execute_solc, RESOLC_YUL_FLAG, SOLIDITY_CONTRACT_PATH, SOLIDITY_LARGE_DIV_REM_CONTRACT_PATH,
|
||||||
|
YUL_MEMSET_CONTRACT_PATH,
|
||||||
};
|
};
|
||||||
|
|
||||||
const LEVELS: &[char] = &['0', '1', '2', '3', 's', 'z'];
|
const LEVELS: &[char] = &['0', '1', '2', '3', 's', 'z'];
|
||||||
@@ -56,3 +57,26 @@ fn disable_solc_optimzer() {
|
|||||||
|
|
||||||
assert_ne!(enabled.stdout, disabled.stdout);
|
assert_ne!(enabled.stdout, disabled.stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_large_div_rem_expansion() {
|
||||||
|
for level in LEVELS {
|
||||||
|
let optimization_argument = format!("-O{level}");
|
||||||
|
let arguments = &[SOLIDITY_LARGE_DIV_REM_CONTRACT_PATH, &optimization_argument];
|
||||||
|
let resolc_result = utils::execute_resolc(arguments);
|
||||||
|
assert!(
|
||||||
|
resolc_result.success,
|
||||||
|
"Providing the level `{optimization_argument}` should succeed with exit code {}, got {}.\nDetails: {}",
|
||||||
|
revive_common::EXIT_CODE_SUCCESS,
|
||||||
|
resolc_result.code,
|
||||||
|
resolc_result.stderr
|
||||||
|
);
|
||||||
|
|
||||||
|
assert!(
|
||||||
|
resolc_result
|
||||||
|
.stderr
|
||||||
|
.contains("Compiler run successful. No output requested"),
|
||||||
|
"Expected the output to contain a success message when providing the level `{optimization_argument}`."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ pub const YUL_MEMSET_CONTRACT_PATH: &str = "src/tests/data/yul/memset.yul";
|
|||||||
pub const STANDARD_JSON_CONTRACTS_PATH: &str =
|
pub const STANDARD_JSON_CONTRACTS_PATH: &str =
|
||||||
"src/tests/data/standard_json/solidity_contracts.json";
|
"src/tests/data/standard_json/solidity_contracts.json";
|
||||||
|
|
||||||
|
/// The simple Solidity contract containing i256 divisions and remains that should be compiled
|
||||||
|
/// correctly
|
||||||
|
pub const SOLIDITY_LARGE_DIV_REM_CONTRACT_PATH: &str = "src/tests/data/solidity/large_div_rem.sol";
|
||||||
|
|
||||||
/// The `resolc` YUL mode flag.
|
/// The `resolc` YUL mode flag.
|
||||||
pub const RESOLC_YUL_FLAG: &str = "--yul";
|
pub const RESOLC_YUL_FLAG: &str = "--yul";
|
||||||
/// The `--yul` option was deprecated in Solidity 0.8.27 in favor of `--strict-assembly`.
|
/// The `--yul` option was deprecated in Solidity 0.8.27 in favor of `--strict-assembly`.
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
pragma solidity ^0.8;
|
||||||
|
|
||||||
|
contract LargeDivRem {
|
||||||
|
function rem_2(int n) public pure returns (int q) {
|
||||||
|
assembly {
|
||||||
|
q := smod(n, 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function div_2(int n) public pure returns (int q) {
|
||||||
|
assembly {
|
||||||
|
q := sdiv(n, 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function rem_7(int n) public pure returns (int q) {
|
||||||
|
assembly {
|
||||||
|
q := smod(n, 7)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function div_7(int n) public pure returns (int q) {
|
||||||
|
assembly {
|
||||||
|
q := sdiv(n, 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function rem_k(int n, int k) public pure returns (int q) {
|
||||||
|
assembly {
|
||||||
|
q := smod(n, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function div_k(int n, int k) public pure returns (int q) {
|
||||||
|
assembly {
|
||||||
|
q := sdiv(n, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -98,26 +98,3 @@ contract ExternalCodeCopy {
|
|||||||
|
|
||||||
build_solidity(sources(&[("test.sol", code)])).unwrap();
|
build_solidity(sources(&[("test.sol", code)])).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[should_panic(expected = "The `SELFDESTRUCT` instruction is not supported")]
|
|
||||||
fn selfdestruct_yul() {
|
|
||||||
let solidity = r#"
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
pragma solidity ^0.8.0;
|
|
||||||
|
|
||||||
contract MinimalDestructible {
|
|
||||||
address payable public owner;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
owner = payable(msg.sender);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy() public {
|
|
||||||
require(msg.sender == owner, "Only the owner can call this function.");
|
|
||||||
selfdestruct(owner);
|
|
||||||
}
|
|
||||||
}"#;
|
|
||||||
|
|
||||||
build_solidity(sources(&[("test.sol", solidity)])).unwrap();
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-runner"
|
name = "revive-runner"
|
||||||
version.workspace = true
|
version = "0.3.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ use std::time::Duration;
|
|||||||
|
|
||||||
use hex::{FromHex, ToHex};
|
use hex::{FromHex, ToHex};
|
||||||
use pallet_revive::{AddressMapper, ExecReturnValue, InstantiateReturnValue};
|
use pallet_revive::{AddressMapper, ExecReturnValue, InstantiateReturnValue};
|
||||||
|
use polkadot_sdk::frame_support::traits::Currency;
|
||||||
|
use polkadot_sdk::pallet_revive::{Config, Pallet};
|
||||||
use polkadot_sdk::*;
|
use polkadot_sdk::*;
|
||||||
use polkadot_sdk::{
|
use polkadot_sdk::{
|
||||||
pallet_revive::ContractResult,
|
pallet_revive::ContractResult,
|
||||||
@@ -58,6 +60,8 @@ pub const CHARLIE: H160 = H160([3u8; 20]);
|
|||||||
pub const GAS_LIMIT: Weight = Weight::from_parts(100_000_000_000_000, 3 * 1024 * 1024 * 1024);
|
pub const GAS_LIMIT: Weight = Weight::from_parts(100_000_000_000_000, 3 * 1024 * 1024 * 1024);
|
||||||
/// Default deposit limit
|
/// Default deposit limit
|
||||||
pub const DEPOSIT_LIMIT: Balance = 10_000_000;
|
pub const DEPOSIT_LIMIT: Balance = 10_000_000;
|
||||||
|
/// The native to ETH balance factor.
|
||||||
|
pub const ETH_RATIO: Balance = 1_000_000;
|
||||||
|
|
||||||
/// Externalities builder
|
/// Externalities builder
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
@@ -80,18 +84,28 @@ impl ExtBuilder {
|
|||||||
/// Build the externalities
|
/// Build the externalities
|
||||||
pub fn build(self) -> sp_io::TestExternalities {
|
pub fn build(self) -> sp_io::TestExternalities {
|
||||||
sp_tracing::try_init_simple();
|
sp_tracing::try_init_simple();
|
||||||
|
|
||||||
let mut t = frame_system::GenesisConfig::<Runtime>::default()
|
let mut t = frame_system::GenesisConfig::<Runtime>::default()
|
||||||
.build_storage()
|
.build_storage()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
pallet_balances::GenesisConfig::<Runtime> {
|
pallet_balances::GenesisConfig::<Runtime> {
|
||||||
balances: self.balance_genesis_config,
|
balances: self.balance_genesis_config,
|
||||||
dev_accounts: None,
|
dev_accounts: None,
|
||||||
}
|
}
|
||||||
.assimilate_storage(&mut t)
|
.assimilate_storage(&mut t)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut ext = sp_io::TestExternalities::new(t);
|
let mut ext = sp_io::TestExternalities::new(t);
|
||||||
ext.register_extension(KeystoreExt::new(MemoryKeystore::new()));
|
ext.register_extension(KeystoreExt::new(MemoryKeystore::new()));
|
||||||
ext.execute_with(|| System::set_block_number(1));
|
ext.execute_with(|| {
|
||||||
|
let _ = <Runtime as Config>::Currency::deposit_creating(
|
||||||
|
&Pallet::<Runtime>::account_id(),
|
||||||
|
<Runtime as Config>::Currency::minimum_balance(),
|
||||||
|
);
|
||||||
|
|
||||||
|
System::set_block_number(1);
|
||||||
|
});
|
||||||
|
|
||||||
ext
|
ext
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,19 +74,18 @@ parameter_types! {
|
|||||||
impl pallet_revive::Config for Runtime {
|
impl pallet_revive::Config for Runtime {
|
||||||
type Time = Timestamp;
|
type Time = Timestamp;
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
type CallFilter = ();
|
|
||||||
type ChainExtension = ();
|
|
||||||
type DepositPerByte = DepositPerByte;
|
type DepositPerByte = DepositPerByte;
|
||||||
type DepositPerItem = DepositPerItem;
|
type DepositPerItem = DepositPerItem;
|
||||||
type AddressMapper = AccountId32Mapper<Self>;
|
type AddressMapper = AccountId32Mapper<Self>;
|
||||||
type RuntimeMemory = ConstU32<{ 512 * 1024 * 1024 }>;
|
type RuntimeMemory = ConstU32<{ 512 * 1024 * 1024 }>;
|
||||||
type PVFMemory = ConstU32<{ 1024 * 1024 * 1024 }>;
|
type PVFMemory = ConstU32<{ 1024 * 1024 * 1024 }>;
|
||||||
type UnsafeUnstableInterface = UnstableInterface;
|
type UnsafeUnstableInterface = UnstableInterface;
|
||||||
type UploadOrigin = EnsureSigned<AccountId32>;
|
type UploadOrigin = EnsureSigned<Self::AccountId>;
|
||||||
type InstantiateOrigin = EnsureSigned<AccountId32>;
|
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
|
||||||
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
|
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
|
||||||
type ChainId = ConstU64<420_420_420>;
|
type ChainId = ConstU64<420_420_420>;
|
||||||
type FindAuthor = Self;
|
type FindAuthor = Self;
|
||||||
|
type NativeToEthRatio = ConstU32<{ crate::ETH_RATIO as u32 }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FindAuthor<<Runtime as frame_system::Config>::AccountId> for Runtime {
|
impl FindAuthor<<Runtime as frame_system::Config>::AccountId> for Runtime {
|
||||||
|
|||||||
+12
-11
@@ -1,5 +1,6 @@
|
|||||||
use std::{str::FromStr, time::Instant};
|
use std::{str::FromStr, time::Instant};
|
||||||
|
|
||||||
|
use polkadot_sdk::pallet_revive::Pallet;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::*;
|
use crate::*;
|
||||||
@@ -445,12 +446,13 @@ impl Specs {
|
|||||||
let time_start = Instant::now();
|
let time_start = Instant::now();
|
||||||
let result = Contracts::bare_instantiate(
|
let result = Contracts::bare_instantiate(
|
||||||
origin,
|
origin,
|
||||||
value,
|
value.into(),
|
||||||
gas_limit.unwrap_or(GAS_LIMIT),
|
gas_limit.unwrap_or(GAS_LIMIT),
|
||||||
storage_deposit_limit.unwrap_or(DEPOSIT_LIMIT).into(),
|
storage_deposit_limit.unwrap_or(DEPOSIT_LIMIT).into(),
|
||||||
code,
|
code,
|
||||||
data,
|
data,
|
||||||
salt.0,
|
salt.0,
|
||||||
|
pallet_revive::BumpNonce::No,
|
||||||
);
|
);
|
||||||
results.push(CallResult::Instantiate {
|
results.push(CallResult::Instantiate {
|
||||||
result,
|
result,
|
||||||
@@ -483,7 +485,7 @@ impl Specs {
|
|||||||
let result = Contracts::bare_call(
|
let result = Contracts::bare_call(
|
||||||
RuntimeOrigin::signed(origin.to_account_id(&results)),
|
RuntimeOrigin::signed(origin.to_account_id(&results)),
|
||||||
dest.to_eth_addr(&results),
|
dest.to_eth_addr(&results),
|
||||||
value,
|
value.into(),
|
||||||
gas_limit.unwrap_or(GAS_LIMIT),
|
gas_limit.unwrap_or(GAS_LIMIT),
|
||||||
storage_deposit_limit.unwrap_or(DEPOSIT_LIMIT).into(),
|
storage_deposit_limit.unwrap_or(DEPOSIT_LIMIT).into(),
|
||||||
data,
|
data,
|
||||||
@@ -497,8 +499,10 @@ impl Specs {
|
|||||||
expectation.verify(results.last().expect("No call to verify"));
|
expectation.verify(results.last().expect("No call to verify"));
|
||||||
}
|
}
|
||||||
VerifyBalance { origin, expected } => {
|
VerifyBalance { origin, expected } => {
|
||||||
let balance = Balances::usable_balance(origin.to_account_id(&results));
|
assert_eq!(
|
||||||
assert_eq!(balance, expected);
|
Pallet::<Runtime>::evm_balance(&origin.to_eth_addr(&results)),
|
||||||
|
expected.into()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
VerifyStorage {
|
VerifyStorage {
|
||||||
contract,
|
contract,
|
||||||
@@ -506,13 +510,10 @@ impl Specs {
|
|||||||
expected,
|
expected,
|
||||||
} => {
|
} => {
|
||||||
let address = contract.to_eth_addr(&results);
|
let address = contract.to_eth_addr(&results);
|
||||||
let Ok(value) = Contracts::get_storage(address, key) else {
|
let value = Contracts::get_storage(address, key)
|
||||||
panic!("error reading storage for address {address}");
|
.unwrap_or_else(|error| panic!("at {address}: {error:?}"))
|
||||||
};
|
.unwrap_or_else(|| vec![0; 32]);
|
||||||
let Some(value) = value else {
|
assert_eq!(value, expected, "at {address} key 0x{}", hex::encode(key));
|
||||||
panic!("no value at {address} key 0x{}", hex::encode(key));
|
|
||||||
};
|
|
||||||
assert_eq!(value, expected, "at key 0x{}", hex::encode(key));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-runtime-api"
|
name = "revive-runtime-api"
|
||||||
version = "0.2.0"
|
version = "0.4.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -53,11 +53,11 @@ POLKAVM_IMPORT(void, block_hash, uint32_t, uint32_t)
|
|||||||
|
|
||||||
POLKAVM_IMPORT(void, block_number, uint32_t)
|
POLKAVM_IMPORT(void, block_number, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(uint64_t, call, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
|
POLKAVM_IMPORT(uint32_t, call, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(uint64_t, call_data_copy, uint32_t, uint32_t, uint32_t)
|
POLKAVM_IMPORT(void, call_data_copy, uint32_t, uint32_t, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(uint64_t, call_data_load, uint32_t, uint32_t)
|
POLKAVM_IMPORT(void, call_data_load, uint32_t, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(uint64_t, call_data_size)
|
POLKAVM_IMPORT(uint64_t, call_data_size)
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ POLKAVM_IMPORT(uint64_t, code_size, uint32_t)
|
|||||||
|
|
||||||
POLKAVM_IMPORT(void, code_hash, uint32_t, uint32_t)
|
POLKAVM_IMPORT(void, code_hash, uint32_t, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(uint64_t, delegate_call, uint64_t, uint64_t, uint64_t, uint32_t, uint64_t, uint64_t)
|
POLKAVM_IMPORT(uint32_t, delegate_call, uint64_t, uint64_t, uint64_t, uint32_t, uint64_t, uint64_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(void, deposit_event, uint32_t, uint32_t, uint32_t, uint32_t)
|
POLKAVM_IMPORT(void, deposit_event, uint32_t, uint32_t, uint32_t, uint32_t)
|
||||||
|
|
||||||
@@ -79,11 +79,11 @@ POLKAVM_IMPORT(uint64_t, gas_price);
|
|||||||
|
|
||||||
POLKAVM_IMPORT(void, get_immutable_data, uint32_t, uint32_t);
|
POLKAVM_IMPORT(void, get_immutable_data, uint32_t, uint32_t);
|
||||||
|
|
||||||
POLKAVM_IMPORT(uint64_t, get_storage, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)
|
POLKAVM_IMPORT(void, get_storage_or_zero, uint32_t, uint32_t, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(void, hash_keccak_256, uint32_t, uint32_t, uint32_t)
|
POLKAVM_IMPORT(void, hash_keccak_256, uint32_t, uint32_t, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(uint64_t, instantiate, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
|
POLKAVM_IMPORT(uint32_t, instantiate, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(void, now, uint32_t)
|
POLKAVM_IMPORT(void, now, uint32_t)
|
||||||
|
|
||||||
@@ -99,8 +99,8 @@ POLKAVM_IMPORT(uint64_t, return_data_size)
|
|||||||
|
|
||||||
POLKAVM_IMPORT(void, set_immutable_data, uint32_t, uint32_t);
|
POLKAVM_IMPORT(void, set_immutable_data, uint32_t, uint32_t);
|
||||||
|
|
||||||
POLKAVM_IMPORT(uint64_t, set_storage, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)
|
POLKAVM_IMPORT(uint32_t, set_storage_or_clear, uint32_t, uint32_t, uint32_t)
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, terminate, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(void, value_transferred, uint32_t)
|
POLKAVM_IMPORT(void, value_transferred, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(void, weight_to_fee, uint64_t, uint64_t, uint32_t);
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ pub static GAS_PRICE: &str = "gas_price";
|
|||||||
|
|
||||||
pub static GET_IMMUTABLE_DATA: &str = "get_immutable_data";
|
pub static GET_IMMUTABLE_DATA: &str = "get_immutable_data";
|
||||||
|
|
||||||
pub static GET_STORAGE: &str = "get_storage";
|
pub static GET_STORAGE: &str = "get_storage_or_zero";
|
||||||
|
|
||||||
pub static HASH_KECCAK_256: &str = "hash_keccak_256";
|
pub static HASH_KECCAK_256: &str = "hash_keccak_256";
|
||||||
|
|
||||||
@@ -62,12 +62,12 @@ pub static RETURNDATASIZE: &str = "return_data_size";
|
|||||||
|
|
||||||
pub static SET_IMMUTABLE_DATA: &str = "set_immutable_data";
|
pub static SET_IMMUTABLE_DATA: &str = "set_immutable_data";
|
||||||
|
|
||||||
pub static SET_STORAGE: &str = "set_storage";
|
pub static SET_STORAGE: &str = "set_storage_or_clear";
|
||||||
|
|
||||||
|
pub static TERMINATE: &str = "terminate";
|
||||||
|
|
||||||
pub static VALUE_TRANSFERRED: &str = "value_transferred";
|
pub static VALUE_TRANSFERRED: &str = "value_transferred";
|
||||||
|
|
||||||
pub static WEIGHT_TO_FEE: &str = "weight_to_fee";
|
|
||||||
|
|
||||||
/// All imported runtime API symbols.
|
/// All imported runtime API symbols.
|
||||||
/// Useful for configuring common attributes and linkage.
|
/// Useful for configuring common attributes and linkage.
|
||||||
pub static IMPORTS: [&str; 33] = [
|
pub static IMPORTS: [&str; 33] = [
|
||||||
@@ -102,8 +102,8 @@ pub static IMPORTS: [&str; 33] = [
|
|||||||
RETURNDATASIZE,
|
RETURNDATASIZE,
|
||||||
SET_IMMUTABLE_DATA,
|
SET_IMMUTABLE_DATA,
|
||||||
SET_STORAGE,
|
SET_STORAGE,
|
||||||
|
TERMINATE,
|
||||||
VALUE_TRANSFERRED,
|
VALUE_TRANSFERRED,
|
||||||
WEIGHT_TO_FEE,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Creates a LLVM module from the [BITCODE].
|
/// Creates a LLVM module from the [BITCODE].
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-solc-json-interface"
|
name = "revive-solc-json-interface"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|||||||
@@ -47,24 +47,3 @@ pub enum Flag {
|
|||||||
#[serde(rename = "ir")]
|
#[serde(rename = "ir")]
|
||||||
Ir,
|
Ir,
|
||||||
}
|
}
|
||||||
|
|
||||||
//impl std::fmt::Display for Flag {
|
|
||||||
// fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
||||||
// match self {
|
|
||||||
// Self::ABI => write!(f, "abi"),
|
|
||||||
// Self::Metadata => write!(f, "metadata"),
|
|
||||||
// Self::Devdoc => write!(f, "devdoc"),
|
|
||||||
// Self::Userdoc => write!(f, "userdoc"),
|
|
||||||
// Self::MethodIdentifiers => write!(f, "evm.methodIdentifiers"),
|
|
||||||
// Self::StorageLayout => write!(f, "storageLayout"),
|
|
||||||
// Self::AST => write!(f, "ast"),
|
|
||||||
// Self::Yul => write!(f, "irOptimized"),
|
|
||||||
// Self::EVM => write!(f, "evm"),
|
|
||||||
// Self::EVMLA => write!(f, "evm.legacyAssembly"),
|
|
||||||
// Self::EVMBC => write!(f, "evm.bytecode"),
|
|
||||||
// Self::EVMDBC => write!(f, "evm.deployedBytecode"),
|
|
||||||
// Self::Assembly => write!(f, "evm.assembly"),
|
|
||||||
// Self::Ir => write!(f, "ir"),
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|||||||
@@ -40,17 +40,6 @@ impl File {
|
|||||||
per_contract,
|
per_contract,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Creates the selection required for production compilation (excludes EVM bytecode).
|
|
||||||
pub fn new_required() -> Self {
|
|
||||||
Self {
|
|
||||||
per_file: HashSet::from_iter([SelectionFlag::AST]),
|
|
||||||
per_contract: HashSet::from_iter([
|
|
||||||
SelectionFlag::MethodIdentifiers,
|
|
||||||
SelectionFlag::Metadata,
|
|
||||||
SelectionFlag::Yul,
|
|
||||||
]),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates the selection required for test compilation (includes EVM bytecode).
|
/// Creates the selection required for test compilation (includes EVM bytecode).
|
||||||
pub fn new_required_for_tests() -> Self {
|
pub fn new_required_for_tests() -> Self {
|
||||||
@@ -66,16 +55,6 @@ impl File {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extends the user's output selection with flag required by our compilation process.
|
|
||||||
pub fn extend_with_required(&mut self) -> &mut Self {
|
|
||||||
let required = Self::new_required();
|
|
||||||
|
|
||||||
self.per_file.extend(required.per_file);
|
|
||||||
self.per_contract.extend(required.per_contract);
|
|
||||||
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Extends the output selection with another one.
|
/// Extends the output selection with another one.
|
||||||
pub fn extend(&mut self, other: Self) -> &mut Self {
|
pub fn extend(&mut self, other: Self) -> &mut Self {
|
||||||
self.per_file.extend(other.per_file);
|
self.per_file.extend(other.per_file);
|
||||||
|
|||||||
@@ -10,15 +10,63 @@ use serde::Serialize;
|
|||||||
use self::file::flag::Flag;
|
use self::file::flag::Flag;
|
||||||
use self::file::File as FileSelection;
|
use self::file::File as FileSelection;
|
||||||
|
|
||||||
|
/// The `solc --standard-json` per-file output selection.
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, Default, PartialEq)]
|
||||||
|
pub struct PerFileSelection {
|
||||||
|
/// Individual file selection configuration, required for foundry.
|
||||||
|
#[serde(skip_serializing_if = "BTreeMap::is_empty", flatten)]
|
||||||
|
pub files: BTreeMap<String, FileSelection>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PerFileSelection {
|
||||||
|
/// Extends the output selection with another one.
|
||||||
|
pub fn extend(&mut self, other: Self) {
|
||||||
|
for (entry, file) in other.files {
|
||||||
|
self.files
|
||||||
|
.entry(entry)
|
||||||
|
.and_modify(|v| {
|
||||||
|
v.extend(file.clone());
|
||||||
|
})
|
||||||
|
.or_insert(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns flags that are going to be automatically added by the compiler,
|
||||||
|
/// but were not explicitly requested by the user.
|
||||||
|
///
|
||||||
|
/// Afterwards, the flags are used to prune JSON output before returning it.
|
||||||
|
pub fn selection_to_prune(&self) -> Self {
|
||||||
|
let files = self
|
||||||
|
.files
|
||||||
|
.iter()
|
||||||
|
.map(|(k, v)| (k.to_owned(), v.selection_to_prune()))
|
||||||
|
.collect();
|
||||||
|
Self { files }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns whether `path` contains the `flag` or `None` if there is no selection for `path`.
|
||||||
|
pub fn contains(&self, path: &String, flag: &Flag) -> Option<bool> {
|
||||||
|
if let Some(file) = self.files.get(path) {
|
||||||
|
return Some(file.contains(flag));
|
||||||
|
};
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns whether this is the empty per file selection.
|
||||||
|
pub fn is_empty(&self) -> bool {
|
||||||
|
self.files.is_empty()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The `solc --standard-json` output selection.
|
/// The `solc --standard-json` output selection.
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, Default, PartialEq)]
|
#[derive(Clone, Debug, Serialize, Deserialize, Default, PartialEq)]
|
||||||
pub struct Selection {
|
pub struct Selection {
|
||||||
/// Only the 'all' wildcard is available for robustness reasons.
|
/// Only the 'all' wildcard is available for robustness reasons.
|
||||||
#[serde(default, rename = "*", skip_serializing_if = "FileSelection::is_empty")]
|
#[serde(default, rename = "*", skip_serializing_if = "FileSelection::is_empty")]
|
||||||
all: FileSelection,
|
/// Individual file selection configuration, required for foundry.
|
||||||
|
pub all: FileSelection,
|
||||||
#[serde(skip_serializing_if = "BTreeMap::is_empty", flatten)]
|
#[serde(skip_serializing_if = "PerFileSelection::is_empty", flatten)]
|
||||||
pub files: BTreeMap<String, FileSelection>,
|
files: PerFileSelection,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Selection {
|
impl Selection {
|
||||||
@@ -32,17 +80,19 @@ impl Selection {
|
|||||||
|
|
||||||
/// Creates the selection required by our compilation process.
|
/// Creates the selection required by our compilation process.
|
||||||
pub fn new_required() -> Self {
|
pub fn new_required() -> Self {
|
||||||
Self {
|
Self::new(vec![
|
||||||
all: FileSelection::new_required(),
|
Flag::AST,
|
||||||
files: BTreeMap::new(),
|
Flag::MethodIdentifiers,
|
||||||
}
|
Flag::Metadata,
|
||||||
|
Flag::Yul,
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates the selection required for test compilation (includes EVM bytecode).
|
/// Creates the selection required for test compilation (includes EVM bytecode).
|
||||||
pub fn new_required_for_tests() -> Self {
|
pub fn new_required_for_tests() -> Self {
|
||||||
Self {
|
Self {
|
||||||
all: FileSelection::new_required_for_tests(),
|
all: FileSelection::new_required_for_tests(),
|
||||||
files: BTreeMap::new(),
|
files: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,6 +104,7 @@ impl Selection {
|
|||||||
/// Extends the output selection with another one.
|
/// Extends the output selection with another one.
|
||||||
pub fn extend(&mut self, other: Self) -> &mut Self {
|
pub fn extend(&mut self, other: Self) -> &mut Self {
|
||||||
self.all.extend(other.all);
|
self.all.extend(other.all);
|
||||||
|
self.files.extend(other.files);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,12 +115,14 @@ impl Selection {
|
|||||||
pub fn selection_to_prune(&self) -> Self {
|
pub fn selection_to_prune(&self) -> Self {
|
||||||
Self {
|
Self {
|
||||||
all: self.all.selection_to_prune(),
|
all: self.all.selection_to_prune(),
|
||||||
files: Default::default(),
|
files: self.files.selection_to_prune(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether the flag is requested.
|
/// Whether the flag is requested.
|
||||||
pub fn contains(&self, flag: &Flag) -> bool {
|
pub fn contains(&self, path: &String, flag: &Flag) -> bool {
|
||||||
self.all.contains(flag)
|
self.files
|
||||||
|
.contains(path, flag)
|
||||||
|
.unwrap_or(self.all.contains(flag))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
pub mod evm;
|
pub mod evm;
|
||||||
|
|
||||||
|
#[cfg(feature = "resolc")]
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
#[cfg(feature = "resolc")]
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
|
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
@@ -45,19 +47,24 @@ pub struct Contract {
|
|||||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub hash: Option<String>,
|
pub hash: Option<String>,
|
||||||
/// Unlinked factory dependencies.
|
/// Unlinked factory dependencies.
|
||||||
|
#[cfg(feature = "resolc")]
|
||||||
#[serde(default, skip_deserializing)]
|
#[serde(default, skip_deserializing)]
|
||||||
pub factory_dependencies_unlinked: BTreeSet<String>,
|
pub factory_dependencies_unlinked: BTreeSet<String>,
|
||||||
/// The contract factory dependencies.
|
/// The contract factory dependencies.
|
||||||
|
#[cfg(feature = "resolc")]
|
||||||
#[serde(default, skip_deserializing)]
|
#[serde(default, skip_deserializing)]
|
||||||
pub factory_dependencies: BTreeMap<String, String>,
|
pub factory_dependencies: BTreeMap<String, String>,
|
||||||
/// Missing linkable libraries.
|
/// Missing linkable libraries.
|
||||||
|
#[cfg(feature = "resolc")]
|
||||||
#[serde(default, skip_deserializing)]
|
#[serde(default, skip_deserializing)]
|
||||||
pub missing_libraries: BTreeSet<String>,
|
pub missing_libraries: BTreeSet<String>,
|
||||||
/// Binary object format.
|
/// Binary object format.
|
||||||
#[serde(default, skip_deserializing)]
|
#[cfg(feature = "resolc")]
|
||||||
|
#[serde(default, skip_deserializing, skip_serializing_if = "Option::is_none")]
|
||||||
pub object_format: Option<revive_common::ObjectFormat>,
|
pub object_format: Option<revive_common::ObjectFormat>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "resolc")]
|
||||||
impl Contract {
|
impl Contract {
|
||||||
/// Checks if all fields are unset or empty.
|
/// Checks if all fields are unset or empty.
|
||||||
pub fn is_empty(&self) -> bool {
|
pub fn is_empty(&self) -> bool {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use crate::standard_json::output::error::error_handler::ErrorHandler;
|
|||||||
use crate::SolcStandardJsonInputSettingsSelection;
|
use crate::SolcStandardJsonInputSettingsSelection;
|
||||||
#[cfg(feature = "resolc")]
|
#[cfg(feature = "resolc")]
|
||||||
use crate::SolcStandardJsonInputSource;
|
use crate::SolcStandardJsonInputSource;
|
||||||
#[cfg(feature = "parallel")]
|
#[cfg(all(feature = "parallel", feature = "resolc"))]
|
||||||
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|
||||||
|
|
||||||
use self::contract::Contract;
|
use self::contract::Contract;
|
||||||
@@ -56,14 +56,22 @@ impl Output {
|
|||||||
messages: &mut Vec<SolcStandardJsonOutputError>,
|
messages: &mut Vec<SolcStandardJsonOutputError>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let sources = sources
|
let sources = sources
|
||||||
.keys()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(index, path)| (path.to_owned(), Source::new(index)))
|
.map(|(index, (path, source))| {
|
||||||
|
(
|
||||||
|
path.to_owned(),
|
||||||
|
Source {
|
||||||
|
id: index,
|
||||||
|
ast: source.content().map(|x| serde_json::to_value(x).unwrap()),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
})
|
||||||
.collect::<BTreeMap<String, Source>>();
|
.collect::<BTreeMap<String, Source>>();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
contracts: BTreeMap::new(),
|
contracts: BTreeMap::new(),
|
||||||
sources,
|
sources: sources.clone(),
|
||||||
errors: std::mem::take(messages),
|
errors: std::mem::take(messages),
|
||||||
|
|
||||||
version: None,
|
version: None,
|
||||||
@@ -92,36 +100,27 @@ impl Output {
|
|||||||
mut self,
|
mut self,
|
||||||
selection_to_prune: SolcStandardJsonInputSettingsSelection,
|
selection_to_prune: SolcStandardJsonInputSettingsSelection,
|
||||||
) -> ! {
|
) -> ! {
|
||||||
let sources = self.sources.values_mut().collect::<Vec<&mut Source>>();
|
for (path, contracts) in self.contracts.iter_mut() {
|
||||||
for source in sources.into_iter() {
|
for contract in contracts.values_mut() {
|
||||||
if selection_to_prune
|
|
||||||
.contains(&crate::SolcStandardJsonInputSettingsSelectionFileFlag::AST)
|
|
||||||
{
|
|
||||||
source.ast = None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let contracts = self
|
|
||||||
.contracts
|
|
||||||
.values_mut()
|
|
||||||
.flat_map(|contracts| contracts.values_mut())
|
|
||||||
.collect::<Vec<&mut Contract>>();
|
|
||||||
for contract in contracts.into_iter() {
|
|
||||||
if selection_to_prune
|
|
||||||
.contains(&crate::SolcStandardJsonInputSettingsSelectionFileFlag::Metadata)
|
|
||||||
{
|
|
||||||
contract.metadata = serde_json::Value::Null;
|
|
||||||
}
|
|
||||||
if selection_to_prune
|
|
||||||
.contains(&crate::SolcStandardJsonInputSettingsSelectionFileFlag::Yul)
|
|
||||||
{
|
|
||||||
contract.ir_optimized = String::new();
|
|
||||||
}
|
|
||||||
if let Some(ref mut evm) = contract.evm {
|
|
||||||
if selection_to_prune.contains(
|
if selection_to_prune.contains(
|
||||||
&crate::SolcStandardJsonInputSettingsSelectionFileFlag::MethodIdentifiers,
|
path,
|
||||||
|
&crate::SolcStandardJsonInputSettingsSelectionFileFlag::Metadata,
|
||||||
) {
|
) {
|
||||||
evm.method_identifiers.clear();
|
contract.metadata = serde_json::Value::Null;
|
||||||
|
}
|
||||||
|
if selection_to_prune.contains(
|
||||||
|
path,
|
||||||
|
&crate::SolcStandardJsonInputSettingsSelectionFileFlag::Yul,
|
||||||
|
) {
|
||||||
|
contract.ir_optimized = String::new();
|
||||||
|
}
|
||||||
|
if let Some(ref mut evm) = contract.evm {
|
||||||
|
if selection_to_prune.contains(
|
||||||
|
path,
|
||||||
|
&crate::SolcStandardJsonInputSettingsSelectionFileFlag::MethodIdentifiers,
|
||||||
|
) {
|
||||||
|
evm.method_identifiers.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-stdlib"
|
name = "revive-stdlib"
|
||||||
version = "0.1.1"
|
version = "0.2.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-yul"
|
name = "revive-yul"
|
||||||
description = "The revive YUL parser library."
|
description = "The revive YUL parser library."
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|||||||
@@ -661,6 +661,14 @@ impl FunctionCall {
|
|||||||
Name::Invalid => {
|
Name::Invalid => {
|
||||||
revive_llvm_context::polkavm_evm_return::invalid(context).map(|_| None)
|
revive_llvm_context::polkavm_evm_return::invalid(context).map(|_| None)
|
||||||
}
|
}
|
||||||
|
Name::SelfDestruct => {
|
||||||
|
let arguments = self.pop_arguments_llvm::<1>(context)?;
|
||||||
|
revive_llvm_context::polkavm_evm_return::selfdestruct(
|
||||||
|
context,
|
||||||
|
arguments[0].into_int_value(),
|
||||||
|
)
|
||||||
|
.map(|_| None)
|
||||||
|
}
|
||||||
|
|
||||||
Name::Log0 => {
|
Name::Log0 => {
|
||||||
let arguments = self.pop_arguments_llvm::<2>(context)?;
|
let arguments = self.pop_arguments_llvm::<2>(context)?;
|
||||||
@@ -962,13 +970,6 @@ impl FunctionCall {
|
|||||||
location
|
location
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Name::SelfDestruct => {
|
|
||||||
let _arguments = self.pop_arguments_llvm::<1>(context)?;
|
|
||||||
anyhow::bail!(
|
|
||||||
"{} The `SELFDESTRUCT` instruction is not supported",
|
|
||||||
location
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ impl Expression {
|
|||||||
anyhow::anyhow!(
|
anyhow::anyhow!(
|
||||||
"{} Invalid literal `{}`: {}",
|
"{} Invalid literal `{}`: {}",
|
||||||
literal.location,
|
literal.location,
|
||||||
literal.inner.to_string(),
|
literal.inner,
|
||||||
error
|
error
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@parity/resolc",
|
"name": "@parity/resolc",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"author": "Parity <admin@parity.io> (https://parity.io)",
|
"author": "Parity <admin@parity.io> (https://parity.io)",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
|
|||||||
Generated
+6
-1
@@ -31,7 +31,7 @@
|
|||||||
},
|
},
|
||||||
"js/resolc": {
|
"js/resolc": {
|
||||||
"name": "@parity/resolc",
|
"name": "@parity/resolc",
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "^22.9.0",
|
"@types/node": "^22.9.0",
|
||||||
@@ -1585,6 +1585,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.1.tgz",
|
||||||
"integrity": "sha512-LKMrmwCPoLhM45Z00O1ulb6jwyVr2kr3XJp+G+tSEZcbauNnScewcQwtJqXDhXeYPDEjZ8C1SjXm015CirEmGg==",
|
"integrity": "sha512-LKMrmwCPoLhM45Z00O1ulb6jwyVr2kr3XJp+G+tSEZcbauNnScewcQwtJqXDhXeYPDEjZ8C1SjXm015CirEmGg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.32.1",
|
"@typescript-eslint/scope-manager": "8.32.1",
|
||||||
"@typescript-eslint/types": "8.32.1",
|
"@typescript-eslint/types": "8.32.1",
|
||||||
@@ -1752,6 +1753,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz",
|
||||||
"integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==",
|
"integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"acorn": "bin/acorn"
|
"acorn": "bin/acorn"
|
||||||
},
|
},
|
||||||
@@ -2361,6 +2363,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.27.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.27.0.tgz",
|
||||||
"integrity": "sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==",
|
"integrity": "sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.12.1",
|
"@eslint-community/regexpp": "^4.12.1",
|
||||||
@@ -2519,6 +2522,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ethersproject/abi": "5.8.0",
|
"@ethersproject/abi": "5.8.0",
|
||||||
"@ethersproject/abstract-provider": "5.8.0",
|
"@ethersproject/abstract-provider": "5.8.0",
|
||||||
@@ -4393,6 +4397,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||||
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
|
|||||||
Reference in New Issue
Block a user