diff --git a/.github/workflows/infrastructure.yml b/.github/workflows/infrastructure.yml index dd583f35d..04c3f0c88 100644 --- a/.github/workflows/infrastructure.yml +++ b/.github/workflows/infrastructure.yml @@ -24,7 +24,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-02-06 + toolchain: nightly-2024-04-28 - name: Build forge binary run: cargo build --release --bin forge diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f08d0d0c0..4e944e316 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly-2024-02-06 + toolchain: nightly-2024-04-28 - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly-2024-02-06 + toolchain: nightly-2024-04-28 components: rustfmt - run: cargo fmt --all --check @@ -67,7 +67,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly-2024-02-06 + toolchain: nightly-2024-04-28 - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true @@ -82,7 +82,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly-2024-02-06 + toolchain: nightly-2024-04-28 - uses: taiki-e/install-action@cargo-hack - uses: Swatinem/rust-cache@v2 with: @@ -103,7 +103,7 @@ jobs: # - name: Install Rust # uses: actions-rust-lang/setup-rust-toolchain@v1 # with: - # toolchain: nightly-2024-02-06 + # toolchain: nightly-2024-04-28 # - name: Get solc @@ -130,7 +130,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-02-06 + toolchain: nightly-2024-04-28 - name: Run smoke-test env: diff --git a/Cargo.lock b/Cargo.lock index 7283993dc..718839c21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,20 +79,20 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.20" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2feb5f466b3a786d5a622d8926418bc6a0d38bf632909f6ee9298a4a1d8c6e0" +checksum = "1752d7d62e2665da650a36d84abbf239f812534475d51f072a49a533513b7cdd" dependencies = [ "num_enum 0.7.2", "serde", - "strum 0.26.2", + "strum 0.26.3", ] [[package]] name = "alloy-consensus" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc7579e4fb5558af44810f542c90d1145dba8b92c08211c215196160c48d2ea" +checksum = "3f63a6c9eb45684a5468536bc55379a2af0f45ffa5d756e4e4964532737e1836" dependencies = [ "alloy-eips", "alloy-primitives", @@ -104,9 +104,9 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "860887f0f7e1e17db33ada75c3c516164a5e11aa89f0311f4d23b82abcf2d807" +checksum = "0c26b7d34cb76f826558e9409a010e25257f7bfb5aa5e3dd0042c564664ae159" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -145,9 +145,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdbc8d98cc36ebe17bb5b42d0873137bc76628a4ee0f7e7acad5b8fc59d3597" +checksum = "aa4b0fc6a572ef2eebda0a31a5e393d451abda703fec917c75d9615d8c978cf2" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -161,14 +161,13 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e10a047066076b32d52b3228e95a4f7793db7a204f648aa1a1ea675085bffd8" +checksum = "48450f9c6f0821c1eee00ed912942492ed4f11dd69532825833de23ecc7a2256" dependencies = [ "alloy-primitives", "alloy-serde", "serde", - "serde_json", ] [[package]] @@ -185,9 +184,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06d33b79246313c4103ef9596c721674a926f1ddc8b605aa2bac4d8ba94ee34" +checksum = "d484c2a934d0a4d86f8ad4db8113cb1d607707a6c54f6e78f4f1b4451b47aa70" dependencies = [ "alloy-primitives", "serde", @@ -198,9 +197,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef742b478a2db5c27063cde82128dfbecffcd38237d7f682a91d3ecf6aa1836c" +checksum = "7a20eba9bc551037f0626d6d29e191888638d979943fa4e842e9e6fc72bf0565" dependencies = [ "alloy-consensus", "alloy-eips", @@ -245,9 +244,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200b786259a17acf318b9c423afe9669bec24ce9cdf59de153ff9a4009914bb6" +checksum = "ad5d89acb7339fad13bc69e7b925232f242835bfd91c82fcb9326b36481bd0f0" dependencies = [ "alloy-chains", "alloy-consensus", @@ -282,9 +281,9 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47e6e6c1eab938a18a8e88d430cc9d548edf54c850a550873888285c85428eca" +checksum = "034258dfaa51c278e1f7fcc46e587d10079ec9372866fa48c5df9d908fc1f6b1" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -301,9 +300,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" dependencies = [ "alloy-rlp-derive", "arrayvec 0.7.4", @@ -312,20 +311,20 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "alloy-rpc-client" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328a6a14aba6152ddf6d01bac5e17a70dbe9d6f343bf402b995c30bac63a1fbf" +checksum = "479ce003e8c74bbbc7d4235131c1d6b7eaf14a533ae850295b90d240340989cb" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -348,9 +347,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3164e7d8a718a22ede70b2c1d2bb554a8b4bd8e56c07ab630b75c74c06c53752" +checksum = "0dfa1dd3e0bc3a3d89744fba8d1511216e83257160da2cd028a18b7d9c026030" dependencies = [ "alloy-rpc-types-eth", "alloy-rpc-types-trace", @@ -360,9 +359,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90c3de574f90d9b939e3ee666a74bea29fb1a2ae66f1569b111bb6a922b1c762" +checksum = "cc40df2dda7561d1406d0bee1d19c8787483a2cf2ee8011c05909475e7bc102d" dependencies = [ "alloy-consensus", "alloy-eips", @@ -378,9 +377,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bce0676f144be1eae71122d1d417885a3b063add0353b35e46cdf1440d6b33b1" +checksum = "13bd7aa9ff9e67f1ba7ee0dd8cebfc95831d1649b0e4eeefae940dc3681079fa" dependencies = [ "alloy-consensus", "alloy-eips", @@ -396,22 +395,23 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a39c52613dc4d9995ff284b496158594ae63f9bfc58b5ef04e48ec5da2e3d747" +checksum = "535d26db98ac320a0d1637faf3e210328c3df3b1998abd7e72343d3857058efe" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", "serde", "serde_json", + "thiserror", ] [[package]] name = "alloy-rpc-types-txpool" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aeb7995e8859f3931b6199e13a533c9fde89affa900addb7218db2f15f9687d" +checksum = "5971c92989c6a5588d3f6d1e99e5328fba6e68694efbe969d6ec96ae5b9d1037" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -421,9 +421,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c224916316519558d8c2b6a60dc7626688c08f1b8951774702562dbcb8666ee" +checksum = "8913f9e825068d77c516188c221c44f78fd814fce8effe550a783295a2757d19" dependencies = [ "alloy-primitives", "serde", @@ -432,9 +432,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "227c5fd0ed6e06e1ccc30593f8ff6d9fb907ac5f03a709a6d687f0943494a229" +checksum = "f740e13eb4c6a0e4d0e49738f1e86f31ad2d7ef93be499539f492805000f7237" dependencies = [ "alloy-dyn-abi", "alloy-primitives", @@ -448,9 +448,9 @@ dependencies = [ [[package]] name = "alloy-signer-aws" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723009d673de375a1f2d5fe4a1b32fea144001578db54b2dd5c817eaa9f09c25" +checksum = "3e9573e8a5339fefc515b3e336fae177e2080225a4ea49cd5ab24de4b0bdc81d" dependencies = [ "alloy-consensus", "alloy-network", @@ -466,9 +466,9 @@ dependencies = [ [[package]] name = "alloy-signer-gcp" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97eae91202844e3cde7281d8343fd848bbae8bd53cf3f92450a66ba989c12b34" +checksum = "4911b3b4e104af7ed40bf51031a6f0f2400788759f6073a5d90003db6bb88fe6" dependencies = [ "alloy-consensus", "alloy-network", @@ -484,9 +484,9 @@ dependencies = [ [[package]] name = "alloy-signer-ledger" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a65e52c3c1848510d69e73e716139839f701134465bf44b77a7e43c1362f6" +checksum = "3eb31f033976724d10f90633477436f5e3757b04283c475a750a77e82422aa36" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -504,9 +504,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c44057ac1e8707f8c6a983db9f83ac1265c9e05be81d432acf2aad2880e1c0" +checksum = "87db68d926887393a1d0f9c43833b44446ea29d603291e7b20e5d115f31aa4e3" dependencies = [ "alloy-consensus", "alloy-network", @@ -524,9 +524,9 @@ dependencies = [ [[package]] name = "alloy-signer-trezor" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85f68408899f493c3fd432e680f7ab586a38b9d2c8c117190855157dac70d9c4" +checksum = "39c0c55911ca291f842f7d18a06a993679fe672d5d02049c665fa01aafa2b31a" dependencies = [ "alloy-consensus", "alloy-network", @@ -550,7 +550,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -567,7 +567,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "syn-solidity", "tiny-keccak 2.0.2", ] @@ -585,7 +585,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.66", + "syn 2.0.68", "syn-solidity", ] @@ -613,9 +613,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3628d81530263fe837a09cd527022f5728202a669973f04270942f4d390b5f5" +checksum = "dd9773e4ec6832346171605c776315544bd06e40f803e7b5b7824b325d5442ca" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -631,9 +631,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f35d34e7a51503c9ff267404a5850bd58f991b7ab524b892f364901e3576376" +checksum = "ff8ef947b901c0d4e97370f9fa25844cf8b63b1a58fd4011ee82342dc8a9fc6b" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -646,9 +646,9 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d2f106151a583f7d258fe8cc846c5196da90a9f502d4b3516c56d63e1f25a2" +checksum = "bb40ee66887a66d875a5bb5e01cee4c9a467c263ef28c865cd4b0ebf15f705af" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -667,9 +667,9 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20a80da44d3709c4ceaf47745ad820eae8f121404b9ffd8e285522ac4eb06681" +checksum = "3d92049d6642a18c9849ce7659430151e7c92b51552a0cabdc038c1af4cd7308" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -840,7 +840,7 @@ dependencies = [ "foundry-evm", "foundry-test-utils", "futures 0.3.30", - "hyper 1.3.1", + "hyper 1.4.0", "itertools 0.13.0", "k256 0.13.3", "parking_lot 0.12.3", @@ -1129,7 +1129,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1151,7 +1151,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1162,7 +1162,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1218,7 +1218,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1229,9 +1229,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-config" -version = "1.5.1" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac9889352d632214df943e26740c46a0f3da6e329fbd28164fe7ae1b061da7b" +checksum = "caf6cfe2881cb1fcbba9ae946fb9a6480d3b7a714ca84c74925014a89ef3387a" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1272,9 +1272,9 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.2.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36978815abdd7297662bf906adff132941a02ecf425bc78fac7d90653ce87560" +checksum = "87c5f920ffd1e0526ec9e70e50bf444db50b204395a0fa7016bbf9e31ea1698f" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -1290,14 +1290,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "tracing", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] name = "aws-sdk-kms" -version = "1.30.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da951fb0dd1a02728a91c58af8464098766f1a0600af932dd3f8361b23e1bfc9" +checksum = "d1e9940bfbfded74ea7172fe75815ce2b2aed4766d2375620df812b2aeab8eaa" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1317,9 +1317,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.29.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da75cf91cbb46686a27436d639a720a3a198b148efa76dc2467b7e5374a67fc0" +checksum = "cdcfae7bf8b8f14cade7579ffa8956fcee91dc23633671096b4b5de7d16f682a" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1339,9 +1339,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.30.0" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2ec8a6687299685ed0a4a3137c129cdb132b5235bc3aa3443f6cffe468b9ff" +checksum = "33b30def8f02ba81276d5dbc22e7bf3bed20d62d1b175eef82680d6bdc7a6f4c" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1361,9 +1361,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.29.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f1031e094b1411b59b49b19e4118f069e1fe13a9c5b8888e933daaf7ffdd6" +checksum = "0804f840ad31537d5d1a4ec48d59de5e674ad05f1db7d3def2c9acadaf1f7e60" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1384,9 +1384,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31eed8d45759b2c5fe7fd304dd70739060e9e0de509209036eabea14d0720cce" +checksum = "5df1b0fa6be58efe9d4ccc257df0a53b89cd8909e86591a13ca54817c87517be" dependencies = [ "aws-credential-types", "aws-smithy-http", @@ -1418,9 +1418,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.8" +version = "0.60.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" +checksum = "d9cd0ae3d97daa0a2bf377a4d8e8e1362cae590c4a1aad0d40058ebca18eb91e" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -1457,9 +1457,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.5.5" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d3965f6417a92a6d1009c5958a67042f57e46342afb37ca58f9ad26744ec73" +checksum = "3df4217d39fe940066174e6238310167bf466bfbebf3be0661e53cacccde6313" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -1471,6 +1471,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "http-body 1.0.0", + "httparse", "hyper 0.14.29", "hyper-rustls 0.24.2", "once_cell", @@ -1483,9 +1484,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b570ea39eb95bd32543f6e4032bce172cb6209b9bc8c83c770d08169e875afc" +checksum = "30819352ed0a04ecf6a2f3477e344d2d1ba33d43e0f09ad9047c12e0d923616f" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -1532,15 +1533,14 @@ dependencies = [ [[package]] name = "aws-types" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f734808d43702a67e57d478a12e227d4d038d0b90c9005a78c87890d3805922" +checksum = "5221b91b3e441e6675310829fd8984801b772cb1546ef6c0e54dec9f1ac13fef" dependencies = [ "aws-credential-types", "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "http 0.2.12", "rustc_version 0.4.0", "tracing", ] @@ -1587,7 +1587,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "itoa", "matchit", @@ -1735,12 +1735,12 @@ dependencies = [ "blake2s_simd", "byteorder", "cfg-if 1.0.0", - "crossbeam", + "crossbeam 0.7.3", "futures 0.3.30", "hex", "lazy_static", "num_cpus", - "pairing_ce 0.28.5 (registry+https://github.com/rust-lang/crates.io-index)", + "pairing_ce 0.28.6", "rand 0.4.6", "serde", "smallvec", @@ -1792,7 +1792,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -1821,9 +1821,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "arbitrary", "serde", @@ -1938,8 +1938,8 @@ dependencies = [ "bincode", "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", "const_format", - "convert_case", - "crossbeam", + "convert_case 0.6.0", + "crossbeam 0.8.4", "crypto-bigint 0.5.5", "cs_derive", "derivative", @@ -1979,7 +1979,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "syn_derive", ] @@ -2072,9 +2072,9 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" @@ -2254,18 +2254,18 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "castaway" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" dependencies = [ "rustversion", ] [[package]] name = "cc" -version = "1.0.99" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" dependencies = [ "jobserver", "libc", @@ -2334,7 +2334,7 @@ dependencies = [ "serde_json", "serial_test", "solang-parser", - "strum 0.26.2", + "strum 0.26.3", "tikv-jemallocator", "time", "tokio", @@ -2356,7 +2356,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2516,9 +2516,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -2526,9 +2526,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -2541,9 +2541,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.5" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2020fa13af48afc65a9a87335bda648309ab3d154cd03c7ff95b378c7ed39c4" +checksum = "1d598e88f6874d4b888ed40c71efbcbf4076f1dfbae128a08a8c9e45f710605d" dependencies = [ "clap", ] @@ -2560,14 +2560,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -2776,7 +2776,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" dependencies = [ "crossterm", - "strum 0.26.2", + "strum 0.26.3", "strum_macros 0.26.4", "unicode-width", ] @@ -2895,6 +2895,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -2996,6 +3005,19 @@ dependencies = [ "crossbeam-utils 0.7.2", ] +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel 0.5.13", + "crossbeam-deque 0.8.5", + "crossbeam-epoch 0.9.18", + "crossbeam-queue 0.3.11", + "crossbeam-utils 0.8.20", +] + [[package]] name = "crossbeam-channel" version = "0.4.4" @@ -3103,7 +3125,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "crossterm_winapi", "libc", "mio", @@ -3216,7 +3238,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3240,7 +3262,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3251,7 +3273,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3291,7 +3313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -3343,7 +3365,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3364,7 +3386,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3374,7 +3396,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3383,11 +3405,11 @@ version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3407,7 +3429,7 @@ checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "unicode-xid", ] @@ -3509,13 +3531,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -3607,9 +3629,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] @@ -3744,7 +3766,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -4069,7 +4091,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.66", + "syn 2.0.68", "toml 0.8.14", "walkdir", ] @@ -4087,7 +4109,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -4112,8 +4134,8 @@ dependencies = [ "rlp", "serde", "serde_json", - "strum 0.26.2", - "syn 2.0.66", + "strum 0.26.3", + "syn 2.0.68", "tempfile", "thiserror", "tiny-keccak 2.0.2", @@ -4290,9 +4312,9 @@ dependencies = [ [[package]] name = "evmole" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bdec28a767d874dd74270c882fb0aa31730af9138d41810fc63b8e7e49f6ddd" +checksum = "ce047d502545e3a726948bb8a532b8ea1446238f829e01448c802b2f10edbe70" dependencies = [ "ruint", ] @@ -4581,7 +4603,7 @@ dependencies = [ "futures 0.3.30", "globset", "humantime-serde", - "hyper 1.3.1", + "hyper 1.4.0", "indicatif", "itertools 0.13.0", "mockall", @@ -4603,7 +4625,7 @@ dependencies = [ "similar-asserts", "solang-parser", "soldeer", - "strum 0.26.2", + "strum 0.26.3", "svm-rs 0.5.4", "tempfile", "thiserror", @@ -4721,7 +4743,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -4743,6 +4765,7 @@ dependencies = [ "foundry-config", "foundry-evm", "foundry-test-utils", + "foundry-zksync-compiler", "futures 0.3.30", "itertools 0.13.0", "once_cell", @@ -4874,7 +4897,7 @@ dependencies = [ "regex", "serde", "strsim 0.10.0", - "strum 0.26.2", + "strum 0.26.3", "tempfile", "tokio", "tracing", @@ -4940,7 +4963,7 @@ dependencies = [ [[package]] name = "foundry-compilers" version = "0.8.0" -source = "git+https://github.com/Moonsong-Labs/compilers?branch=zksync-v0.8.0#d2e5d2720b36b23467f226d5a38e1d950994980d" +source = "git+https://github.com/Moonsong-Labs/compilers?branch=zksync-v0.8.0#2aa7b80c17e7aad4e1b1f0d74bf80e5bd1d61a3e" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -5271,7 +5294,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -5348,8 +5371,14 @@ version = "0.0.2" dependencies = [ "alloy-consensus", "alloy-dyn-abi", + "alloy-network", "alloy-primitives", + "alloy-provider", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", "alloy-sol-types", + "alloy-transport", "ansi_term", "const-hex", "era_test_node", @@ -5525,7 +5554,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -5601,9 +5630,9 @@ dependencies = [ [[package]] name = "gcloud-sdk" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa57d45d9a9778e0bf38deb6a4c9dbe293fa021d0b70b126b5dc593979b08569" +checksum = "1afe2a62202f8f8eb624638f7e5b8f0988a540dd8dbb69e098daeb277273b2ab" dependencies = [ "async-trait", "chrono", @@ -5710,7 +5739,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr 1.9.1", "gix-path", "libc", @@ -5756,7 +5785,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07c98204529ac3f24b34754540a852593d2a4c7349008df389240266627a72a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr 1.9.1", "gix-features", "gix-path", @@ -5841,7 +5870,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gix-path", "libc", "windows", @@ -6151,7 +6180,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -6270,9 +6299,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ "bytes", "futures-channel", @@ -6312,10 +6341,10 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "rustls 0.23.10", - "rustls-native-certs 0.7.0", + "rustls-native-certs 0.7.1", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -6356,7 +6385,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "native-tls", "tokio", @@ -6366,16 +6395,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.1", + "hyper 1.4.0", "pin-project-lite", "socket2", "tokio", @@ -6407,124 +6436,6 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -6533,14 +6444,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -6958,7 +6867,7 @@ dependencies = [ "http 0.2.12", "jsonrpsee-core", "pin-project 1.1.5", - "rustls-native-certs 0.7.0", + "rustls-native-certs 0.7.1", "rustls-pki-types", "soketto", "thiserror", @@ -7217,11 +7126,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] @@ -7248,12 +7157,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -7268,7 +7177,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -7339,7 +7248,7 @@ checksum = "f8dccda732e04fa3baf2e17cf835bfe2601c7c2edafd64417c627dabae3a8cda" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7348,12 +7257,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -7372,9 +7275,9 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logos" @@ -7396,7 +7299,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7580,7 +7483,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7591,9 +7494,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -7665,7 +7568,7 @@ dependencies = [ "cfg-if 1.0.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7766,7 +7669,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if 1.0.0", "cfg_aliases 0.1.1", "libc", @@ -7841,9 +7744,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -7982,7 +7885,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -7994,7 +7897,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8106,7 +8009,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if 1.0.0", "foreign-types", "libc", @@ -8123,7 +8026,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8326,8 +8229,7 @@ dependencies = [ [[package]] name = "pairing_ce" version = "0.28.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db007b21259660d025918e653508f03050bf23fb96a88601f9936329faadc597" +source = "git+https://github.com/matter-labs/pairing.git?rev=d24f2c5871089c4cd4f54c0ca266bb9fef6115eb#d24f2c5871089c4cd4f54c0ca266bb9fef6115eb" dependencies = [ "byteorder", "cfg-if 1.0.0", @@ -8339,7 +8241,7 @@ dependencies = [ [[package]] name = "pairing_ce" version = "0.28.5" -source = "git+https://github.com/matter-labs/pairing.git?rev=d24f2c5871089c4cd4f54c0ca266bb9fef6115eb#d24f2c5871089c4cd4f54c0ca266bb9fef6115eb" +source = "git+https://github.com/matter-labs/pairing.git#d24f2c5871089c4cd4f54c0ca266bb9fef6115eb" dependencies = [ "byteorder", "cfg-if 1.0.0", @@ -8350,8 +8252,9 @@ dependencies = [ [[package]] name = "pairing_ce" -version = "0.28.5" -source = "git+https://github.com/matter-labs/pairing.git#d24f2c5871089c4cd4f54c0ca266bb9fef6115eb" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843b5b6fb63f00460f611dbc87a50bbbb745f0dfe5cbf67ca89299c79098640e" dependencies = [ "byteorder", "cfg-if 1.0.0", @@ -8463,7 +8366,7 @@ dependencies = [ "libc", "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -8531,7 +8434,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8576,9 +8479,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -8587,9 +8490,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -8597,22 +8500,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -8689,7 +8592,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8747,7 +8650,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8884,7 +8787,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -8986,9 +8889,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -9001,7 +8904,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "version_check", "yansi 1.0.1", ] @@ -9037,18 +8940,18 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -9108,7 +9011,7 @@ dependencies = [ "prost 0.12.6", "prost-types", "regex", - "syn 2.0.66", + "syn 2.0.68", "tempfile", ] @@ -9135,7 +9038,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -9236,7 +9139,7 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "unicase", ] @@ -9247,7 +9150,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "pulldown-cmark-escape", "unicase", @@ -9475,7 +9378,7 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f44c9e68fd46eda15c646fbb85e1040b657a58cdc8c98db1d97a55930d991eef" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cassowary", "compact_str", "crossterm", @@ -9483,7 +9386,7 @@ dependencies = [ "lru", "paste", "stability", - "strum 0.26.2", + "strum 0.26.3", "unicode-segmentation", "unicode-truncate", "unicode-width", @@ -9548,7 +9451,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -9684,7 +9587,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-rustls 0.27.2", "hyper-tls 0.6.0", "hyper-util", @@ -9699,7 +9602,7 @@ dependencies = [ "pin-project-lite", "quinn", "rustls 0.23.10", - "rustls-native-certs 0.7.0", + "rustls-native-certs 0.7.1", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", @@ -9783,7 +9686,7 @@ source = "git+https://github.com/bluealloy/revm.git?rev=41e2f7f#41e2f7f9740c0fb7 dependencies = [ "alloy-primitives", "auto_impl", - "bitflags 2.5.0", + "bitflags 2.6.0", "bitvec 1.0.1", "c-kzg", "cfg-if 1.0.0", @@ -9871,7 +9774,7 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -10063,7 +9966,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -10091,7 +9994,7 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.5", "subtle", "zeroize", ] @@ -10105,7 +10008,7 @@ dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.5", "subtle", "zeroize", ] @@ -10124,9 +10027,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", "rustls-pemfile 2.1.2", @@ -10172,9 +10075,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -10205,7 +10108,7 @@ version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "994eca4bca05c87e86e15d90fc7a91d1be64b4482b38cb2d27474568fe7c9db9" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if 1.0.0", "clipboard-win", "fd-lock 3.0.13", @@ -10272,9 +10175,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" +checksum = "af947d0ca10a2f3e00c7ec1b515b7c83e5cb3fa62d4c11a64301d9eec54440e9" dependencies = [ "sdd", ] @@ -10309,7 +10212,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -10445,7 +10348,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -10606,7 +10509,7 @@ dependencies = [ "thiserror", "time", "url", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -10642,7 +10545,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -10653,14 +10556,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "indexmap 2.2.6", "itoa", @@ -10696,7 +10599,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -10755,7 +10658,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -11081,9 +10984,9 @@ dependencies = [ [[package]] name = "soldeer" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdc15c518ac6bcdc09565cfcda5d0926c65dd2153fea83fcaf1cd536b0d26f7" +checksum = "ef46372c17d5650cb18b7f374c45732334fa0867de6c7f14c1fc6973559cd3ff" dependencies = [ "chrono", "clap", @@ -11101,9 +11004,10 @@ dependencies = [ "tokio", "toml 0.8.14", "toml_edit 0.22.14", - "uuid 1.8.0", + "uuid 1.9.1", "walkdir", "yansi 1.0.1", + "yash-fnmatch", "zip 2.1.3", "zip-extract", ] @@ -11258,7 +11162,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "bytes", "chrono", @@ -11303,7 +11207,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "chrono", "crc", @@ -11363,12 +11267,12 @@ dependencies = [ [[package]] name = "stability" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" +checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" dependencies = [ "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -11449,9 +11353,9 @@ dependencies = [ [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros 0.26.4", ] @@ -11479,7 +11383,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -11497,9 +11401,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "svm-rs" @@ -11567,9 +11471,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -11585,7 +11489,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -11597,7 +11501,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -11612,17 +11516,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -11745,7 +11638,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -11838,16 +11731,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -11860,9 +11743,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "ce6b6a2fb3a985e99cebfaefa9faa3024743da73304ca1c683a36429613d3d22" dependencies = [ "tinyvec_macros", ] @@ -11910,7 +11793,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -12162,7 +12045,7 @@ dependencies = [ "percent-encoding", "pin-project 1.1.5", "prost 0.12.6", - "rustls-native-certs 0.7.0", + "rustls-native-certs 0.7.1", "rustls-pemfile 2.1.2", "rustls-pki-types", "tokio", @@ -12206,7 +12089,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bytes", "futures-util", "http 1.1.0", @@ -12269,7 +12152,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -12625,9 +12508,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -12647,18 +12530,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -12677,9 +12548,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" dependencies = [ "getrandom 0.2.15", "serde", @@ -12735,7 +12606,7 @@ source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -12828,7 +12699,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-shared", ] @@ -12862,7 +12733,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -13033,7 +12904,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -13060,7 +12931,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -13095,18 +12966,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -13123,9 +12994,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -13141,9 +13012,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -13159,15 +13030,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -13183,9 +13054,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -13201,9 +13072,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -13219,9 +13090,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -13237,9 +13108,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -13279,18 +13150,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -13347,68 +13206,34 @@ dependencies = [ ] [[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" +name = "yash-fnmatch" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "697c20b479d2e6419e9a073bfdd20e90cbd8540d6c683ee46712e13de650e54f" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure", + "regex", + "regex-syntax 0.8.4", + "thiserror", ] [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", - "synstructure", + "syn 2.0.68", ] [[package]] @@ -13428,29 +13253,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] @@ -13705,7 +13508,7 @@ name = "zkevm_opcode_defs" version = "1.3.2" source = "git+https://github.com/matter-labs/era-zkevm_opcode_defs.git?branch=v1.3.2#dffacadeccdfdbff4bc124d44c595c4a6eae5013" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "blake2 0.10.6 (git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e)", "ethereum-types 0.14.1", "k256 0.11.6", @@ -13719,7 +13522,7 @@ name = "zkevm_opcode_defs" version = "1.4.1" source = "git+https://github.com/matter-labs/era-zkevm_opcode_defs.git?branch=v1.4.1#ba8228ff0582d21f64d6a319d50d0aec48e9e7b6" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.14.1", "k256 0.13.3", @@ -13733,7 +13536,7 @@ name = "zkevm_opcode_defs" version = "1.5.0" source = "git+https://github.com/matter-labs/era-zkevm_opcode_defs.git?branch=v1.5.0#28d2edabf902ea9b08f6a26a4506831fd89346b9" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.14.1", "k256 0.13.3", @@ -14084,7 +13887,7 @@ dependencies = [ "prost-reflect", "protox", "quote", - "syn 2.0.66", + "syn 2.0.68", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 7148d1d9f..98fe087f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -313,3 +313,11 @@ revm-primitives = { git = "https://github.com/bluealloy/revm.git", rev = "41e2f7 # [patch."https://github.com/matter-labs/era-boojum"] # cs_derive = { git = "https://github.com/nbaztec/era-boojum", branch = "foundry-fix" } # boojum = { git = "https://github.com/nbaztec/era-boojum", branch = "foundry-fix" } + +# [patch."https://github.com/moonsong-labs/compilers"] +# foundry-compilers = { path = "../msl-compilers/crates/compilers" } +# foundry-compilers-core = { path = "../msl-compilers/crates/core" } +# foundry-compilers-artifacts-vyper = { path = "../msl-compilers/crates/artifacts/vyper" } +# foundry-compilers-artifacts-solc = { path = "../msl-compilers/crates/artifacts/solc" } +# foundry-compilers-artifacts-zksolc = { path = "../msl-compilers/crates/artifacts/zksolc" } +# foundry-compilers-artifacts = { path = "../msl-compilers/crates/artifacts/artifacts" } \ No newline at end of file diff --git a/crates/cheatcodes/src/inspector.rs b/crates/cheatcodes/src/inspector.rs index 706181d47..280f754e7 100644 --- a/crates/cheatcodes/src/inspector.rs +++ b/crates/cheatcodes/src/inspector.rs @@ -516,7 +516,7 @@ impl Cheatcodes { tracing::trace!(?address, "ignoring code translation for test contract"); } else { account.info.code_hash = code_hash; - account.info.code = code.clone(); + account.info.code.clone_from(&code); } } } @@ -624,7 +624,7 @@ impl Cheatcodes { tracing::trace!(?address, "ignoring code translation for test contract"); } else { account.info.code_hash = info.code_hash; - account.info.code = info.code.clone(); + account.info.code.clone_from(&info.code); } } } @@ -1407,7 +1407,7 @@ impl Inspector for Cheatcodes { persisted_factory_deps: Some(&mut self.persisted_factory_deps), }; if let Ok(result) = foundry_zksync_core::vm::call::<_, DatabaseError>(call, ecx, ccx) { - self.combined_logs.extend(result.logs.clone().into_iter().map(|log| Some(log))); + self.combined_logs.extend(result.logs.clone().into_iter().map(Some)); //for each log in cloned logs call handle_expect_emit if !self.expected_emits.is_empty() { for log in result.logs { @@ -1788,7 +1788,7 @@ impl Inspector for Cheatcodes { let mut nonce = account.info.nonce; let mut call_init_code = call.init_code.clone(); - let mut zk_tx = if self.use_zk_vm { + let zk_tx = if self.use_zk_vm { to = Some(TxKind::Call(CONTRACT_DEPLOYER_ADDRESS.to_address())); nonce = foundry_zksync_core::nonce(broadcast.new_origin, ecx) as u64; let contract = self @@ -1810,39 +1810,13 @@ impl Inspector for Cheatcodes { ); call_init_code = Bytes::from(create_input); - Some(factory_deps) + Some(ZkTransactionMetadata { factory_deps }) } else { None }; - let rpc = ecx.db.active_fork_url(); - if let Some(factory_deps) = zk_tx { - let mut batched = - foundry_zksync_core::vm::batch_factory_dependencies(factory_deps); - debug!(batches = batched.len(), "splitting factory deps for broadcast"); - // the last batch is the final one that does the deployment - zk_tx = batched.pop(); - - for factory_deps in batched { - self.broadcastable_transactions.push_back(BroadcastableTransaction { - rpc: rpc.clone(), - transaction: TransactionRequest { - from: Some(broadcast.new_origin), - to: Some(TxKind::Call(Address::ZERO)), - value: Some(call.value), - nonce: Some(nonce), - ..Default::default() - }, - zk_tx: Some(ZkTransactionMetadata { factory_deps }), - }); - - //update nonce for each tx - nonce += 1; - } - } - self.broadcastable_transactions.push_back(BroadcastableTransaction { - rpc, + rpc: ecx.db.active_fork_url(), transaction: TransactionRequest { from: Some(broadcast.new_origin), to, @@ -1856,7 +1830,7 @@ impl Inspector for Cheatcodes { }, ..Default::default() }, - zk_tx: zk_tx.map(ZkTransactionMetadata::new), + zk_tx, }); let kind = match call.scheme { @@ -1924,7 +1898,7 @@ impl Inspector for Cheatcodes { ecx, ccx, ) { - self.combined_logs.extend(result.logs.clone().into_iter().map(|log| Some(log))); + self.combined_logs.extend(result.logs.clone().into_iter().map(Some)); // for each log in cloned logs call handle_expect_emit if !self.expected_emits.is_empty() { diff --git a/crates/cli/src/utils/cmd.rs b/crates/cli/src/utils/cmd.rs index 21e9acfda..29377213b 100644 --- a/crates/cli/src/utils/cmd.rs +++ b/crates/cli/src/utils/cmd.rs @@ -6,6 +6,7 @@ use foundry_compilers::{ artifacts::{CompactBytecode, CompactDeployedBytecode, Settings}, cache::{CacheEntry, CompilerCache}, utils::read_json_file, + zksync::artifact_output::zk::ZkContractArtifact, Artifact, ProjectCompileOutput, }; use foundry_config::{error::ExtractConfigError, figment::Figment, Chain, Config, NamedChain}; @@ -70,6 +71,35 @@ pub fn remove_contract( Ok((abi, bin, runtime)) } +/// Given a `Project`'s output, removes the matching ABI, Bytecode and +/// Runtime Bytecode of the given contract. +#[track_caller] +pub fn remove_zk_contract( + output: &mut foundry_compilers::zksync::compile::output::ProjectCompileOutput, + path: &Path, + name: &str, +) -> Result { + let contract = if let Some(contract) = output.remove(path.to_string_lossy(), name) { + contract + } else { + let mut err = format!("could not find artifact: `{name}`"); + if let Some(suggestion) = + super::did_you_mean(name, output.artifacts().map(|(name, _)| name)).pop() + { + if suggestion != name { + err = format!( + r#"{err} + + Did you mean `{suggestion}`?"# + ); + } + } + eyre::bail!(err) + }; + + Ok(contract) +} + /// Helper function for finding a contract by ContractName // TODO: Is there a better / more ergonomic way to get the artifacts given a project and a // contract name? diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index bccc9d5d0..a9d421467 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -39,7 +39,7 @@ alloy-rpc-client.workspace = true alloy-rpc-types = { workspace = true, features = ["eth"] } alloy-rpc-types-engine.workspace = true alloy-serde.workspace = true -alloy-sol-types.workspace = true +alloy-sol-types = { workspace = true, features = ["json"] } alloy-transport-http = { workspace = true, features = [ "reqwest", "reqwest-rustls-tls", diff --git a/crates/evm/core/src/backend/fork_type.rs b/crates/evm/core/src/backend/fork_type.rs index 60ca7992f..f559adb9e 100644 --- a/crates/evm/core/src/backend/fork_type.rs +++ b/crates/evm/core/src/backend/fork_type.rs @@ -12,12 +12,12 @@ pub enum ForkType { impl ForkType { /// Returns true if type is [ForkType::Zk] pub fn is_zk(&self) -> bool { - matches!(self, ForkType::Zk) + matches!(self, Self::Zk) } /// Returns true if type is [ForkType::Evm] pub fn is_evm(&self) -> bool { - matches!(self, ForkType::Evm) + matches!(self, Self::Evm) } } diff --git a/crates/evm/evm/src/executors/invariant/replay.rs b/crates/evm/evm/src/executors/invariant/replay.rs index cf9fa12e8..ef4194019 100644 --- a/crates/evm/evm/src/executors/invariant/replay.rs +++ b/crates/evm/evm/src/executors/invariant/replay.rs @@ -17,7 +17,7 @@ use indicatif::ProgressBar; use parking_lot::RwLock; use proptest::test_runner::TestError; use revm::primitives::U256; -use std::sync::Arc; +use std::{collections::HashMap, sync::Arc}; /// Replays a call sequence for collecting logs and traces. /// Returns counterexample to be used when the call sequence is a failed scenario. @@ -57,7 +57,11 @@ pub fn replay_run( } // Identify newly generated contracts, if they exist. - ided_contracts.extend(load_contracts(call_result.traces.as_slice(), known_contracts)); + ided_contracts.extend(load_contracts( + call_result.traces.as_slice(), + known_contracts, + &HashMap::new(), + )); // Create counter example to be used in failed case. counterexample_sequence.push(BaseCounterExample::from_invariant_call( diff --git a/crates/evm/evm/src/executors/mod.rs b/crates/evm/evm/src/executors/mod.rs index 43123e94e..ccf5f9168 100644 --- a/crates/evm/evm/src/executors/mod.rs +++ b/crates/evm/evm/src/executors/mod.rs @@ -401,7 +401,7 @@ impl Executor { pub fn transact_with_env(&mut self, mut env: EnvWithHandlerCfg) -> eyre::Result { let mut inspector = self.inspector.clone(); let backend = &mut self.backend; - let result = match self.zk_tx.take() { + let result_and_state = match self.zk_tx.take() { None => backend.inspect(&mut env, &mut inspector)?, Some(zk_tx) => backend.inspect_ref_zk( &mut env, @@ -411,9 +411,24 @@ impl Executor { Some(zk_tx.factory_deps), )?, }; + let mut result = convert_executed_result( + env, + inspector, + result_and_state.clone(), + backend.has_snapshot_failure(), + )?; + let state = result_and_state.state.clone(); + if let Some(traces) = &mut result.traces { + for trace_node in traces.nodes() { + if let Some(account_info) = state.get(&trace_node.trace.address) { + result.deployments.insert( + trace_node.trace.address, + account_info.info.code.clone().unwrap_or_default().bytes(), + ); + } + } + } - let mut result = - convert_executed_result(env, inspector, result, backend.has_snapshot_failure())?; self.commit(&mut result); Ok(result) } @@ -724,11 +739,14 @@ pub struct RawCallResult { pub out: Option, /// The chisel state pub chisel_state: Option<(Vec, Vec, InstructionResult)>, + /// The deployments generated during the call + pub deployments: HashMap, } impl Default for RawCallResult { fn default() -> Self { Self { + deployments: HashMap::new(), exit_reason: InstructionResult::Continue, reverted: false, has_snapshot_failure: false, @@ -886,6 +904,7 @@ fn convert_executed_result( }; Ok(RawCallResult { + deployments: HashMap::new(), exit_reason, reverted: !matches!(exit_reason, return_ok!()), has_snapshot_failure, diff --git a/crates/evm/fuzz/src/strategies/calldata.rs b/crates/evm/fuzz/src/strategies/calldata.rs index a23070403..5697be1f6 100644 --- a/crates/evm/fuzz/src/strategies/calldata.rs +++ b/crates/evm/fuzz/src/strategies/calldata.rs @@ -86,7 +86,7 @@ mod tests { ); let expected = function.abi_encode_input(&[address_fixture]).unwrap(); - let strategy = fuzz_calldata(function, &FuzzFixtures::new(fixtures)); + let strategy = fuzz_calldata(function, &FuzzFixtures::new(fixtures), false); let _ = strategy.prop_map(move |fuzzed| { assert_eq!(expected, fuzzed); }); diff --git a/crates/evm/fuzz/src/strategies/param.rs b/crates/evm/fuzz/src/strategies/param.rs index bc2c1d850..ab1fe8c5b 100644 --- a/crates/evm/fuzz/src/strategies/param.rs +++ b/crates/evm/fuzz/src/strategies/param.rs @@ -70,7 +70,18 @@ fn fuzz_param_inner( }; match *param { - DynSolType::Address => value(), + DynSolType::Address => value() + .prop_map(move |value| match value.as_address() { + Some(addr) => { + if no_zksync_reserved_addresses { + DynSolValue::Address(foundry_zksync_core::to_safe_address(addr)) + } else { + DynSolValue::Address(addr) + } + } + None => value, + }) + .boxed(), DynSolType::Int(n @ 8..=256) => super::IntStrategy::new(n, fuzz_fixtures) .prop_map(move |x| DynSolValue::Int(x, n)) .boxed(), @@ -139,7 +150,7 @@ pub fn fuzz_param_from_state( match *param { DynSolType::Address => value() .prop_map(move |value| { - let addr = Address::from_word(value.into()); + let addr = Address::from_word(value); if no_zksync_reserved_addresses { DynSolValue::Address(foundry_zksync_core::to_safe_address(addr)) } else { diff --git a/crates/evm/traces/src/decoder/mod.rs b/crates/evm/traces/src/decoder/mod.rs index 1c8bd0189..1985fc2cd 100644 --- a/crates/evm/traces/src/decoder/mod.rs +++ b/crates/evm/traces/src/decoder/mod.rs @@ -240,10 +240,9 @@ impl CallTraceDecoder { .nodes() .iter() .map(|node| { - ( - &node.trace.address, - node.trace.kind.is_any_create().then_some(&node.trace.output[..]), - ) + let address = &node.trace.address; + let output = node.trace.kind.is_any_create().then_some(&node.trace.output[..]); + (address, output) }) .filter(|&(address, _)| { !self.labels.contains_key(address) || !self.contracts.contains_key(address) diff --git a/crates/evm/traces/src/identifier/local.rs b/crates/evm/traces/src/identifier/local.rs index 04680b01a..d21022d96 100644 --- a/crates/evm/traces/src/identifier/local.rs +++ b/crates/evm/traces/src/identifier/local.rs @@ -1,9 +1,9 @@ use super::{AddressIdentity, TraceIdentifier}; use alloy_json_abi::JsonAbi; -use alloy_primitives::Address; +use alloy_primitives::{Address, Bytes}; use foundry_common::contracts::{bytecode_diff_score, ContractsByArtifact}; use foundry_compilers::ArtifactId; -use std::borrow::Cow; +use std::{borrow::Cow, collections::HashMap}; /// A trace identifier that tries to identify addresses using local contracts. pub struct LocalTraceIdentifier<'a> { @@ -11,6 +11,8 @@ pub struct LocalTraceIdentifier<'a> { known_contracts: &'a ContractsByArtifact, /// Vector of pairs of artifact ID and the runtime code length of the given artifact. ordered_ids: Vec<(&'a ArtifactId, usize)>, + /// Deployments generated during the setup + pub deployments: HashMap, } impl<'a> LocalTraceIdentifier<'a> { @@ -23,7 +25,7 @@ impl<'a> LocalTraceIdentifier<'a> { .map(|(id, bytecode)| (id, bytecode.len())) .collect::>(); ordered_ids.sort_by_key(|(_, len)| *len); - Self { known_contracts, ordered_ids } + Self { known_contracts, ordered_ids, deployments: HashMap::new() } } /// Returns the known contracts. @@ -116,9 +118,10 @@ impl TraceIdentifier for LocalTraceIdentifier<'_> { addresses .filter_map(|(address, code)| { let _span = trace_span!(target: "evm::traces", "identify", %address).entered(); - trace!(target: "evm::traces", "identifying"); - let (id, abi) = self.identify_code(code?)?; + let (id, abi) = self.identify_code(code?).or_else(|| { + self.deployments.get(address).and_then(|bytes| self.identify_code(bytes)) + })?; trace!(target: "evm::traces", id=%id.identifier(), "identified"); Some(AddressIdentity { diff --git a/crates/evm/traces/src/lib.rs b/crates/evm/traces/src/lib.rs index d352abfc8..1eb2af762 100644 --- a/crates/evm/traces/src/lib.rs +++ b/crates/evm/traces/src/lib.rs @@ -8,12 +8,12 @@ #[macro_use] extern crate tracing; -use alloy_primitives::LogData; +use alloy_primitives::{Address, Bytes, LogData}; use foundry_common::contracts::{ContractsByAddress, ContractsByArtifact}; use foundry_evm_core::constants::CHEATCODE_ADDRESS; use futures::{future::BoxFuture, FutureExt}; use serde::{Deserialize, Serialize}; -use std::fmt::Write; +use std::{collections::HashMap, fmt::Write}; use yansi::{Color, Paint}; /// Call trace address identifiers. @@ -298,13 +298,19 @@ fn trace_color(trace: &CallTrace) -> Color { pub fn load_contracts<'a>( traces: impl IntoIterator, known_contracts: &ContractsByArtifact, + deployments: &HashMap, ) -> ContractsByAddress { let mut local_identifier = LocalTraceIdentifier::new(known_contracts); + local_identifier.deployments.clone_from(deployments); let decoder = CallTraceDecoder::new(); let mut contracts = ContractsByAddress::new(); for trace in traces { - for address in local_identifier.identify_addresses(decoder.trace_addresses(trace)) { - if let (Some(contract), Some(abi)) = (address.contract, address.abi) { + let identified_addresses = + local_identifier.identify_addresses(decoder.trace_addresses(trace)); + for address in identified_addresses { + let contract = address.contract; + let abi = address.abi; + if let (Some(contract), Some(abi)) = (contract, abi) { contracts.insert(address.address, (contract, abi.into_owned())); } } diff --git a/crates/forge/bin/cmd/coverage.rs b/crates/forge/bin/cmd/coverage.rs index c8606054f..cfea25043 100644 --- a/crates/forge/bin/cmd/coverage.rs +++ b/crates/forge/bin/cmd/coverage.rs @@ -244,7 +244,7 @@ impl CoverageArgs { ..Default::default() }) .set_coverage(true) - .build(&root, output, env, evm_opts, DualCompiledContracts::default(), false)?; + .build(&root, output, None, env, evm_opts, DualCompiledContracts::default())?; let known_contracts = runner.known_contracts.clone(); diff --git a/crates/forge/bin/cmd/create.rs b/crates/forge/bin/cmd/create.rs index 62740cce9..5690b3d1b 100644 --- a/crates/forge/bin/cmd/create.rs +++ b/crates/forge/bin/cmd/create.rs @@ -13,15 +13,28 @@ use eyre::{Context, Result}; use forge_verify::RetryArgs; use foundry_cli::{ opts::{CoreBuildArgs, EthereumOpts, EtherscanOpts, TransactionOpts}, - utils::{self, read_constructor_args_file, remove_contract, LoadConfig}, + utils::{self, read_constructor_args_file, remove_contract, remove_zk_contract, LoadConfig}, }; use foundry_common::{ - compile::{self}, + compile::{self, ProjectCompiler}, fmt::parse_tokens, }; -use foundry_compilers::{artifacts::BytecodeObject, info::ContractInfo, utils::canonicalize}; +use foundry_compilers::{ + artifacts::BytecodeObject, info::ContractInfo, utils::canonicalize, + zksync::artifact_output::zk::ZkContractArtifact, +}; +use foundry_wallets::WalletSigner; +use foundry_zksync_core::convert::ConvertH160; use serde_json::json; -use std::{borrow::Borrow, marker::PhantomData, path::PathBuf, sync::Arc}; +use std::{ + borrow::Borrow, + collections::{HashSet, VecDeque}, + marker::PhantomData, + path::PathBuf, + str::FromStr, + sync::Arc, +}; +use zksync_types::H256; /// CLI arguments for `forge create`. #[derive(Clone, Debug, Parser)] @@ -43,6 +56,7 @@ pub struct CreateArgs { long, value_hint = ValueHint::FilePath, value_name = "PATH", + conflicts_with = "constructor_args", )] constructor_args_path: Option, @@ -81,11 +95,161 @@ pub struct CreateArgs { retry: RetryArgs, } +/// Data used to deploy a contract on zksync +pub struct ZkSyncData { + bytecode: Vec, + bytecode_hash: H256, + factory_deps: Vec>, +} + impl CreateArgs { /// Executes the command to create a contract pub async fn run(mut self) -> Result<()> { // Find Project & Compile let project = self.opts.project()?; + let zksync = self.opts.compiler.zk.enabled(); + if zksync { + let target_path = if let Some(ref mut path) = self.contract.path { + canonicalize(project.root().join(path))? + } else { + project.find_contract_path(&self.contract.name)? + }; + + let config = self.opts.try_load_config_emit_warnings()?; + let zk_project = foundry_zksync_compiler::create_project(&config, config.cache, false)?; + let zk_compiler = ProjectCompiler::new().quiet(self.json || self.opts.silent); + let mut zk_output = + zk_compiler.zksync_compile(&zk_project, config.zksync.avoid_contracts())?; + + let artifact = remove_zk_contract(&mut zk_output, &target_path, &self.contract.name)?; + + let ZkContractArtifact { bytecode, hash, factory_dependencies, metadata, .. } = + artifact; + + // Get abi from solc_metadata + // TODO: This can probably be optimized by defining the proper + // deserializers on compilers but metadata is given as a stringified json + // and JsonAbi is complaining about not supporting serde_json::from_reader + // so there is some serde handling needed + let metadata = metadata.unwrap(); + let solc_metadata_value = metadata + .get("solc_metadata") + .and_then(serde_json::Value::as_str) + .expect("`solc_metadata` field not found in artifact"); + let solc_metadata_json: serde_json::Value = + serde_json::from_str(solc_metadata_value).unwrap(); + let abi_json = &solc_metadata_json["output"]["abi"]; + let abi_string = abi_json.to_string(); + let abi: JsonAbi = JsonAbi::from_json_str(&abi_string)?; + + let bin = bytecode.expect("Bytecode not found"); + let bytecode_hash = H256::from_str(&hash.expect("Contract hash not found"))?; + let bytecode = bin.object.clone().into_bytes().unwrap().to_vec(); + + // Add arguments to constructor + let config = self.eth.try_load_config_emit_warnings()?; + let provider = utils::get_provider(&config)?; + let params = match abi.constructor { + Some(ref v) => { + let constructor_args = + if let Some(ref constructor_args_path) = self.constructor_args_path { + read_constructor_args_file(constructor_args_path.to_path_buf())? + } else { + self.constructor_args.clone() + }; + self.parse_constructor_args(v, &constructor_args)? + } + None => vec![], + }; + + // respect chain, if set explicitly via cmd args + let chain_id = if let Some(chain_id) = self.chain_id() { + chain_id + } else { + provider.get_chain_id().await? + }; + + let factory_deps: Vec> = { + let factory_dependencies_map = + factory_dependencies.expect("factory deps not found"); + let mut visited_paths = HashSet::new(); + let mut visited_bytecodes = HashSet::new(); + let mut queue = VecDeque::new(); + + for dep in factory_dependencies_map.values() { + queue.push_back(dep.clone()); + } + + while let Some(dep_info) = queue.pop_front() { + if visited_paths.insert(dep_info.clone()) { + let mut split = dep_info.split(':'); + let contract_path = split + .next() + .expect("Failed to extract contract path for factory dependency"); + let contract_name = split + .next() + .expect("Failed to extract contract name for factory dependency"); + let mut abs_path_buf = PathBuf::new(); + abs_path_buf.push(project.root()); + abs_path_buf.push(contract_path); + let abs_path_str = abs_path_buf.to_string_lossy(); + let fdep_art = + zk_output.find(abs_path_str, contract_name).unwrap_or_else(|| { + panic!( + "Could not find contract {contract_name} at path {contract_path} for compilation output", + ) + }); + let fdep_fdeps_map = + fdep_art.factory_dependencies.clone().expect("factory deps not found"); + for dep in fdep_fdeps_map.values() { + queue.push_back(dep.clone()) + } + + let fdep_bytecode = fdep_art + .bytecode + .clone() + .expect("Bytecode not found for factory dependency") + .object + .clone() + .into_bytes() + .unwrap() + .to_vec(); + visited_bytecodes.insert(fdep_bytecode); + } + } + visited_bytecodes.insert(bytecode.clone()); + visited_bytecodes.into_iter().collect() + }; + let zk_data = ZkSyncData { bytecode, bytecode_hash, factory_deps }; + + let result = if self.unlocked { + // Deploy with unlocked account + let sender = self.eth.wallet.from.expect("required"); + self.deploy_zk(abi, bin.object, params, provider, chain_id, sender, zk_data, None) + .await + } else { + // Deploy with signer + let signer = self.eth.wallet.signer().await?; + let zk_signer = self.eth.wallet.signer().await?; + let deployer = signer.address(); + let provider = ProviderBuilder::<_, _, AnyNetwork>::default() + .wallet(EthereumWallet::new(signer)) + .on_provider(provider); + self.deploy_zk( + abi, + bin.object, + params, + provider, + chain_id, + deployer, + zk_data, + Some(zk_signer), + ) + .await + }; + + return result; + } let target_path = if let Some(ref mut path) = self.contract.path { canonicalize(project.root().join(path))? @@ -192,6 +356,7 @@ impl CreateArgs { evm_version: self.opts.compiler.evm_version, show_standard_json_input: self.show_standard_json_input, guess_constructor_args: false, + zksync: self.opts.compiler.zk.enabled(), }; // Check config for Etherscan API Keys to avoid preflight check failing if no @@ -288,7 +453,7 @@ impl CreateArgs { .constructor() .ok_or_else(|| eyre::eyre!("could not find constructor"))? .abi_encode_input(&args)?; - constructor_args = Some(hex::encode(encoded_args)); + constructor_args = Some(hex::encode_prefixed(encoded_args)); } self.verify_preflight_check(constructor_args.clone(), chain).await?; @@ -340,6 +505,153 @@ impl CreateArgs { evm_version: self.opts.compiler.evm_version, show_standard_json_input: self.show_standard_json_input, guess_constructor_args: false, + zksync: self.opts.compiler.zk.enabled(), + }; + println!("Waiting for {} to detect contract deployment...", verify.verifier.verifier); + verify.run().await + } + + // Deploys the zk contract + #[allow(clippy::too_many_arguments)] + async fn deploy_zk, T: Transport + Clone>( + self, + abi: JsonAbi, + bin: BytecodeObject, + args: Vec, + provider: P, + chain: u64, + deployer_address: Address, + zk_data: ZkSyncData, + zk_signer: Option, + ) -> Result<()> { + let bin = bin.into_bytes().unwrap_or_else(|| { + panic!("no bytecode found in bin object for {}", self.contract.name) + }); + let provider = Arc::new(provider); + let factory = ContractFactory::new(abi.clone(), bin.clone(), provider.clone()); + + let is_args_empty = args.is_empty(); + let mut deployer = + factory.deploy_tokens_zk(args.clone(), &zk_data).context("failed to deploy contract") + .map(|deployer| deployer.set_zk_factory_deps(zk_data.factory_deps.clone())).map_err(|e| { + if is_args_empty { + e.wrap_err("no arguments provided for contract constructor; consider --constructor-args or --constructor-args-path") + } else { + e + } + })?; + + deployer.tx.set_from(deployer_address); + deployer.tx.set_chain_id(chain); + // `to` field must be set explicitly, cannot be None. + if deployer.tx.to.is_none() { + deployer.tx.set_create(); + } + deployer.tx.set_nonce(if let Some(nonce) = self.tx.nonce { + Ok(nonce.to()) + } else { + provider.get_transaction_count(deployer_address).await + }?); + + // set tx value if specified + if let Some(value) = self.tx.value { + deployer.tx.set_value(value); + } + + let gas_price = if let Some(gas_price) = self.tx.gas_price { + gas_price.to() + } else { + provider.get_gas_price().await? + }; + deployer.tx.set_gas_price(gas_price); + + let estimated_gas = foundry_zksync_core::estimate_gas( + &deployer.tx, + zk_data.factory_deps.clone(), + &provider, + ) + .await?; + + deployer.tx.set_gas_limit(if let Some(gas_limit) = self.tx.gas_limit { + gas_limit.to::() + } else { + estimated_gas.limit + }); + + let zk_constructor_args = match abi.constructor() { + None => Default::default(), + Some(constructor) => constructor.abi_encode_input(&args).unwrap_or_default(), + }; + let data = foundry_zksync_core::encode_create_params( + &forge::revm::primitives::CreateScheme::Create, + zk_data.bytecode_hash, + zk_constructor_args, + ); + let data = Bytes::from(data); + deployer.tx.set_input(data); + + deployer.tx.set_to(foundry_zksync_core::CONTRACT_DEPLOYER_ADDRESS.to_address()); + + let mut constructor_args = None; + if self.verify { + if !args.is_empty() { + let encoded_args = abi + .constructor() + .ok_or_else(|| eyre::eyre!("could not find constructor"))? + .abi_encode_input(&args)?; + constructor_args = Some(hex::encode(encoded_args)); + } + + self.verify_preflight_check(constructor_args.clone(), chain).await?; + } + + // Deploy the actual contract + let (deployed_contract, receipt) = deployer.send_with_receipt_zk(zk_signer).await?; + + let address = deployed_contract; + if self.json { + let output = json!({ + "deployer": deployer_address.to_string(), + "deployedTo": address.to_string(), + "transactionHash": receipt.transaction_hash + }); + println!("{output}"); + } else { + println!("Deployer: {deployer_address}"); + println!("Deployed to: {address}"); + println!("Transaction hash: {:?}", receipt.transaction_hash); + }; + + if !self.verify { + return Ok(()); + } + + println!("Starting contract verification..."); + + let num_of_optimizations = + if self.opts.compiler.optimize { self.opts.compiler.optimizer_runs } else { None }; + let verify = forge_verify::VerifyArgs { + address, + contract: Some(self.contract), + compiler_version: None, + constructor_args, + constructor_args_path: None, + num_of_optimizations, + etherscan: EtherscanOpts { key: self.eth.etherscan.key(), chain: Some(chain.into()) }, + rpc: Default::default(), + flatten: false, + force: false, + skip_is_verified_check: false, + watch: true, + retry: self.retry, + libraries: self.opts.libraries.clone(), + root: None, + verifier: self.verifier, + via_ir: self.opts.via_ir, + evm_version: self.opts.compiler.evm_version, + show_standard_json_input: self.show_standard_json_input, + guess_constructor_args: false, + zksync: true, }; println!("Waiting for {} to detect contract deployment...", verify.verifier.verifier); verify.run().await @@ -354,7 +666,9 @@ impl CreateArgs { constructor: &Constructor, constructor_args: &[String], ) -> Result> { - let mut params = Vec::with_capacity(constructor.inputs.len()); + let expected_params = constructor.inputs.len(); + + let mut params = Vec::with_capacity(expected_params); for (input, arg) in constructor.inputs.iter().zip(constructor_args) { // resolve the input type directly let ty = input @@ -362,6 +676,17 @@ impl CreateArgs { .wrap_err_with(|| format!("Could not resolve constructor arg: input={input}"))?; params.push((ty, arg)); } + + let actual_params = params.len(); + + if actual_params != expected_params { + tracing::warn!( + given = actual_params, + expected = expected_params, + "Constructor argument mismatch: expected {expected_params} arguments, but received {actual_params}. Ensure that the number of arguments provided matches the constructor definition." + ); + } + let params = params.iter().map(|(ty, arg)| (ty, arg.as_str())); parse_tokens(params).map_err(Into::into) } @@ -414,6 +739,7 @@ pub struct Deployer { abi: JsonAbi, client: B, confs: usize, + zk_factory_deps: Option>>, _p: PhantomData

, _t: PhantomData, } @@ -428,6 +754,7 @@ where abi: self.abi.clone(), client: self.client.clone(), confs: self.confs, + zk_factory_deps: self.zk_factory_deps.clone(), _p: PhantomData, _t: PhantomData, } @@ -440,6 +767,45 @@ where P: Provider, T: Transport + Clone, { + /// Set zksync's factory deps. + pub fn set_zk_factory_deps(mut self, deps: Vec>) -> Self { + self.zk_factory_deps = Some(deps); + self + } + + /// Broadcasts the zk contract deployment transaction and after waiting for it to + /// be sufficiently confirmed (default: 1), it returns a tuple with + /// the [`Contract`](crate::Contract) struct at the deployed contract's address + /// and the corresponding [`AnyReceipt`]. + pub async fn send_with_receipt_zk( + self, + signer: Option, + ) -> Result<(Address, AnyTransactionReceipt), ContractDeploymentError> { + let factory_deps = self.zk_factory_deps.unwrap_or_default(); + let tx = foundry_zksync_core::new_eip712_transaction( + self.tx, + factory_deps, + self.client.borrow(), + signer.expect("No signer was found"), + ) + .await + .map_err(|_| ContractDeploymentError::ContractNotDeployed)?; + + let receipt = self + .client + .borrow() + .send_raw_transaction(&tx) + .await? + .with_required_confirmations(self.confs as u64) + .get_receipt() + .await?; + + let address = + receipt.contract_address.ok_or(ContractDeploymentError::ContractNotDeployed)?; + + Ok((address, receipt)) + } + /// Broadcasts the contract deployment transaction and after waiting for it to /// be sufficiently confirmed (default: 1), it returns a tuple with /// the [`Contract`](crate::Contract) struct at the deployed contract's address @@ -567,6 +933,51 @@ where abi: self.abi, tx, confs: 1, + zk_factory_deps: None, + _p: PhantomData, + _t: PhantomData, + }) + } + + /// Create a deployment tx using the provided tokens as constructor + /// arguments + pub fn deploy_tokens_zk( + self, + params: Vec, + zk_data: &ZkSyncData, + ) -> Result, ContractDeploymentError> + where + B: Clone, + { + if self.abi.constructor().is_none() && !params.is_empty() { + return Err(ContractDeploymentError::ConstructorError) + } + + // Encode the constructor args & concatenate with the bytecode if necessary + let constructor_args = match self.abi.constructor() { + None => Default::default(), + Some(constructor) => constructor.abi_encode_input(¶ms).unwrap_or_default(), + }; + let data: Bytes = foundry_zksync_core::encode_create_params( + &forge::revm::primitives::CreateScheme::Create, + zk_data.bytecode_hash, + constructor_args, + ) + .into(); + + // create the tx object. + let tx = WithOtherFields::new( + TransactionRequest::default() + .to(foundry_zksync_core::CONTRACT_DEPLOYER_ADDRESS.to_address()) + .input(data.into()), + ); + + Ok(Deployer { + client: self.client.clone(), + abi: self.abi, + tx, + confs: 1, + zk_factory_deps: Some(vec![zk_data.bytecode.clone()]), _p: PhantomData, _t: PhantomData, }) diff --git a/crates/forge/bin/cmd/script/broadcast.rs b/crates/forge/bin/cmd/script/broadcast.rs index 9480e000d..f00e9467c 100644 --- a/crates/forge/bin/cmd/script/broadcast.rs +++ b/crates/forge/bin/cmd/script/broadcast.rs @@ -661,7 +661,7 @@ impl ScriptArgs { .nonce(legacy_or_1559.nonce().unwrap()) .gas_price(legacy_or_1559.gas_price().unwrap()) .max_fee_per_gas(legacy_or_1559.max_cost().unwrap()) - .data(legacy_or_1559.data().cloned().unwrap()) + .data(legacy_or_1559.data().cloned().unwrap_or_default()) .custom_data(custom_data); let gas_price = provider.get_gas_price().await?; diff --git a/crates/forge/bin/cmd/script/executor.rs b/crates/forge/bin/cmd/script/executor.rs index c89b78919..df9472e6e 100644 --- a/crates/forge/bin/cmd/script/executor.rs +++ b/crates/forge/bin/cmd/script/executor.rs @@ -106,7 +106,7 @@ impl ScriptArgs { contracts: &ContractsByArtifact, dual_compiled_contracts: Option, ) -> Result> { - trace!(target: "script", "executing onchain simulation"); + trace!(target: "script", ?transactions, "executing onchain simulation"); let runners = Arc::new( self.build_runners(script_config, dual_compiled_contracts) diff --git a/crates/forge/bin/cmd/test/mod.rs b/crates/forge/bin/cmd/test/mod.rs index ea60412c5..9429b9f7e 100644 --- a/crates/forge/bin/cmd/test/mod.rs +++ b/crates/forge/bin/cmd/test/mod.rs @@ -273,7 +273,7 @@ impl TestArgs { let output = compiler.compile(&project)?; - let dual_compiled_contracts = if config.zksync.should_compile() { + let (zk_output, dual_compiled_contracts) = if config.zksync.should_compile() { let zk_project = foundry_zksync_compiler::create_project(&config, config.cache, false)?; let sources_to_compile = @@ -284,9 +284,12 @@ impl TestArgs { let zk_output = zk_compiler.zksync_compile(&zk_project, config.zksync.avoid_contracts())?; - Some(DualCompiledContracts::new(&output, &zk_output, &project.paths)) + let dual_compiled_contracts = + DualCompiledContracts::new(&output, &zk_output, &project.paths); + + (Some(zk_output), Some(dual_compiled_contracts)) } else { - None + (None, None) }; // Create test options from general project settings and compiler output. @@ -327,10 +330,10 @@ impl TestArgs { .build( project_root, output, + zk_output, env, evm_opts, dual_compiled_contracts.unwrap_or_default(), - config.zksync.run_in_zk_mode(), )?; if let Some(debug_test_pattern) = &self.debug { diff --git a/crates/forge/src/multi_runner.rs b/crates/forge/src/multi_runner.rs index ca47e87de..b4fa3d680 100644 --- a/crates/forge/src/multi_runner.rs +++ b/crates/forge/src/multi_runner.rs @@ -9,7 +9,10 @@ use alloy_primitives::{Address, Bytes, U256}; use eyre::Result; use foundry_common::{get_contract_name, ContractsByArtifact, TestFunctionExt}; use foundry_compilers::{ - artifacts::Libraries, compilers::Compiler, Artifact, ArtifactId, ProjectCompileOutput, + artifacts::{CompactBytecode, CompactContractBytecode, CompactDeployedBytecode, Libraries}, + compilers::Compiler, + zksync::compile::output::ProjectCompileOutput as ZkProjectCompileOutput, + Artifact, ArtifactId, ProjectCompileOutput, }; use foundry_config::Config; use foundry_evm::{ @@ -20,6 +23,7 @@ use foundry_linking::{LinkOutput, Linker}; use foundry_zksync_compiler::DualCompiledContracts; use rayon::prelude::*; use revm::primitives::SpecId; + use std::{ borrow::Borrow, collections::BTreeMap, @@ -370,11 +374,13 @@ impl MultiContractRunnerBuilder { self, root: &Path, output: ProjectCompileOutput, + zk_output: Option, env: revm::primitives::Env, evm_opts: EvmOpts, dual_compiled_contracts: DualCompiledContracts, - use_zk: bool, ) -> Result { + let use_zk = zk_output.is_some(); + let mut known_contracts = ContractsByArtifact::default(); let output = output.with_stripped_file_prefixes(root); let linker = Linker::new(root, output.artifact_ids().collect()); @@ -415,7 +421,47 @@ impl MultiContractRunnerBuilder { } } - let known_contracts = ContractsByArtifact::new(linked_contracts); + if !use_zk { + known_contracts = ContractsByArtifact::new(linked_contracts); + } else if let Some(zk_output) = zk_output { + let zk_contracts = zk_output.with_stripped_file_prefixes(root).into_artifacts(); + let mut zk_contracts_map = BTreeMap::new(); + + for (id, contract) in zk_contracts { + if let Some(metadata) = contract.metadata { + if let Some(solc_metadata_value) = + metadata.get("solc_metadata").and_then(serde_json::Value::as_str) + { + if let Ok(solc_metadata_json) = + serde_json::from_str::(solc_metadata_value) + { + let abi: JsonAbi = JsonAbi::from_json_str( + &solc_metadata_json["output"]["abi"].to_string(), + )?; + let bytecode = contract.bytecode.as_ref(); + + if let Some(bytecode_object) = bytecode.map(|b| b.object.clone()) { + let compact_bytecode = CompactBytecode { + object: bytecode_object.clone(), + source_map: None, + link_references: BTreeMap::new(), + }; + let compact_contract = CompactContractBytecode { + abi: Some(abi), + bytecode: Some(compact_bytecode.clone()), + deployed_bytecode: Some(CompactDeployedBytecode { + bytecode: Some(compact_bytecode), + immutable_references: BTreeMap::new(), + }), + }; + zk_contracts_map.insert(id.clone(), compact_contract); + } + } + } + } + } + known_contracts = ContractsByArtifact::new(zk_contracts_map); + } Ok(MultiContractRunner { contracts: deployable_contracts, diff --git a/crates/forge/src/result.rs b/crates/forge/src/result.rs index 84c5cdea8..33db197b2 100644 --- a/crates/forge/src/result.rs +++ b/crates/forge/src/result.rs @@ -1,7 +1,7 @@ //! Test outcomes. use crate::gas_report::GasReport; -use alloy_primitives::{Address, Log}; +use alloy_primitives::{Address, Bytes, Log}; use foundry_common::{evm::Breakpoints, get_contract_name, get_file_name, shell}; use foundry_evm::{ coverage::HitMaps, @@ -508,6 +508,8 @@ impl TestKind { #[derive(Clone, Debug, Default)] pub struct TestSetup { + /// Deployments generated during the setup + pub deployments: HashMap, /// The address at which the test contract was deployed pub address: Address, /// The logs emitted during setup @@ -549,6 +551,7 @@ impl TestSetup { } pub fn success( + deployments: HashMap, address: Address, logs: Vec, traces: Traces, @@ -556,7 +559,16 @@ impl TestSetup { coverage: Option, fuzz_fixtures: FuzzFixtures, ) -> Self { - Self { address, logs, traces, labeled_addresses, reason: None, coverage, fuzz_fixtures } + Self { + deployments, + address, + logs, + traces, + labeled_addresses, + reason: None, + coverage, + fuzz_fixtures, + } } pub fn failed_with( @@ -566,6 +578,7 @@ impl TestSetup { reason: String, ) -> Self { Self { + deployments: HashMap::new(), address: Address::ZERO, logs, traces, diff --git a/crates/forge/src/runner.rs b/crates/forge/src/runner.rs index e0a16576d..59b0943a6 100644 --- a/crates/forge/src/runner.rs +++ b/crates/forge/src/runner.rs @@ -147,6 +147,8 @@ impl<'a> ContractRunner<'a> { // construction self.executor.set_balance(address, self.initial_balance)?; + let mut zk_setup_deployments = HashMap::new(); + // Deploy the test contract match self.executor.deploy( self.sender, @@ -176,7 +178,8 @@ impl<'a> ContractRunner<'a> { trace!("calling setUp"); let res = self.executor.setup(None, address, Some(self.revert_decoder)); let (setup_logs, setup_traces, labeled_addresses, reason, coverage) = match res { - Ok(RawCallResult { traces, labels, logs, coverage, .. }) => { + Ok(RawCallResult { traces, labels, logs, coverage, deployments, .. }) => { + zk_setup_deployments.extend(deployments); trace!(%address, "successfully called setUp"); (logs, traces, labels, None, coverage) } @@ -195,6 +198,7 @@ impl<'a> ContractRunner<'a> { logs.extend(setup_logs); TestSetup { + deployments: zk_setup_deployments, address, logs, traces, @@ -205,6 +209,7 @@ impl<'a> ContractRunner<'a> { } } else { TestSetup::success( + zk_setup_deployments, address, logs, traces, @@ -384,8 +389,13 @@ impl<'a> ContractRunner<'a> { find_time, ); - let identified_contracts = has_invariants - .then(|| load_contracts(setup.traces.iter().map(|(_, t)| t), &known_contracts)); + let identified_contracts = has_invariants.then(|| { + load_contracts( + setup.traces.iter().map(|(_, t)| t), + &known_contracts, + &setup.deployments, + ) + }); let test_results = functions .par_iter() .map(|&func| { diff --git a/crates/forge/tests/cli/script.rs b/crates/forge/tests/cli/script.rs index 49df39d43..8e71dcb9c 100644 --- a/crates/forge/tests/cli/script.rs +++ b/crates/forge/tests/cli/script.rs @@ -1547,8 +1547,7 @@ contract DeployScript is Script { assert!(cmd.stdout_lossy().contains("ONCHAIN EXECUTION COMPLETE & SUCCESSFUL")); - let run_latest = foundry_common::fs::json_files(prj.root().join("broadcast")) - .into_iter() + let run_latest = foundry_common::fs::json_files(prj.root().join("broadcast").as_path()) .find(|file| file.ends_with("run-latest.json")) .expect("No broadcast artifacts"); diff --git a/crates/forge/tests/it/config.rs b/crates/forge/tests/it/config.rs index d32692071..1b2a1398d 100644 --- a/crates/forge/tests/it/config.rs +++ b/crates/forge/tests/it/config.rs @@ -1,14 +1,8 @@ //! Test config. -use crate::test_helpers::{COMPILED, COMPILED_ZK, EVM_OPTS, PROJECT, TESTDATA}; use forge::{ result::{SuiteResult, TestStatus}, - MultiContractRunner, MultiContractRunnerBuilder, TestOptions, TestOptionsBuilder, -}; -use foundry_compilers::ProjectPathsConfig; -use foundry_config::{ - fs_permissions::PathPermission, Config, FsPermissions, FuzzConfig, FuzzDictionaryConfig, - InvariantConfig, RpcEndpoint, RpcEndpoints, + MultiContractRunner, }; use foundry_evm::{ decode::decode_console_logs, @@ -16,7 +10,6 @@ use foundry_evm::{ traces::{render_trace_arena, CallTraceDecoderBuilder}, }; use foundry_test_utils::{init_tracing, Filter}; -use foundry_zksync_compiler::DualCompiledContracts; use futures::future::join_all; use itertools::Itertools; use std::collections::BTreeMap; diff --git a/crates/forge/tests/it/test_helpers.rs b/crates/forge/tests/it/test_helpers.rs index e711290bd..b1b00b7aa 100644 --- a/crates/forge/tests/it/test_helpers.rs +++ b/crates/forge/tests/it/test_helpers.rs @@ -1,10 +1,18 @@ //! Test helpers for Forge integration tests. use alloy_primitives::U256; +use forge::{ + revm::primitives::SpecId, MultiContractRunner, MultiContractRunnerBuilder, TestOptions, + TestOptionsBuilder, +}; use foundry_compilers::{ - artifacts::{Libraries, Settings}, + artifacts::{EvmVersion, Libraries, Settings}, zksync::compile::output::ProjectCompileOutput as ZkProjectCompileOutput, - Project, ProjectCompileOutput, ProjectPathsConfig, SolcConfig, + Project, ProjectCompileOutput, SolcConfig, +}; +use foundry_config::{ + fs_permissions::PathPermission, Config, FsPermissions, FuzzConfig, FuzzDictionaryConfig, + InvariantConfig, RpcEndpoint, RpcEndpoints, }; use foundry_evm::{ constants::CALLER, @@ -84,6 +92,7 @@ impl ForgeTestProfile { gas_report_samples: 256, failure_persist_dir: Some(tempfile::tempdir().unwrap().into_path()), failure_persist_file: Some("testfailure".to_string()), + no_zksync_reserved_addresses: false, }) .invariant(InvariantConfig { runs: 256, @@ -101,6 +110,7 @@ impl ForgeTestProfile { max_assume_rejects: 65536, gas_report_samples: 256, failure_persist_dir: Some(tempfile::tempdir().unwrap().into_path()), + no_zksync_reserved_addresses: false, }) .build(output, Path::new(self.project().root())) .expect("Config loaded") @@ -196,6 +206,15 @@ impl ForgeTestData { self.runner_with_config(config) } + /// Builds a non-tracing zksync runner + /// TODO: This needs to be implemented as currently it is a copy of the original function + pub fn runner_zksync(&self) -> MultiContractRunner { + let mut config = self.config.clone(); + config.fs_permissions = + FsPermissions::new(vec![PathPermission::read_write(manifest_root())]); + self.runner_with_zksync_config(config) + } + /// Builds a non-tracing runner pub fn runner_with_config(&self, mut config: Config) -> MultiContractRunner { config.rpc_endpoints = rpc_endpoints(); @@ -222,7 +241,38 @@ impl ForgeTestData { .enable_isolation(opts.isolate) .sender(sender) .with_test_options(self.test_opts.clone()) - .build(root, output, env, opts.clone()) + .build(root, output, None, env, opts.clone(), Default::default()) + .unwrap() + } + + /// Builds a non-tracing runner with zksync + /// TODO: This needs to be added as currently it is a copy of the original function + pub fn runner_with_zksync_config(&self, mut config: Config) -> MultiContractRunner { + config.rpc_endpoints = rpc_endpoints(); + config.allow_paths.push(manifest_root().to_path_buf()); + + // no prompt testing + config.prompt_timeout = 0; + + let root = self.project.root(); + let mut opts = self.evm_opts.clone(); + + if config.isolate { + opts.isolate = true; + } + + let env = opts.local_evm_env(); + let output = self.output.clone(); + + let sender = config.sender; + + let mut builder = self.base_runner(); + builder.config = Arc::new(config); + builder + .enable_isolation(opts.isolate) + .sender(sender) + .with_test_options(self.test_opts.clone()) + .build(root, output, None, env, opts.clone(), Default::default()) .unwrap() } @@ -231,7 +281,14 @@ impl ForgeTestData { let mut opts = self.evm_opts.clone(); opts.verbosity = 5; self.base_runner() - .build(self.project.root(), self.output.clone(), opts.local_evm_env(), opts) + .build( + self.project.root(), + self.output.clone(), + None, + opts.local_evm_env(), + opts, + Default::default(), + ) .unwrap() } @@ -247,7 +304,7 @@ impl ForgeTestData { self.base_runner() .with_fork(fork) - .build(self.project.root(), self.output.clone(), env, opts) + .build(self.project.root(), self.output.clone(), None, env, opts, Default::default()) .unwrap() } } @@ -279,53 +336,17 @@ pub fn get_compiled(project: &Project) -> ProjectCompileOutput { out } -/// Compile ZK project -fn zk_compile(project: Project) -> ZkProjectCompileOutput { - // let compiler_path = - // futures::executor::block_on(setup_zksolc_manager(DEFAULT_ZKSOLC_VERSION.to_owned())) - // .expect("failed setting up zksolc"); - - // let mut zksolc_config = ZkSolcConfigBuilder::new() - // .compiler_path(compiler_path) - // .settings(ZkSettings { - // optimizer: Optimizer { - // enabled: Some(true), - // mode: Some(String::from("3")), - // fallback_to_optimizing_for_size: Some(false), - // disable_system_request_memoization: true, - // ..Default::default() - // }, - // ..Default::default() - // }) - // .build() - // .expect("failed building zksolc config"); - // zksolc_config.contracts_to_compile = Some(vec![ - // globset::Glob::new("zk/*").unwrap().compile_matcher(), - // globset::Glob::new("lib/*").unwrap().compile_matcher(), - // globset::Glob::new("cheats/Vm.sol").unwrap().compile_matcher(), - // ]); - - // let mut zksolc = ZkSolc::new(zksolc_config, project); - // let (zk_out, _) = zksolc.compile().unwrap(); - // zk_out - - project.zksync_compile().expect("failed compiling with zksolc") -} - pub static COMPILED_ZK: Lazy = Lazy::new(|| { const LOCK: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../testdata/.lock-zk"); - // let project = &*PROJECT; - let mut paths = ProjectPathsConfig::builder().root(TESTDATA).sources(TESTDATA).build().unwrap(); - paths.zksync_artifacts = format!("{TESTDATA}/zkout").into(); - - let libs = - ["fork/Fork.t.sol:DssExecLib:0xfD88CeE74f7D78697775aBDAE53f9Da1559728E4".to_string()]; - let settings = Settings { libraries: Libraries::parse(&libs).unwrap(), ..Default::default() }; - let solc_config = SolcConfig::builder().settings(settings).build(); + // let libs = + // ["fork/Fork.t.sol:DssExecLib:0xfD88CeE74f7D78697775aBDAE53f9Da1559728E4".to_string()]; - let project = Project::builder().paths(paths).solc_config(solc_config).build().unwrap(); - assert!(project.cached); + // TODO: fix this to adapt to new way of testing + let config = ForgeTestData::new(ForgeTestProfile::Default).config; + let zk_project = foundry_zksync_compiler::create_project(&config, true, false).unwrap(); + let zk_compiler = foundry_common::compile::ProjectCompiler::new(); + assert!(zk_project.cached); // Compile only once per test run. // We need to use a file lock because `cargo-nextest` runs tests in different processes. @@ -334,14 +355,14 @@ pub static COMPILED_ZK: Lazy = Lazy::new(|| { let mut lock = fd_lock::new_lock(LOCK); let read = lock.read().unwrap(); let out; - if project.cache_path().exists() && std::fs::read(LOCK).unwrap() == b"1" { - out = zk_compile(project); + if zk_project.cache_path().exists() && std::fs::read(LOCK).unwrap() == b"1" { + out = zk_compiler.zksync_compile(&zk_project, None).unwrap(); drop(read); } else { drop(read); let mut write = lock.write().unwrap(); write.write_all(b"1").unwrap(); - out = zk_compile(project); + out = zk_compiler.zksync_compile(&zk_project, None).unwrap(); drop(write); }; @@ -368,17 +389,6 @@ pub static EVM_OPTS: Lazy = Lazy::new(|| EvmOpts { ..Default::default() }); -pub fn fuzz_executor(executor: Executor) -> FuzzedExecutor { - let cfg = proptest::test_runner::Config { failure_persistence: None, ..Default::default() }; - - FuzzedExecutor::new( - executor, - proptest::test_runner::TestRunner::new(cfg), - CALLER, - crate::config::test_opts().fuzz, - ) -} - /// Default data for the tests group. pub static TEST_DATA_DEFAULT: Lazy = Lazy::new(|| ForgeTestData::new(ForgeTestProfile::Default)); diff --git a/crates/forge/tests/it/zk.rs b/crates/forge/tests/it/zk.rs index 1439b866f..da988fcdd 100644 --- a/crates/forge/tests/it/zk.rs +++ b/crates/forge/tests/it/zk.rs @@ -4,55 +4,54 @@ use std::collections::BTreeMap; use crate::{ config::*, - test_helpers::{PROJECT, RE_PATH_SEPARATOR}, + test_helpers::{RE_PATH_SEPARATOR, TEST_DATA_DEFAULT}, }; use forge::revm::primitives::SpecId; -use foundry_config::{fs_permissions::PathPermission, Config, FsPermissions}; +use foundry_config::{fs_permissions::PathPermission, FsPermissions}; use foundry_test_utils::Filter; /// Executes all zk basic tests #[tokio::test(flavor = "multi_thread")] async fn test_zk_basic() { - let mut config = Config::with_root(PROJECT.root()); + let mut config = TEST_DATA_DEFAULT.config.clone(); config.fs_permissions = FsPermissions::new(vec![PathPermission::read_write("./")]); - let runner = runner_with_config_and_zk(config); + let runner = TEST_DATA_DEFAULT.runner_with_zksync_config(config); let filter = Filter::new(".*", "ZkBasicTest", &format!(".*zk{RE_PATH_SEPARATOR}*")); - TestConfig::with_filter(runner.await, filter).evm_spec(SpecId::SHANGHAI).run().await; + TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; } /// Executes all zk contract tests #[tokio::test(flavor = "multi_thread")] async fn test_zk_contracts() { - let mut config = Config::with_root(PROJECT.root()); + let mut config = TEST_DATA_DEFAULT.config.clone(); config.fs_permissions = FsPermissions::new(vec![PathPermission::read_write("./")]); - let runner = runner_with_config_and_zk(config); + let runner = TEST_DATA_DEFAULT.runner_with_zksync_config(config); let filter = Filter::new(".*", "ZkContractsTest", &format!(".*zk{RE_PATH_SEPARATOR}*")); - TestConfig::with_filter(runner.await, filter).evm_spec(SpecId::SHANGHAI).run().await; + TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; } /// Executes all zk cheatcode tests #[tokio::test(flavor = "multi_thread")] async fn test_zk_cheats() { - let mut config = Config::with_root(PROJECT.root()); + let mut config = TEST_DATA_DEFAULT.config.clone(); config.fs_permissions = FsPermissions::new(vec![PathPermission::read_write("./")]); - let runner = runner_with_config_and_zk(config); + let runner = TEST_DATA_DEFAULT.runner_with_zksync_config(config); let filter = Filter::new(".*", "ZkCheatcodesTest", &format!(".*zk{RE_PATH_SEPARATOR}*")); - TestConfig::with_filter(runner.await, filter).evm_spec(SpecId::SHANGHAI).run().await; + TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; } /// Executes all zk console tests #[tokio::test(flavor = "multi_thread")] async fn test_zk_logs() { - let mut config = Config::with_root(PROJECT.root()); + let mut config = TEST_DATA_DEFAULT.config.clone(); config.fs_permissions = FsPermissions::new(vec![PathPermission::read_write("./")]); - let runner = runner_with_config_and_zk(config); + let runner = TEST_DATA_DEFAULT.runner_with_zksync_config(config); let filter = Filter::new(".*", "ZkConsoleTest", &format!(".*zk{RE_PATH_SEPARATOR}*")); - let results = - TestConfig::with_filter(runner.await, filter).evm_spec(SpecId::SHANGHAI).test().await; + let results = TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).test(); assert_multiple( &results, diff --git a/crates/script/src/broadcast.rs b/crates/script/src/broadcast.rs index 5a3a4f8f9..2b2b5bb61 100644 --- a/crates/script/src/broadcast.rs +++ b/crates/script/src/broadcast.rs @@ -89,6 +89,7 @@ async fn convert_to_zksync( Ok((deploy_request, signable)) } +#[allow(clippy::too_many_arguments)] pub async fn send_transaction( provider: Arc, mut tx: WithOtherFields, @@ -127,7 +128,8 @@ pub async fn send_transaction( debug!("sending transaction: {:?}", tx); let signed = if let Some(zk) = zk { - let signer = signer.signer_by_address(from).ok_or(eyre::eyre!("Signer not found"))?; + let signer = + signer.signer_by_address(from).ok_or(eyre::eyre!("Signer not found"))?; let (deploy_request, signable) = convert_to_zksync(&provider, tx, zk).await?; let mut signable = signable.to_signable_tx(); @@ -141,7 +143,7 @@ pub async fn send_transaction( .rlp_signed(signature.to_ethers()) .wrap_err("able to rlp encode deploy request")?; - [&[zksync_web3_rs::zks_utils::EIP712_TX_TYPE], encoded].concat().into() + [&[zksync_web3_rs::zks_utils::EIP712_TX_TYPE], encoded].concat() } else { tx.build(signer).await?.encoded_2718() }; diff --git a/crates/script/src/lib.rs b/crates/script/src/lib.rs index a39337d49..388de5f22 100644 --- a/crates/script/src/lib.rs +++ b/crates/script/src/lib.rs @@ -618,7 +618,7 @@ impl ScriptConfig { .use_zk_vm(use_zk); } - let mut executor = builder.build(env, db); + let executor = builder.build(env, db); Ok(ScriptRunner::new(executor, self.evm_opts.clone())) } } diff --git a/crates/script/src/progress.rs b/crates/script/src/progress.rs index 6f028688b..f97e162a3 100644 --- a/crates/script/src/progress.rs +++ b/crates/script/src/progress.rs @@ -172,7 +172,6 @@ impl ScriptProgress { if deployment_sequence.pending.is_empty() { return Ok(()); } - let count = deployment_sequence.pending.len(); let seq_progress = self.get_sequence_progress(sequence_idx, deployment_sequence); diff --git a/crates/script/src/receipts.rs b/crates/script/src/receipts.rs index c8582ef9e..a080e2e0d 100644 --- a/crates/script/src/receipts.rs +++ b/crates/script/src/receipts.rs @@ -2,7 +2,7 @@ use alloy_chains::Chain; use alloy_primitives::{utils::format_units, TxHash, U256}; use alloy_provider::{PendingTransactionBuilder, Provider}; use alloy_rpc_types::AnyTransactionReceipt; -use eyre::{Context, Result}; +use eyre::Result; use foundry_common::provider::RetryProvider; use std::time::Duration; diff --git a/crates/script/src/simulate.rs b/crates/script/src/simulate.rs index 5a1d467ee..98df1e7fa 100644 --- a/crates/script/src/simulate.rs +++ b/crates/script/src/simulate.rs @@ -136,7 +136,7 @@ impl PreSimulationState { tx.gas = Some(gas as u128); } } - let tx = TransactionWithMetadata::new_with_zk( + let tx = TransactionWithMetadata::new( tx, rpc, &result, diff --git a/crates/script/src/transaction.rs b/crates/script/src/transaction.rs index 3547526af..6eb6bf17d 100644 --- a/crates/script/src/transaction.rs +++ b/crates/script/src/transaction.rs @@ -66,10 +66,7 @@ impl TransactionWithMetadata { Self { transaction: WithOtherFields::new(transaction), ..Default::default() } } - pub fn from_zk_tx_request(transaction: TransactionRequest, zk: Option) -> Self { - Self { transaction: WithOtherFields::new(transaction), zk, ..Default::default() } - } - + #[allow(clippy::too_many_arguments)] pub fn new( transaction: TransactionRequest, rpc: String, @@ -78,27 +75,6 @@ impl TransactionWithMetadata { decoder: &CallTraceDecoder, additional_contracts: Vec, is_fixed_gas_limit: bool, - ) -> Result { - Self::new_with_zk( - transaction, - rpc, - result, - local_contracts, - decoder, - additional_contracts, - is_fixed_gas_limit, - None, - ) - } - - pub fn new_with_zk( - transaction: TransactionRequest, - rpc: String, - result: &ScriptResult, - local_contracts: &BTreeMap, - decoder: &CallTraceDecoder, - additional_contracts: Vec, - is_fixed_gas_limit: bool, zk: Option, ) -> Result { let mut metadata = Self::from_tx_request(transaction); diff --git a/crates/script/src/verify.rs b/crates/script/src/verify.rs index 1e719fecf..b3bd6c0fb 100644 --- a/crates/script/src/verify.rs +++ b/crates/script/src/verify.rs @@ -49,6 +49,7 @@ pub struct VerifyBundle { pub retry: RetryArgs, pub verifier: VerifierArgs, pub via_ir: bool, + pub zksync: bool, } impl VerifyBundle { @@ -76,6 +77,7 @@ impl VerifyBundle { }; let via_ir = config.via_ir; + let zksync = config.zksync.should_compile(); Self { num_of_optimizations, @@ -85,6 +87,7 @@ impl VerifyBundle { retry, verifier, via_ir, + zksync, } } @@ -151,6 +154,7 @@ impl VerifyBundle { evm_version: None, show_standard_json_input: false, guess_constructor_args: false, + zksync: self.zksync, }; return Some(verify) diff --git a/crates/verify/Cargo.toml b/crates/verify/Cargo.toml index f308381d4..29cd75770 100644 --- a/crates/verify/Cargo.toml +++ b/crates/verify/Cargo.toml @@ -41,6 +41,9 @@ once_cell.workspace = true yansi.workspace = true itertools.workspace = true +# zk +foundry-zksync-compiler.workspace = true + [dev-dependencies] tokio = { workspace = true, features = ["macros"] } foundry-test-utils.workspace = true diff --git a/crates/verify/src/etherscan/flatten.rs b/crates/verify/src/etherscan/flatten.rs index 92c0083e6..785643315 100644 --- a/crates/verify/src/etherscan/flatten.rs +++ b/crates/verify/src/etherscan/flatten.rs @@ -10,9 +10,17 @@ use foundry_compilers::{ Compiler, CompilerInput, }, solc::Solc, + zksolc::{ + input::{ZkSolcInput, ZkSolcVersionedInput}, + ZkSolc, + }, + zksync::{ + compile::output::AggregatedCompilerOutput as ZkAggregatedCompilerOutput, raw_build_info_new, + }, AggregatedCompilerOutput, }; use semver::{BuildMetadata, Version}; + use std::{collections::BTreeMap, path::Path}; #[derive(Debug)] @@ -54,6 +62,47 @@ impl EtherscanSourceProvider for EtherscanFlattenedSource { Ok((source, context.target_name.clone(), CodeFormat::SingleFile)) } + + fn zk_source( + &self, + args: &VerifyArgs, + context: &VerificationContext, + ) -> Result<(String, String, CodeFormat)> { + let metadata = context.project.zksync_zksolc_config.settings.metadata.as_ref(); + let bch = metadata.and_then(|m| m.bytecode_hash).unwrap_or_default(); + + eyre::ensure!( + bch == foundry_compilers::zksolc::settings::BytecodeHash::Keccak256, + "When using flattened source with zksync, bytecodeHash must be set to keccak256 because Etherscan uses Keccak256 in its Compiler Settings when re-compiling your code. BytecodeHash is currently: {}. Hint: Set the bytecodeHash key in your foundry.toml :)", + bch, + ); + + let source = context + .project + .paths + .clone() + .with_language::() + .flatten(&context.target_path) + .wrap_err("Failed to flatten contract")?; + + if !args.force { + // solc dry run of flattened code + self.zk_check_flattened( + source.clone(), + &context.compiler_version, + &context.target_path, + ) + .map_err(|err| { + eyre::eyre!( + "Failed to compile the flattened code locally: `{}`\ + To skip this solc dry, have a look at the `--force` flag of this command.", + err + ) + })?; + } + + Ok((source, context.target_name.clone(), CodeFormat::SingleFile)) + } } impl EtherscanFlattenedSource { @@ -105,6 +154,61 @@ Diagnostics: {diags}", Ok(()) } + + /// Attempts to compile the flattened content locally with the zksolc compiler version. + /// + /// This expects the completely flattened `content´ and will try to compile it using the + /// provided compiler. If the compiler is missing it will be installed. + /// + /// # Errors + /// + /// If it failed to install a missing solc compiler + /// + /// # Exits + /// + /// If the solc compiler output contains errors, this could either be due to a bug in the + /// flattening code or could to conflict in the flattened code, for example if there are + /// multiple interfaces with the same name. + fn zk_check_flattened( + &self, + content: impl Into, + version: &Version, + contract_path: &Path, + ) -> Result<()> { + let version = strip_build_meta(version.clone()); + let zksolc = ZkSolc::find_installed_version(&version)? + .unwrap_or(ZkSolc::blocking_install(&version)?); + + let mut input = ZkSolcVersionedInput { + input: ZkSolcInput { + language: SolcLanguage::Solidity, + sources: BTreeMap::from([("contract.sol".into(), Source::new(content))]), + ..Default::default() + }, + solc_version: version.clone(), + allow_paths: Default::default(), + base_path: Default::default(), + include_paths: Default::default(), + }; + + let out = zksolc.compile(&mut input)?; + if out.has_error() { + let mut o = ZkAggregatedCompilerOutput::default(); + o.extend(version.clone(), raw_build_info_new(&input, &out, false)?, out); + let diags = o.diagnostics(&[], &[], Default::default()); + + eyre::bail!( + "\ +Failed to compile the flattened code locally. +This could be a bug, please inspect the output of `forge flatten {}` and report an issue. +To skip this zksolc dry, pass `--force`. +Diagnostics: {diags}", + contract_path.display() + ); + } + + Ok(()) + } } /// Strips [BuildMetadata] from the [Version] diff --git a/crates/verify/src/etherscan/mod.rs b/crates/verify/src/etherscan/mod.rs index b0698d58b..7b1520fd6 100644 --- a/crates/verify/src/etherscan/mod.rs +++ b/crates/verify/src/etherscan/mod.rs @@ -11,13 +11,14 @@ use foundry_block_explorers::{ }; use foundry_cli::utils::{self, read_constructor_args_file, LoadConfig}; use foundry_common::{abi::encode_function_args, retry::Retry, shell}; -use foundry_compilers::{artifacts::BytecodeObject, Artifact}; +use foundry_compilers::{artifacts::BytecodeObject, solc::Solc, Artifact}; use foundry_config::{Chain, Config}; use foundry_evm::constants::DEFAULT_CREATE2_DEPLOYER; use futures::FutureExt; use once_cell::sync::Lazy; use regex::Regex; use semver::{BuildMetadata, Version}; + use std::fmt::Debug; mod flatten; @@ -39,6 +40,12 @@ trait EtherscanSourceProvider: Send + Sync + Debug { args: &VerifyArgs, context: &VerificationContext, ) -> Result<(String, String, CodeFormat)>; + + fn zk_source( + &self, + args: &VerifyArgs, + context: &VerificationContext, + ) -> Result<(String, String, CodeFormat)>; } #[async_trait::async_trait] @@ -167,6 +174,10 @@ impl VerificationProvider for EtherscanVerificationProvider { return Err(eyre!("Verification is still pending...",)) } + if resp.result == "In progress" { + return Err(eyre!("Verification is in progress...",)) + } + if resp.result == "Unable to verify" { return Err(eyre!("Unable to verify.",)) } @@ -211,6 +222,7 @@ impl EtherscanVerificationProvider { context: &VerificationContext, ) -> Result<(Client, VerifyContract)> { let config = args.try_load_config_emit_warnings()?; + let etherscan = self.client( args.etherscan.chain.unwrap_or_default(), args.verifier.verifier_url.as_deref(), @@ -291,8 +303,14 @@ impl EtherscanVerificationProvider { args: &VerifyArgs, context: &VerificationContext, ) -> Result { - let (source, contract_name, code_format) = - self.source_provider(args).source(args, context)?; + let zk_compiler_version = self.zk_compiler_version(args, context)?; + let (source, contract_name, code_format) = if let Some(zk) = &zk_compiler_version { + let mut zk_context = context.clone(); + zk_context.compiler_version = zk.zksolc.clone(); + self.source_provider(args).zk_source(args, &zk_context) + } else { + self.source_provider(args).source(args, context) + }?; let mut compiler_version = context.compiler_version.clone(); compiler_version.build = match RE_BUILD_COMMIT.captures(compiler_version.build.as_str()) { @@ -300,13 +318,30 @@ impl EtherscanVerificationProvider { _ => BuildMetadata::EMPTY, }; + let zk_args = match zk_compiler_version { + None => vec![], + Some(zk) => { + if let Some(solc) = zk.solc { + compiler_version = Version::new(solc.major, solc.minor, solc.patch); + } + + let compiler_mode = if zk.is_zksync_solc { "zksync" } else { "solc" }.to_string(); + + vec![ + ("compilermode".to_string(), compiler_mode), + ("zksolcVersion".to_string(), format!("v{}", zk.zksolc)), + ] + } + }; + let compiler_version = - format!("v{}", ensure_solc_build_metadata(context.compiler_version.clone()).await?); + format!("v{}", ensure_solc_build_metadata(compiler_version.clone()).await?); let constructor_args = self.constructor_args(args, context).await?; let mut verify_args = VerifyContract::new(args.address, contract_name, source, compiler_version) .constructor_arguments(constructor_args) .code_format(code_format); + verify_args.other.extend(zk_args.into_iter()); if args.via_ir { // we explicitly set this __undocumented__ argument to true if provided by the user, @@ -329,6 +364,33 @@ impl EtherscanVerificationProvider { Ok(verify_args) } + fn zk_compiler_version( + &mut self, + args: &VerifyArgs, + context: &VerificationContext, + ) -> Result> { + if !args.zksync { + return Ok(None); + } + + let zksolc = context.project.zksync_zksolc.version()?; + let mut is_zksync_solc = false; + + let solc = if let Some(solc) = &context.config.zksync.solc_path { + let solc = Solc::new(solc)?; + let version = solc.version; + //TODO: determine if this solc is zksync or not + Some(version) + } else { + //if there's no `solc_path` specified then we use the same + // as the project version, but the zksync fork + is_zksync_solc = true; + Some(context.compiler_version.clone()) + }; + + Ok(Some(ZkVersion { zksolc, solc, is_zksync_solc })) + } + /// Return the optional encoded constructor arguments. If the path to /// constructor arguments was provided, read them and encode. Otherwise, /// return whatever was set in the [VerifyArgs] args. @@ -380,6 +442,7 @@ impl EtherscanVerificationProvider { &context.config, )?; + //TODO: zk support let creation_data = client.contract_creation_data(args.address).await?; let transaction = provider .get_transaction_by_hash(creation_data.transaction_hash) @@ -442,6 +505,13 @@ async fn ensure_solc_build_metadata(version: Version) -> Result { } } +#[derive(Debug)] +pub struct ZkVersion { + zksolc: Version, + solc: Option, + is_zksync_solc: bool, +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/verify/src/etherscan/standard_json.rs b/crates/verify/src/etherscan/standard_json.rs index 944ee6b10..b93ecdf22 100644 --- a/crates/verify/src/etherscan/standard_json.rs +++ b/crates/verify/src/etherscan/standard_json.rs @@ -47,4 +47,30 @@ impl EtherscanSourceProvider for EtherscanStandardJsonSource { ); Ok((source, name, CodeFormat::StandardJsonInput)) } + + fn zk_source( + &self, + _args: &VerifyArgs, + context: &VerificationContext, + ) -> Result<(String, String, CodeFormat)> { + let input = + foundry_zksync_compiler::standard_json_input(&context.project, &context.target_path) + .wrap_err("failed to get zksolc standard json")?; + + let source = + serde_json::to_string(&input).wrap_err("Failed to parse zksync standard json input")?; + + trace!(target: "forge::verify", standard_json=source, "determined zksync standard json input"); + + let name = format!( + "{}:{}", + context + .target_path + .strip_prefix(context.project.root()) + .unwrap_or(context.target_path.as_path()) + .display(), + context.target_name.clone() + ); + Ok((source, name, CodeFormat::StandardJsonInput)) + } } diff --git a/crates/verify/src/lib.rs b/crates/verify/src/lib.rs index 5edda5b08..8022607b4 100644 --- a/crates/verify/src/lib.rs +++ b/crates/verify/src/lib.rs @@ -146,6 +146,10 @@ pub struct VerifyArgs { #[command(flatten)] pub verifier: VerifierArgs, + + /// Verify for zksync + #[clap(long)] + pub zksync: bool, } impl_figment_convert!(VerifyArgs); @@ -177,6 +181,7 @@ impl figment::Provider for VerifyArgs { if self.via_ir { dict.insert("via_ir".to_string(), figment::value::Value::serialize(self.via_ir)?); } + Ok(figment::value::Map::from([(Config::selected_profile(), dict)])) } } @@ -305,6 +310,7 @@ impl VerifyArgs { output.artifact_ids().map(|(id, artifact)| (id, artifact.clone().into())), ); + //TODO: lookup for zksync let Some((artifact_id, _)) = contracts.find_by_deployed_code_exact(&code) else { eyre::bail!(format!( "Bytecode at {} does not match any local contracts", diff --git a/crates/zksync/compiler/src/lib.rs b/crates/zksync/compiler/src/lib.rs index 93b597235..a5e6f095e 100644 --- a/crates/zksync/compiler/src/lib.rs +++ b/crates/zksync/compiler/src/lib.rs @@ -6,6 +6,8 @@ /// ZKSolc specific logic. mod zksolc; +use std::path::Path; + use foundry_config::{Config, SkipBuildFilters, SolcReq}; pub use zksolc::*; @@ -13,7 +15,7 @@ pub mod libraries; use foundry_compilers::{ artifacts::Severity, error::SolcError, solc::SolcCompiler, zksolc::ZkSolc, - zksync::config::ZkSolcConfig, Project, ProjectBuilder, + zksync::config::ZkSolcConfig, Compiler, Project, ProjectBuilder, }; /// Ensures that the configured version is installed if explicitly set @@ -113,3 +115,30 @@ pub fn create_project( Ok(project) } + +/// Obtain a standard json input for zksolc +pub fn standard_json_input( + project: &Project, + target_path: impl AsRef, +) -> Result +where + C::Settings: Into, +{ + let mut input = project.standard_json_input(target_path)?; + tracing::debug!(?input.settings.remappings, "standard_json_input for zksync"); + + let mut settings = project.zksync_zksolc_config.settings.clone(); + settings.remappings = std::mem::take(&mut input.settings.remappings); + settings.libraries.libs = settings + .libraries + .libs + .into_iter() + .map(|(f, libs)| (f.strip_prefix(project.root()).unwrap_or(&f).to_path_buf(), libs)) + .collect(); + let settings = serde_json::to_value(settings).expect("able to serialize settings as json"); + + let mut serialized = serde_json::to_value(input).expect("able to serialize input as json"); + serialized["settings"] = settings; + + Ok(serialized) +} diff --git a/crates/zksync/core/Cargo.toml b/crates/zksync/core/Cargo.toml index f1c340128..edea9a142 100644 --- a/crates/zksync/core/Cargo.toml +++ b/crates/zksync/core/Cargo.toml @@ -16,8 +16,14 @@ foundry-common.workspace = true foundry-cheatcodes-common.workspace = true foundry-zksync-compiler.workspace = true alloy-primitives.workspace = true +alloy-signer.workspace = true +alloy-network.workspace = true alloy-sol-types.workspace = true alloy-dyn-abi.workspace = true +alloy-serde.workspace = true +alloy-provider.workspace = true +alloy-transport.workspace = true +alloy-rpc-types.workspace = true alloy-consensus.workspace = true hex.workspace = true itertools.workspace = true diff --git a/crates/zksync/core/src/cheatcodes.rs b/crates/zksync/core/src/cheatcodes.rs index f27d9e8ed..dc50d2cb7 100644 --- a/crates/zksync/core/src/cheatcodes.rs +++ b/crates/zksync/core/src/cheatcodes.rs @@ -21,7 +21,7 @@ use crate::{ }; /// Sets `block.timestamp`. -pub fn warp<'a, DB>(timestamp: rU256, ecx: &'a mut InnerEvmContext) +pub fn warp(timestamp: rU256, ecx: &mut InnerEvmContext) where DB: Database, ::Error: Debug, @@ -41,7 +41,7 @@ where } /// Sets `block.number`. -pub fn roll<'a, DB>(number: rU256, ecx: &'a mut InnerEvmContext) +pub fn roll(number: rU256, ecx: &mut InnerEvmContext) where DB: Database, ::Error: Debug, @@ -61,7 +61,7 @@ where } /// Sets balance for a specific address. -pub fn deal<'a, DB>(address: Address, balance: rU256, ecx: &'a mut InnerEvmContext) -> rU256 +pub fn deal(address: Address, balance: rU256, ecx: &mut InnerEvmContext) -> rU256 where DB: Database, ::Error: Debug, @@ -80,13 +80,13 @@ where } /// Sets nonce for a specific address. -pub fn set_nonce<'a, DB>(address: Address, nonce: rU256, ecx: &'a mut InnerEvmContext) +pub fn set_nonce(address: Address, nonce: rU256, ecx: &mut InnerEvmContext) where DB: Database, ::Error: Debug, { info!(?address, ?nonce, "cheatcode setNonce"); - // ensure nonce is _only_ tx nonce + //ensure nonce is _only_ tx nonce let (tx_nonce, _deploy_nonce) = decompose_full_nonce(nonce.to_u256()); let nonce_addr = NONCE_HOLDER_ADDRESS.to_address(); @@ -98,7 +98,7 @@ where } /// Gets nonce for a specific address. -pub fn get_nonce<'a, DB>(address: Address, ecx: &'a mut InnerEvmContext) -> rU256 +pub fn get_nonce(address: Address, ecx: &mut InnerEvmContext) -> rU256 where DB: Database, ::Error: Debug, @@ -112,12 +112,11 @@ where let (full_nonce, _) = ecx.sload(nonce_addr, nonce_key).unwrap_or_default(); let (tx_nonce, _deploy_nonce) = decompose_full_nonce(full_nonce.to_u256()); - tx_nonce.to_ru256() } /// Sets code for a specific address. -pub fn etch<'a, DB>(address: Address, bytecode: &[u8], ecx: &'a mut InnerEvmContext) +pub fn etch(address: Address, bytecode: &[u8], ecx: &mut InnerEvmContext) where DB: Database, ::Error: Debug, @@ -156,11 +155,8 @@ where /// Sets code for a mocked account. If not done, the mocked call will revert. /// The call has no effect if the mocked account already has a bytecode entry. -pub fn set_mocked_account<'a, DB>( - address: Address, - ecx: &'a mut InnerEvmContext, - caller: Address, -) where +pub fn set_mocked_account(address: Address, ecx: &mut InnerEvmContext, caller: Address) +where DB: Database, ::Error: Debug, { diff --git a/crates/zksync/core/src/lib.rs b/crates/zksync/core/src/lib.rs index fbb1f4faa..8d132bf56 100644 --- a/crates/zksync/core/src/lib.rs +++ b/crates/zksync/core/src/lib.rs @@ -18,8 +18,17 @@ pub mod vm; /// ZKSync Era State implementation. pub mod state; +use alloy_network::{AnyNetwork, TxSigner}; use alloy_primitives::{Address, Bytes, U256 as rU256}; -use convert::{ConvertAddress, ConvertH160, ConvertH256, ConvertRU256, ConvertU256}; +use alloy_provider::Provider; +use alloy_rpc_types::TransactionRequest; +use alloy_serde::WithOtherFields; +use alloy_signer::Signature; +use alloy_transport::Transport; +use convert::{ + ConvertAddress, ConvertBytes, ConvertH160, ConvertH256, ConvertRU256, ConvertSignature, + ToSignable, +}; use eyre::{eyre, OptionExt}; pub use utils::{fix_l2_gas_limit, fix_l2_gas_price}; pub use vm::{balance, encode_create_params, nonce}; @@ -32,9 +41,6 @@ pub use zksync_types::{ pub use zksync_utils::bytecode::hash_bytecode; use zksync_web3_rs::{ eip712::{Eip712Meta, Eip712Transaction, Eip712TransactionRequest}, - providers::Middleware, - signers::Signer, - types::transaction::eip2718::TypedTransaction, zks_provider::types::Fee, zks_utils::EIP712_TX_TYPE, }; @@ -67,34 +73,39 @@ impl ZkTransactionMetadata { } /// Creates a new signed EIP-712 transaction with the provided factory deps. -pub async fn new_eip712_transaction( - legacy_or_1559: TypedTransaction, +pub async fn new_eip712_transaction< + P: Provider, + S: TxSigner + Sync, + T: Transport + Clone, +>( + tx: WithOtherFields, factory_deps: Vec>, - provider: M, + provider: P, signer: S, ) -> Result { - let from = legacy_or_1559.from().cloned().ok_or_eyre("`from` cannot be empty")?; - let to = legacy_or_1559 - .to() - .and_then(|to| to.as_address()) - .cloned() + let from = tx.from.ok_or_eyre("`from` cannot be empty")?; + let to = tx + .to + .and_then(|to| match to { + alloy_primitives::TxKind::Create => None, + alloy_primitives::TxKind::Call(to) => Some(to), + }) .ok_or_eyre("`to` cannot be empty")?; - let chain_id = legacy_or_1559.chain_id().ok_or_eyre("`chain_id` cannot be empty")?; - let nonce = legacy_or_1559.nonce().ok_or_eyre("`nonce` cannot be empty")?; - let gas_price = legacy_or_1559.gas_price().ok_or_eyre("`gas_price` cannot be empty")?; - let max_cost = legacy_or_1559.max_cost().ok_or_eyre("`max_cost` cannot be empty")?; - let data = legacy_or_1559.data().cloned().ok_or_eyre("`data` cannot be empty")?; + let chain_id = tx.chain_id.ok_or_eyre("`chain_id` cannot be empty")?; + let nonce = tx.nonce.ok_or_eyre("`nonce` cannot be empty")?; + let gas_price = tx.gas_price.ok_or_eyre("`gas_price` cannot be empty")?; + + let data = tx.input.clone().into_input().unwrap_or_default(); let custom_data = Eip712Meta::new().factory_deps(factory_deps); let mut deploy_request = Eip712TransactionRequest::new() .r#type(EIP712_TX_TYPE) - .from(from) - .to(to) - .chain_id(chain_id.as_u64()) + .from(from.to_h160()) + .to(to.to_h160()) + .chain_id(chain_id) .nonce(nonce) .gas_price(gas_price) - .max_fee_per_gas(max_cost) - .data(data) + .data(data.to_ethers()) .custom_data(custom_data); let gas_price = provider @@ -102,8 +113,7 @@ pub async fn new_eip712_transaction( .await .map_err(|err| eyre!("failed retrieving gas_price {:?}", err))?; let fee: Fee = provider - .provider() - .request("zks_estimateFee", [deploy_request.clone()]) + .raw_request("zks_estimateFee".into(), [deploy_request.clone()]) .await .map_err(|err| eyre!("failed estimating fee {:?}", err))?; deploy_request = deploy_request @@ -117,9 +127,11 @@ pub async fn new_eip712_transaction( .try_into() .map_err(|err| eyre!("failed converting deploy request to eip-712 tx {:?}", err))?; - let signature = signer.sign_typed_data(&signable).await.expect("Failed to sign typed data"); + let mut signable = signable.to_signable_tx(); + let signature = + signer.sign_transaction(&mut signable).await.expect("Failed to sign typed data"); let encoded_rlp = deploy_request - .rlp_signed(signature) + .rlp_signed(signature.to_ethers()) .map_err(|err| eyre!("failed encoding deployment request {:?}", err))?; let tx = [&[EIP712_TX_TYPE], encoded_rlp.to_vec().as_slice()].concat().into(); @@ -130,48 +142,53 @@ pub async fn new_eip712_transaction( /// Estimated gas from a ZK network. pub struct EstimatedGas { /// Estimated gas price. - pub price: rU256, + pub price: u128, /// Estimated gas limit. - pub limit: rU256, + pub limit: u128, } /// Estimates the gas parameters for the provided transaction. -pub async fn estimate_gas( - legacy_or_1559: &TypedTransaction, +pub async fn estimate_gas, T: Transport + Clone>( + tx: &WithOtherFields, factory_deps: Vec>, - provider: M, + provider: P, ) -> Result { - let to = legacy_or_1559 - .to() - .and_then(|to| to.as_address()) - .cloned() + let to = tx + .to + .and_then(|to| match to { + alloy_primitives::TxKind::Create => None, + alloy_primitives::TxKind::Call(to) => Some(to), + }) .ok_or_eyre("`to` cannot be empty")?; - let chain_id = legacy_or_1559.chain_id().ok_or_eyre("`chain_id` cannot be empty")?; - let nonce = legacy_or_1559.nonce().ok_or_eyre("`nonce` cannot be empty")?; - let gas_price = legacy_or_1559.gas_price().ok_or_eyre("`gas_price` cannot be empty")?; - let data = legacy_or_1559.data().cloned().ok_or_eyre("`data` cannot be empty")?; + let chain_id = tx.chain_id.ok_or_eyre("`chain_id` cannot be empty")?; + let nonce = tx.nonce.ok_or_eyre("`nonce` cannot be empty")?; + let gas_price = if let Some(gas_price) = tx.gas_price { + gas_price + } else { + provider.get_gas_price().await? + }; + let data = tx.input.clone().into_input().unwrap_or_default(); let custom_data = Eip712Meta::new().factory_deps(factory_deps); let mut deploy_request = Eip712TransactionRequest::new() .r#type(EIP712_TX_TYPE) - .to(to) - .chain_id(chain_id.as_u64()) + .to(to.to_h160()) + .chain_id(chain_id) .nonce(nonce) .gas_price(gas_price) - .data(data) + .data(data.to_ethers()) .custom_data(custom_data); - if let Some(from) = legacy_or_1559.from() { - deploy_request = deploy_request.from(*from) + if let Some(from) = tx.from { + deploy_request = deploy_request.from(from.to_h160()) } let gas_price = provider.get_gas_price().await.unwrap(); let fee: Fee = provider - .provider() - .request("zks_estimateFee", [deploy_request.clone()]) + .raw_request("zks_estimateFee".into(), [deploy_request.clone()]) .await .map_err(|err| eyre!("failed rpc call for estimating fee: {:?}", err))?; - Ok(EstimatedGas { price: gas_price.to_ru256(), limit: fee.gas_limit.to_ru256() }) + Ok(EstimatedGas { price: gas_price, limit: fee.gas_limit.low_u128() }) } /// Returns true if the provided address is a reserved zkSync system address diff --git a/crates/zksync/core/src/vm/env.rs b/crates/zksync/core/src/vm/env.rs index 394dac7a9..0eabbb1b4 100644 --- a/crates/zksync/core/src/vm/env.rs +++ b/crates/zksync/core/src/vm/env.rs @@ -36,8 +36,7 @@ pub(crate) fn create_l1_batch_env( max_virtual_blocks_to_create: 1, } }; - let (mut batch_number, mut batch_timestamp) = - if let Some(batch) = load_last_l1_batch(storage) { batch } else { (0, 0) }; + let (mut batch_number, mut batch_timestamp) = load_last_l1_batch(storage).unwrap_or_default(); batch_number += 1; diff --git a/crates/zksync/core/src/vm/inspect.rs b/crates/zksync/core/src/vm/inspect.rs index e34665d59..579b88682 100644 --- a/crates/zksync/core/src/vm/inspect.rs +++ b/crates/zksync/core/src/vm/inspect.rs @@ -68,7 +68,7 @@ pub type ZKVMResult = EVMResultGeneric; /// immediately. /// All logs will be collected as they happen, and returned with the final result. //TODO: should we make this transparent in `inspect` directly? -pub fn inspect_as_batch<'a, DB, E>( +pub fn inspect_as_batch( tx: L2Tx, ecx: &mut EvmContext, ccx: &mut CheatcodeTracerContext, @@ -125,7 +125,7 @@ where /// Processes a [`L2Tx`] with EraVM and returns the final execution result and logs. /// /// State changes will be reflected in the given `Env`, `DB`, `JournaledState`. -pub fn inspect<'a, DB, E>( +pub fn inspect( mut tx: L2Tx, ecx: &mut EvmContext, ccx: &mut CheatcodeTracerContext, diff --git a/crates/zksync/core/src/vm/runner.rs b/crates/zksync/core/src/vm/runner.rs index 708960ec6..25b1a40e8 100644 --- a/crates/zksync/core/src/vm/runner.rs +++ b/crates/zksync/core/src/vm/runner.rs @@ -40,7 +40,7 @@ where debug!(calldata = ?env.tx.data, fdeps = factory_deps.as_ref().map(|v| v.len()).unwrap_or_default(), "zk transact"); let mut journaled_state = JournaledState::new( SpecId::LATEST, - Precompiles::new(PrecompileSpecId::LATEST).addresses().into_iter().copied().collect(), + Precompiles::new(PrecompileSpecId::LATEST).addresses().copied().collect(), ); let mut ecx = EvmContext::new_with_env(db, Box::new(env.clone())); @@ -92,7 +92,7 @@ where } /// Retrieves L2 ETH balance for a given address. -pub fn balance<'a, DB>(address: Address, ecx: &mut EvmContext) -> rU256 +pub fn balance(address: Address, ecx: &mut EvmContext) -> rU256 where DB: Database, ::Error: Debug, @@ -103,7 +103,7 @@ where /// Retrieves bytecode hash stored at a given address. #[allow(dead_code)] -pub fn code_hash<'a, DB>(address: Address, ecx: &mut EvmContext) -> B256 +pub fn code_hash(address: Address, ecx: &mut EvmContext) -> B256 where DB: Database, ::Error: Debug, @@ -112,7 +112,7 @@ where } /// Retrieves nonce for a given address. -pub fn nonce<'a, DB>(address: Address, ecx: &mut EvmContext) -> u32 +pub fn nonce(address: Address, ecx: &mut EvmContext) -> u32 where DB: Database, ::Error: Debug, @@ -121,7 +121,7 @@ where } /// Executes a CREATE opcode on the ZK-VM. -pub fn create<'a, DB, E>( +pub fn create( call: &CreateInputs, contract: &DualCompiledContract, factory_deps: Vec>, @@ -173,7 +173,7 @@ where } /// Executes a CALL opcode on the ZK-VM. -pub fn call<'a, DB, E>( +pub fn call( call: &CallInputs, ecx: &mut EvmContext, mut ccx: CheatcodeTracerContext, @@ -230,7 +230,7 @@ where } /// Assign gas parameters that satisfy zkSync's fee model. -fn gas_params<'a, DB>(ecx: &mut EvmContext, caller: Address) -> (U256, U256) +fn gas_params(ecx: &mut EvmContext, caller: Address) -> (U256, U256) where DB: Database + Send, ::Error: Debug, diff --git a/crates/zksync/core/src/vm/tracer.rs b/crates/zksync/core/src/vm/tracer.rs index ad14d44c7..8dbf12280 100644 --- a/crates/zksync/core/src/vm/tracer.rs +++ b/crates/zksync/core/src/vm/tracer.rs @@ -107,7 +107,7 @@ pub struct CallContext { pub block_basefee: rU256, /// Whether the current call is a create. pub is_create: bool, - /// Wheter the current call is a static call. + /// Whether the current call is a static call. pub is_static: bool, } diff --git a/deny.toml b/deny.toml index fa335ee73..b7e5b7e2e 100644 --- a/deny.toml +++ b/deny.toml @@ -2,8 +2,13 @@ # More documentation for the advisories section can be found here: # https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html [advisories] -version = 2 +vulnerability = "deny" +unmaintained = "warn" yanked = "warn" +notice = "warn" +ignore = [ + "RUSTSEC-2023-0018", +] # This section is considered when running `cargo deny check bans`. # More documentation about the 'bans' section can be found here: @@ -34,18 +39,20 @@ confidence-threshold = 0.8 allow = [ "MIT", "Apache-2.0", - "Apache-2.0 WITH LLVM-exception", - "BSD-2-Clause", - "BSD-3-Clause", "ISC", + "Unlicense", + "MPL-2.0", "Unicode-DFS-2016", + "CC0-1.0", + "BSD-2-Clause", + "BSD-3-Clause", + "Zlib", "OpenSSL", - "Unicode-3.0", - "Unlicense", - "WTFPL", + "Apache-2.0 WITH LLVM-exception", "BSL-1.0", "0BSD", - "MPL-2.0", + "WTFPL", + "Unicode-3.0", ] # Allow 1 or more licenses on a per-crate basis, so that particular licenses diff --git a/testdata/cheats/Vm.sol b/testdata/cheats/Vm.sol index 097fa94d8..edf40f227 100644 --- a/testdata/cheats/Vm.sol +++ b/testdata/cheats/Vm.sol @@ -6,20 +6,130 @@ pragma solidity >=0.6.2 <0.9.0; pragma experimental ABIEncoderV2; interface Vm { - enum CallerMode { None, Broadcast, RecurrentBroadcast, Prank, RecurrentPrank } - enum AccountAccessKind { Call, DelegateCall, CallCode, StaticCall, Create, SelfDestruct, Resume, Balance, Extcodesize, Extcodehash, Extcodecopy } - enum ForgeContext { TestGroup, Test, Coverage, Snapshot, ScriptGroup, ScriptDryRun, ScriptBroadcast, ScriptResume, Unknown } - struct Log { bytes32[] topics; bytes data; address emitter; } - struct Rpc { string key; string url; } - struct EthGetLogs { address emitter; bytes32[] topics; bytes data; bytes32 blockHash; uint64 blockNumber; bytes32 transactionHash; uint64 transactionIndex; uint256 logIndex; bool removed; } - struct DirEntry { string errorMessage; string path; uint64 depth; bool isDir; bool isSymlink; } - struct FsMetadata { bool isDir; bool isSymlink; uint256 length; bool readOnly; uint256 modified; uint256 accessed; uint256 created; } - struct Wallet { address addr; uint256 publicKeyX; uint256 publicKeyY; uint256 privateKey; } - struct FfiResult { int32 exitCode; bytes stdout; bytes stderr; } - struct ChainInfo { uint256 forkId; uint256 chainId; } - struct AccountAccess { ChainInfo chainInfo; AccountAccessKind kind; address account; address accessor; bool initialized; uint256 oldBalance; uint256 newBalance; bytes deployedCode; uint256 value; bytes data; bool reverted; StorageAccess[] storageAccesses; uint64 depth; } - struct StorageAccess { address account; bytes32 slot; bool isWrite; bytes32 previousValue; bytes32 newValue; bool reverted; } - struct Gas { uint64 gasLimit; uint64 gasTotalUsed; uint64 gasMemoryUsed; int64 gasRefunded; uint64 gasRemaining; } + enum CallerMode { + None, + Broadcast, + RecurrentBroadcast, + Prank, + RecurrentPrank + } + enum AccountAccessKind { + Call, + DelegateCall, + CallCode, + StaticCall, + Create, + SelfDestruct, + Resume, + Balance, + Extcodesize, + Extcodehash, + Extcodecopy + } + enum ForgeContext { + TestGroup, + Test, + Coverage, + Snapshot, + ScriptGroup, + ScriptDryRun, + ScriptBroadcast, + ScriptResume, + Unknown + } + + struct Log { + bytes32[] topics; + bytes data; + address emitter; + } + + struct Rpc { + string key; + string url; + } + + struct EthGetLogs { + address emitter; + bytes32[] topics; + bytes data; + bytes32 blockHash; + uint64 blockNumber; + bytes32 transactionHash; + uint64 transactionIndex; + uint256 logIndex; + bool removed; + } + + struct DirEntry { + string errorMessage; + string path; + uint64 depth; + bool isDir; + bool isSymlink; + } + + struct FsMetadata { + bool isDir; + bool isSymlink; + uint256 length; + bool readOnly; + uint256 modified; + uint256 accessed; + uint256 created; + } + + struct Wallet { + address addr; + uint256 publicKeyX; + uint256 publicKeyY; + uint256 privateKey; + } + + struct FfiResult { + int32 exitCode; + bytes stdout; + bytes stderr; + } + + struct ChainInfo { + uint256 forkId; + uint256 chainId; + } + + struct AccountAccess { + ChainInfo chainInfo; + AccountAccessKind kind; + address account; + address accessor; + bool initialized; + uint256 oldBalance; + uint256 newBalance; + bytes deployedCode; + uint256 value; + bytes data; + bool reverted; + StorageAccess[] storageAccesses; + uint64 depth; + } + + struct StorageAccess { + address account; + bytes32 slot; + bool isWrite; + bytes32 previousValue; + bytes32 newValue; + bool reverted; + } + + struct Gas { + uint64 gasLimit; + uint64 gasTotalUsed; + uint64 gasMemoryUsed; + int64 gasRefunded; + uint64 gasRemaining; + } + function _expectCheatcodeRevert() external; function _expectCheatcodeRevert(bytes4 revertData) external; function _expectCheatcodeRevert(bytes calldata revertData) external; @@ -366,12 +476,18 @@ interface Vm { function parseJson(string calldata json) external pure returns (bytes memory abiEncodedData); function parseJson(string calldata json, string calldata key) external pure returns (bytes memory abiEncodedData); function parseTomlAddress(string calldata toml, string calldata key) external pure returns (address); - function parseTomlAddressArray(string calldata toml, string calldata key) external pure returns (address[] memory); + function parseTomlAddressArray(string calldata toml, string calldata key) + external + pure + returns (address[] memory); function parseTomlBool(string calldata toml, string calldata key) external pure returns (bool); function parseTomlBoolArray(string calldata toml, string calldata key) external pure returns (bool[] memory); function parseTomlBytes(string calldata toml, string calldata key) external pure returns (bytes memory); function parseTomlBytes32(string calldata toml, string calldata key) external pure returns (bytes32); - function parseTomlBytes32Array(string calldata toml, string calldata key) external pure returns (bytes32[] memory); + function parseTomlBytes32Array(string calldata toml, string calldata key) + external + pure + returns (bytes32[] memory); function parseTomlBytesArray(string calldata toml, string calldata key) external pure returns (bytes[] memory); function parseTomlInt(string calldata toml, string calldata key) external pure returns (int256); function parseTomlIntArray(string calldata toml, string calldata key) external pure returns (int256[] memory); @@ -464,11 +580,21 @@ interface Vm { external returns (string memory json); function serializeJson(string calldata objectKey, string calldata value) external returns (string memory json); - function serializeString(string calldata objectKey, string calldata valueKey, string calldata value) external returns (string memory json); - function serializeString(string calldata objectKey, string calldata valueKey, string[] calldata values) external returns (string memory json); - function serializeUintToHex(string calldata objectKey, string calldata valueKey, uint256 value) external returns (string memory json); - function serializeUint(string calldata objectKey, string calldata valueKey, uint256 value) external returns (string memory json); - function serializeUint(string calldata objectKey, string calldata valueKey, uint256[] calldata values) external returns (string memory json); + function serializeString(string calldata objectKey, string calldata valueKey, string calldata value) + external + returns (string memory json); + function serializeString(string calldata objectKey, string calldata valueKey, string[] calldata values) + external + returns (string memory json); + function serializeUintToHex(string calldata objectKey, string calldata valueKey, uint256 value) + external + returns (string memory json); + function serializeUint(string calldata objectKey, string calldata valueKey, uint256 value) + external + returns (string memory json); + function serializeUint(string calldata objectKey, string calldata valueKey, uint256[] calldata values) + external + returns (string memory json); function setEnv(string calldata name, string calldata value) external; function setNonce(address account, uint64 newNonce) external; function setNonceUnsafe(address account, uint64 newNonce) external; diff --git a/zk-tests/foundry.toml b/zk-tests/foundry.toml index 3d79bfcd7..f832875b5 100644 --- a/zk-tests/foundry.toml +++ b/zk-tests/foundry.toml @@ -11,4 +11,12 @@ no_zksync_reserved_addresses = true local = "${ERA_TEST_NODE_RPC_URL}" mainnet = "https://mainnet.era.zksync.io:443" testnet = "https://testnet.era.zksync.dev:443" + # See more config options https://github.com/foundry-rs/foundry/tree/master/config + +[profile.default.invariant] +runs = 10 +depth = 1 + +[etherscan] +testnet = { key = "PLACEHOLDER", chain = "300", url = "https://api-sepolia-era.zksync.network/api" } diff --git a/zk-tests/src/Deposit.sol b/zk-tests/src/Deposit.sol new file mode 100644 index 000000000..f6ccd4bc7 --- /dev/null +++ b/zk-tests/src/Deposit.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +contract Deposit { + address public seller = msg.sender; + mapping(address => uint256) public balance; + + function deposit() external payable { + balance[msg.sender] += msg.value; + } + + function withdraw() external { + uint256 amount = balance[msg.sender]; + balance[msg.sender] = 0; + (bool s, ) = msg.sender.call{value: amount}(""); + require(s, "failed to send"); + } +} diff --git a/zk-tests/src/Greeter.sol b/zk-tests/src/Greeter.sol index 94213410b..0989f53e6 100644 --- a/zk-tests/src/Greeter.sol +++ b/zk-tests/src/Greeter.sol @@ -1,8 +1,6 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; -import {console2 as console} from "forge-std/console2.sol"; - contract Greeter { string name; uint256 age; @@ -11,8 +9,10 @@ contract Greeter { function greeting(string memory _name) public returns (string memory) { name = _name; + string memory greet = string(abi.encodePacked("Hello ", _name)); emit Greet(greet); + return greet; } @@ -21,9 +21,10 @@ contract Greeter { uint256 n ) public returns (uint256) { name = _name; + string memory greet = string(abi.encodePacked("Hello ", _name)); - console.log(name); emit Greet(greet); + return n * 2; } diff --git a/zk-tests/src/InvariantDeposit.t.sol b/zk-tests/src/InvariantDeposit.t.sol new file mode 100644 index 000000000..4e53f890b --- /dev/null +++ b/zk-tests/src/InvariantDeposit.t.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; +import "forge-std/Test.sol"; +import "../src/Deposit.sol"; + +contract InvariantDeposit is Test { + // forge-config: default.invariant.runs = 2 + Deposit deposit; + + function setUp() external { + deposit = new Deposit(); + vm.deal(address(deposit), 100 ether); + } + + // forge-config: default.invariant.runs = 2 + function invariant_alwaysWithdrawable() external payable { + deposit.deposit{value: 1 ether}(); + uint256 balanceBefore = deposit.balance(address(this)); + assertEq(balanceBefore, 1 ether); + deposit.withdraw(); + uint256 balanceAfter = deposit.balance(address(this)); + assertGt(balanceBefore, balanceAfter); + } + + receive() external payable {} +} diff --git a/zk-tests/src/Maths.sol b/zk-tests/src/Maths.sol deleted file mode 100644 index 764242fde..000000000 --- a/zk-tests/src/Maths.sol +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -library Maths { - function square(uint256 x) public pure returns (uint256) { - return x * x; - } -} diff --git a/zk-tests/src/MissingLibraries.sol b/zk-tests/src/MissingLibraries.sol deleted file mode 100644 index 3314d9288..000000000 --- a/zk-tests/src/MissingLibraries.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {Maths} from "./Maths.sol"; -import 'forge-std/Script.sol'; - -contract Mathematician { - uint256 public number; - - constructor(uint256 _number) { - number = _number; - } - - function square() public view returns (uint256) { - return Maths.square(number); - } -} - -contract MathematicianScript is Script { - function run() external { - Mathematician maths = new Mathematician(2); - - assert(maths.square() == 4); - } -} diff --git a/zk-tests/src/NestedMaths.sol b/zk-tests/src/NestedMaths.sol deleted file mode 100644 index cb0a19c87..000000000 --- a/zk-tests/src/NestedMaths.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {Maths} from './Maths.sol'; - -library NestedMaths { - function square(uint256 x) public pure returns (uint256) { - return Maths.square(x); - } -} diff --git a/zk-tests/src/NestedMissingLibraries.sol b/zk-tests/src/NestedMissingLibraries.sol deleted file mode 100644 index 6b1b9050c..000000000 --- a/zk-tests/src/NestedMissingLibraries.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {NestedMaths} from "./NestedMaths.sol"; -import 'forge-std/Script.sol'; - -contract NestedMathematician { - uint256 public number; - - constructor(uint256 _number) { - number = _number; - } - - function square() public view returns (uint256) { - return NestedMaths.square(number); - } -} - -contract NestedMathematicianScript is Script { - function run() external { - NestedMathematician maths = new NestedMathematician(2); - - assert(maths.square() == 4); - } -} diff --git a/zk-tests/test.sh b/zk-tests/test.sh index 44fa3c601..05fb72803 100755 --- a/zk-tests/test.sh +++ b/zk-tests/test.sh @@ -8,7 +8,7 @@ SOLC_VERSION=${SOLC_VERSION:-"v0.8.20"} SOLC="solc-${SOLC_VERSION}" FORGE="${REPO_ROOT}/target/release/forge" CAST="${REPO_ROOT}/target/release/cast" -ERA_TEST_NODE_VERSION="v0.1.0-alpha.15" +ERA_TEST_NODE_VERSION="v0.1.0-alpha.25" ERA_TEST_NODE_PID=0 RPC_URL="http://localhost:8011" PRIVATE_KEY="0x3d3cbc973389cb26f657686445bcc75662b415b656078503592ac8c1abb8810e" @@ -127,17 +127,6 @@ build_forge "${REPO_ROOT}" start_era_test_node -# Test missing libraries detection and deploy -output=$(RUST_LOG=warn "${FORGE}" build --zk-compile 2>&1 || true) - -if echo "$output" | grep -q "Missing libraries detected"; then - RUST_LOG=warn "${FORGE}" create --deploy-missing-libraries --rpc-url $RPC_URL --private-key $PRIVATE_KEY --zk-compile - RUST_LOG=warn "${FORGE}" script ./src/MissingLibraries.sol:MathematicianScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --zk-startup --chain 260 --use "./${SOLC}" -vvv || fail "forge script with libs failed" - RUST_LOG=warn "${FORGE}" script ./src/NestedMissingLibraries.sol:NestedMathematicianScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --zk-startup --chain 260 --use "./${SOLC}" -vvv || fail "forge script with nested libs failed" -else - echo "No missing libraries detected." -fi - echo "Running tests..." RUST_LOG=warn "${FORGE}" test --use "./${SOLC}" --chain 300 -vvv --zk-compile || fail "forge test failed"