Skip to content

Commit

Permalink
re-syncing to the newest foundry version (#114)
Browse files Browse the repository at this point in the history
Re-applying all the zksync speicific changes on top of the fresh fork

* chore(security): add workflow for leaked secrets monitoring

* Implement zk-build, zk-create, zk-cast, & zk-deposit cmds

* improve the error message for missing zk compiler output (#82)

Co-authored-by: Tamer Tas <tmrtx@noreply>

* Zkutils comments (#81)

* zk_utils comment

* update developer comments for zkutils and zksolc

* update doc

* Update README.md

* Update README.md

* Added troubleshooting section to README. (#84)

Better error handling for failed transactions

* Added better error messages when file or contract name is not correct (#86)

* updated cargo lock to use the newer version of zksync era (#87)

* Added support for Macs with Apple Silicon (#90)

Added support for Macs with Apple Silicon:

selecting proper zksync compiler
information on where to get the most recent solidity

* Improved message on compiler error and added support for 1.3.10 (#91)

* added better compiler error passing and support for version 1.3.10

* added comments

* more instructions

* more info

* Added a dependency on ethers-rs fork to support latest solidity (#92)

We're currently based off the old fork of foundry, that was depending on the old version of ethers-rs, which supported the solc compiler only up to 0.8.17 (especially on Apple Silicon).

With this PR, I'm moving us to depend on a fork of ethers-rs, that has svm (solidity version manager) patched to the newest release - therefore allowing us to support 0.8.20.

In the near future, we'll rebase ourselves to newer version of foundry, and this dependency would be switched back to original ethers repo.

* fix test compilation issue (#88)

* Adding support for the newest 1.3.11 zksolc compiler (#95)

* Fix flags for zk deposit (#94)

Fix flags used by zk-deposit:

Use --l1-url and --l2-url (and ignore the --rpc-url flag)

* edited README

* typos

* one more typo

* updates from comments

* Fixed compilation issue (#101)

* fix(readme): --is-system flag image (#103)

* Replace `zksync` crate with `zksync_web3_rs` (#110)

* WIP deposit using zksync_ethers_rs

* WIP deposit and test script

* Add zksync rust sdk as dependency

* Use withdraw from Rust SDK

* Add to address as parameter for withdraw

* WIP test

* Add support for multiple flags in withdraw

* Update cargo.lock

* Use Rust SDK to send transactions to contracts

* Fix deposit test

* Support all parameter types for send command

* Add optional fields to deposit

* Add missing deposit parameters

* Cleanup

* wip.

* Deploy with constructor parameters

* Remove unwraps and commented code

* Fix operator_tip setter

* Remove legacy test script

* point zksync-web3-rs to main

* revert cargo.toml autoformat

* Fix create.

* Remove zksync dependencies.

* Update deploy with new signature from Rust SDK

* Add support for construction parameters from file.

* Update function to get constructor arguments

* Add back chain id to every zk function.

* Minor cleanups and consistency. (#9)

* Add transaction id to print after deploy

* Fix compiler warnings

* Update zksync-web3-rs commit in dependencies

* Add necessary changes with new SDK version

---------

Co-authored-by: Joaquín P. Centeno <[email protected]>
Co-authored-by: IAvecilla <[email protected]>
Co-authored-by: Matías Onorato <[email protected]>

* fixed compilation issues

---------

Co-authored-by: Maksym <[email protected]>
Co-authored-by: sam shakespeare <[email protected]>
Co-authored-by: tmrtx <[email protected]>
Co-authored-by: Tamer Tas <tmrtx@noreply>
Co-authored-by: Sam Shakespeare <[email protected]>
Co-authored-by: Katharine <[email protected]>
Co-authored-by: niramisa <[email protected]>
Co-authored-by: evmcheb <[email protected]>
Co-authored-by: Martin Paulucci <[email protected]>
Co-authored-by: Joaquín P. Centeno <[email protected]>
Co-authored-by: IAvecilla <[email protected]>
Co-authored-by: Matías Onorato <[email protected]>
  • Loading branch information
13 people authored Aug 10, 2023
1 parent 8d1dd30 commit 2a5ab4c
Show file tree
Hide file tree
Showing 25 changed files with 14,403 additions and 601 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/secrets_scanner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Leaked Secrets Scan
on: [pull_request]
jobs:
TruffleHog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@0c66d30c1f4075cee1aada2e1ab46dabb1b0071a
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug --only-verified
137 changes: 0 additions & 137 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,127 +121,6 @@ jobs:
# see https://github.com/foundry-rs/foundry/pull/3959
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib"
cargo nextest run --partition count:${{ matrix.partition }}/2 --retries 3 --archive-file nextest-integration.tar.zst -E '${{ matrix.job.filter }}'
forge-std-tests:
name: forge std tests / ${{ matrix.job.name }}
runs-on: ubuntu-latest
needs: build-tests
strategy:
matrix:
job:
- name: forge-std-test
filter: "test(~forge_std)"
env:
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
steps:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@nextest
- uses: dtolnay/rust-toolchain@stable
- name: Download archives
uses: actions/download-artifact@v3
with:
name: integration-tests

- name: Forge RPC cache
uses: actions/cache@v3
if: matrix.job.name != 'forge-std-test'
with:
path: "$HOME/.foundry/cache"
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }}
- name: Setup git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: cargo nextest
run: |
# see https://github.com/foundry-rs/foundry/pull/3959
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib"
cargo nextest run --retries 3 --archive-file nextest-integration.tar.zst -E '${{ matrix.job.filter }}'
integration:
name: integration tests / ${{ matrix.job.name }}
runs-on: ubuntu-latest
needs: build-tests
strategy:
matrix:
job:
- name: non-forking
filter: "!test(~fork) & !test(~live) & !test(~issue) & !test(~forge_std)"
- name: forking
filter: "test(~fork) & !test(~live)"
partition: [1, 2]
env:
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
steps:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@nextest
- uses: dtolnay/rust-toolchain@stable
- name: Download archives
uses: actions/download-artifact@v3
with:
name: integration-tests

- name: Forge RPC cache
uses: actions/cache@v3
if: matrix.job.name != 'non-forking'
with:
path: "$HOME/.foundry/cache"
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }}
- name: Setup git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: cargo nextest
run: |
# see https://github.com/foundry-rs/foundry/pull/3959
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib"
cargo nextest run --partition count:${{ matrix.partition }}/2 --retries 3 --archive-file nextest-integration.tar.zst -E '${{ matrix.job.filter }}'
external-integration:
name: external integration tests / ${{ matrix.job.name }}
runs-on: ubuntu-latest
needs: build-tests
strategy:
matrix:
job:
- name: non-forking
filter: "!test(~fork_integration) & !test(~live)"
- name: forking
filter: "test(~fork_integration) & !test(~live)"
env:
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
steps:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@nextest
- uses: dtolnay/rust-toolchain@stable
- name: Download archives
uses: actions/download-artifact@v3
with:
name: external-integration-tests

- name: Forge RPC cache
uses: actions/cache@v3
if: matrix.job.name != 'non-forking'
with:
path: "$HOME/.foundry/cache"
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }}

- name: Setup git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: Force use of HTTPS for submodules
run: git config --global url."https://github.com/".insteadOf "[email protected]:"

- name: cargo nextest
run: |
# see https://github.com/foundry-rs/foundry/pull/3959
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib"
cargo nextest run --retries 3 --archive-file nextest-external-integration.tar.zst -E '${{ matrix.job.filter }}'
doctests:
name: doc tests
runs-on: ubuntu-latest
Expand All @@ -253,12 +132,6 @@ jobs:
- name: cargo test
run: cargo test --locked --workspace --all-features --doc

cross-platform:
name: Cross-platform tests
if: github.event_name != 'pull_request'
needs: [unit, integration, doctests]
uses: ./.github/workflows/cross-platform.yml

clippy:
name: clippy
runs-on: ubuntu-latest
Expand All @@ -281,13 +154,3 @@ jobs:
components: rustfmt
- run: cargo fmt --all --check

forge-fmt:
name: forge fmt
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: forge fmt
run: cargo run --bin forge -- fmt --check testdata/
Loading

0 comments on commit 2a5ab4c

Please sign in to comment.