diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a45b9c3b..9edb5bc9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,7 +11,7 @@ # Evidence :camera: Include screenshots, screen recordings, or `console` output here demonstrating that your changes work as intended - + -# Notes :memo: -* Any notes/thoughts that the reviewers should know prior to reviewing the code? + diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 312a3320..ff457b80 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -31,6 +31,8 @@ jobs: uses: actions/checkout@v3 - name: Setup Pages uses: actions/configure-pages@v3 + - name: Install mdbook + run: cargo install mdbook - name: Generate rust docs run: | echo "Generating docs..." @@ -50,6 +52,10 @@ jobs: If you are not redirected automatically, follow this link to example. ' > ./target/doc/index.html + - name: Generate rustbook + run: | + make book + cp -r docs/rustbook/book target/doc - name: Fix permissions run: | chmod -c -R +rX "target/doc/" | while read line; do diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index cb23cbba..4db7e764 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -4,7 +4,11 @@ on: jobs: e2e: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] name: e2e steps: - uses: actions/checkout@v3 @@ -20,13 +24,13 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v3 with: - name: era_test_node-ubuntu-latest.tar.gz + name: era_test_node-${{ matrix.os }}.tar.gz - name: Start the era_test_node id: start_node run: | echo "Extracting era_test_node binary" - tar -xzf era_test_node-ubuntu-latest.tar.gz + tar -xzf era_test_node-${{ matrix.os }}.tar.gz chmod +x era_test_node echo "Starting node in background" ./era_test_node run 2>&1 | tee era_test_node_output.log & diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 487e1ca3..bdcadb5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,12 +28,12 @@ jobs: name: build release strategy: matrix: - # TODO: fix and add aarch64-unknown-linux-gnu target - # See: https://github.com/matter-labs/era-test-node/issues/56 - arch: [x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin] + arch: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin] include: - arch: x86_64-unknown-linux-gnu platform: ubuntu-20.04 + - arch: aarch64-unknown-linux-gnu + platform: ubuntu-20.04 - arch: x86_64-apple-darwin platform: macos-latest - arch: aarch64-apple-darwin @@ -131,7 +131,7 @@ jobs: echo "CONTRIBUTORS<> $GITHUB_OUTPUT echo "$(git log --pretty=format:"- %aN (%aE)" $(git describe --tags --abbrev=0 ${{ env.VERSION }}^)..${{ env.VERSION }} | sort | uniq)" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - + - name: Create release draft env: GITHUB_USER: ${{ github.repository_owner }} @@ -140,17 +140,18 @@ jobs: # The formatting here is borrowed from reth which borrowed it from Lighthouse (which is borrowed from OpenEthereum): https://github.com/openethereum/openethereum/blob/main/.github/workflows/build.yml run: | body=$(cat <<- "ENDBODY" - Release: ${{ env.VERSION }} - + + ## 📋 Summary - 🐛 **Bug Fixes:** + ### 🐛 Bug Fixes: - TBD - ✨ **New Features:** + ### ✨ New Features: - TBD - ⚠️ **Breaking Changes:** + ### ⚠️ Breaking Changes: - TBD ## 📜 All Changes @@ -166,6 +167,7 @@ jobs: | System | Architecture | Binary | |:---:|:---:|:---:| | | x86_64 | [era-test-node-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/era_test_node-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz) | + | | aarch64 | [era-test-node-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/era_test_node-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz) | | | x86_64 | [era-test-node-${{ env.VERSION }}-x86_64-apple-darwin.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/era_test_node-${{ env.VERSION }}-x86_64-apple-darwin.tar.gz) | | | aarch64 | [era-test-node-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/era_test_node-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz) | | | | | @@ -173,7 +175,7 @@ jobs: ) assets=() for asset in ./era_test_node-*.tar.gz*; do - assets+=("-a" "$asset/$asset") + assets+=("$asset/$asset") done tag_name="${{ env.VERSION }}" - echo "$body" | hub release create --draft "${assets[@]}" -F "-" "$tag_name" \ No newline at end of file + echo "$body" | gh release create "$tag_name" "${assets[@]}" --draft -F "-" -t "Release: $tag_name" \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 42177043..e9a9ed64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,16 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + [[package]] name = "actix-codec" version = "0.5.1" @@ -70,7 +80,7 @@ dependencies = [ "tokio", "tokio-util 0.7.8", "tracing", - "zstd", + "zstd 0.12.4", ] [[package]] @@ -233,7 +243,18 @@ checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" dependencies = [ "aes-soft", "aesni", - "cipher", + "cipher 0.2.5", +] + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.4.4", + "cpufeatures", ] [[package]] @@ -244,8 +265,8 @@ checksum = "7729c3cde54d67063be556aeac75a81330d802f0259500ca40cb52967f975763" dependencies = [ "aes-soft", "aesni", - "cipher", - "ctr", + "cipher 0.2.5", + "ctr 0.6.0", ] [[package]] @@ -254,7 +275,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" dependencies = [ - "cipher", + "cipher 0.2.5", "opaque-debug 0.3.0", ] @@ -264,7 +285,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" dependencies = [ - "cipher", + "cipher 0.2.5", "opaque-debug 0.3.0", ] @@ -442,6 +463,15 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + [[package]] name = "async-compression" version = "0.4.1" @@ -454,8 +484,8 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "zstd", - "zstd-safe", + "zstd 0.12.4", + "zstd-safe 6.0.6", ] [[package]] @@ -500,6 +530,17 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures 0.3.28", + "pharos", + "rustc_version", +] + [[package]] name = "atoi" version = "0.4.0" @@ -520,6 +561,18 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "auto_impl" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "0.1.8" @@ -616,6 +669,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -634,6 +693,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + [[package]] name = "beef" version = "0.5.2" @@ -731,6 +796,15 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + [[package]] name = "bit-vec" version = "0.6.3" @@ -876,7 +950,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" dependencies = [ "block-padding 0.2.1", - "cipher", + "cipher 0.2.5", ] [[package]] @@ -903,14 +977,14 @@ dependencies = [ "bincode", "blake2 0.10.6", "const_format", - "convert_case 0.4.0", - "crossbeam 0.7.3", + "convert_case 0.6.0", + "crossbeam 0.8.2", "crypto-bigint 0.5.3", "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", "derivative", "ethereum-types 0.14.1", "firestorm", - "itertools", + "itertools 0.10.5", "lazy_static", "num-modular", "num_cpus", @@ -946,6 +1020,16 @@ dependencies = [ "alloc-stdlib", ] +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "sha2 0.10.6", + "tinyvec", +] + [[package]] name = "bstr" version = "0.2.17" @@ -1012,6 +1096,9 @@ name = "bytes" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +dependencies = [ + "serde", +] [[package]] name = "bytestring" @@ -1022,6 +1109,16 @@ dependencies = [ "bytes 1.4.0", ] +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + [[package]] name = "bzip2-sys" version = "0.1.11+1.0.8" @@ -1064,6 +1161,20 @@ dependencies = [ "serde_json", ] +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cc" version = "1.0.83" @@ -1119,6 +1230,16 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "circuit_definitions" version = "0.1.0" @@ -1243,6 +1364,58 @@ dependencies = [ "indexmap 1.9.3", ] +[[package]] +name = "coins-bip32" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" +dependencies = [ + "bs58", + "coins-core", + "digest 0.10.7", + "hmac 0.12.1", + "k256 0.13.1", + "serde", + "sha2 0.10.6", + "thiserror", +] + +[[package]] +name = "coins-bip39" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" +dependencies = [ + "bitvec 1.0.1", + "coins-bip32", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.12.2", + "rand 0.8.5", + "sha2 0.10.6", + "thiserror", +] + +[[package]] +name = "coins-core" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" +dependencies = [ + "base64 0.21.2", + "bech32", + "bs58", + "digest 0.10.7", + "generic-array 0.14.7", + "hex", + "ripemd", + "serde", + "serde_derive", + "sha2 0.10.6", + "sha3 0.10.6", + "thiserror", +] + [[package]] name = "colorchoice" version = "1.0.0" @@ -1270,6 +1443,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "const-hex" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c37be52ef5e3b394db27a2341010685ad5103c72ac15ce2e9420a7e8f93f342c" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "hex", + "serde", +] + [[package]] name = "const-oid" version = "0.7.1" @@ -1556,8 +1741,10 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", + "zeroize", ] [[package]] @@ -1619,7 +1806,16 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" dependencies = [ - "cipher", + "cipher 0.2.5", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher 0.4.4", ] [[package]] @@ -1674,12 +1870,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.14.0", + "hashbrown 0.14.2", "lock_api", "once_cell", "parking_lot_core 0.9.8", ] +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + [[package]] name = "debugid" version = "0.8.0" @@ -1687,7 +1889,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid", + "uuid 1.4.1", ] [[package]] @@ -1711,6 +1913,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid 0.9.5", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.8" @@ -1769,6 +1981,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid 0.9.5", "crypto-common", "subtle", ] @@ -1779,7 +1992,26 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", ] [[package]] @@ -1793,6 +2025,29 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + [[package]] name = "dotenv" version = "0.15.0" @@ -1805,6 +2060,12 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + [[package]] name = "ecdsa" version = "0.14.8" @@ -1812,9 +2073,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ "der 0.6.1", - "elliptic-curve", - "rfc6979", - "signature", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + +[[package]] +name = "ecdsa" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +dependencies = [ + "der 0.7.8", + "digest 0.10.7", + "elliptic-curve 0.13.6", + "rfc6979 0.4.0", + "signature 2.1.0", + "spki 0.7.2", ] [[package]] @@ -1832,16 +2107,35 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "base16ct", + "base16ct 0.1.1", "crypto-bigint 0.4.9", "der 0.6.1", "digest 0.10.7", - "ff", + "ff 0.12.1", "generic-array 0.14.7", - "group", + "group 0.12.1", "pkcs8 0.9.0", "rand_core 0.6.4", - "sec1", + "sec1 0.3.0", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.3", + "digest 0.10.7", + "ff 0.13.0", + "generic-array 0.14.7", + "group 0.13.0", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -1855,6 +2149,15 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "ena" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +dependencies = [ + "log", +] + [[package]] name = "encoding_rs" version = "0.8.32" @@ -1864,6 +2167,24 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "enr" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" +dependencies = [ + "base64 0.21.2", + "bytes 1.4.0", + "hex", + "k256 0.13.1", + "log", + "rand 0.8.5", + "rlp", + "serde", + "sha3 0.10.6", + "zeroize", +] + [[package]] name = "env_logger" version = "0.9.3" @@ -1877,6 +2198,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "envy" version = "0.4.2" @@ -1898,20 +2232,22 @@ version = "0.1.0-alpha.5" dependencies = [ "anyhow", "bigdecimal", + "chrono", "clap 4.3.23", "colored", "ethabi 16.0.0", + "ethers", "eyre", "futures 0.3.28", "hex", "httptest", - "itertools", + "indexmap 2.0.2", + "itertools 0.10.5", "jsonrpc-core 18.0.0 (git+https://github.com/matter-labs/jsonrpc.git?branch=master)", "jsonrpc-core-client", "jsonrpc-derive", "jsonrpc-http-server", "lazy_static", - "log", "maplit", "once_cell", "openssl-sys", @@ -1919,13 +2255,12 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "simplelog", "tempdir", "tokio", "tracing", "tracing-subscriber", - "vlog", "vm", + "zksync-web3-rs", "zksync_basic_types", "zksync_contracts", "zksync_core", @@ -1965,6 +2300,28 @@ dependencies = [ "version_check", ] +[[package]] +name = "eth-keystore" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" +dependencies = [ + "aes 0.8.3", + "ctr 0.9.2", + "digest 0.10.7", + "hex", + "hmac 0.12.1", + "pbkdf2 0.11.0", + "rand 0.8.5", + "scrypt 0.10.0", + "serde", + "serde_json", + "sha2 0.10.6", + "sha3 0.10.6", + "thiserror", + "uuid 0.8.2", +] + [[package]] name = "ethabi" version = "16.0.0" @@ -2018,8 +2375,10 @@ checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ "crunchy", "fixed-hash 0.8.0", + "impl-codec 0.6.0", "impl-rlp", "impl-serde 0.4.0", + "scale-info", "tiny-keccak 2.0.2", ] @@ -2045,12 +2404,261 @@ checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ "ethbloom 0.13.0", "fixed-hash 0.8.0", + "impl-codec 0.6.0", "impl-rlp", "impl-serde 0.4.0", "primitive-types 0.12.1", + "scale-info", "uint", ] +[[package]] +name = "ethers" +version = "2.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b4026b97da8281276744741fac7eb385da905f6093c583331fa2953fdd4253" +dependencies = [ + "ethers-addressbook", + "ethers-contract", + "ethers-core", + "ethers-etherscan", + "ethers-middleware", + "ethers-providers", + "ethers-signers", + "ethers-solc", +] + +[[package]] +name = "ethers-addressbook" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e9e8acd0ed348403cc73a670c24daba3226c40b98dc1a41903766b3ab6240a" +dependencies = [ + "ethers-core", + "once_cell", + "serde", + "serde_json", +] + +[[package]] +name = "ethers-contract" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d79269278125006bb0552349c03593ffa9702112ca88bc7046cc669f148fb47c" +dependencies = [ + "const-hex", + "ethers-contract-abigen", + "ethers-contract-derive", + "ethers-core", + "ethers-providers", + "futures-util", + "once_cell", + "pin-project", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "ethers-contract-abigen" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce95a43c939b2e4e2f3191c5ad4a1f279780b8a39139c9905b43a7433531e2ab" +dependencies = [ + "Inflector", + "const-hex", + "dunce", + "ethers-core", + "ethers-etherscan", + "eyre", + "prettyplease", + "proc-macro2 1.0.66", + "quote 1.0.33", + "regex", + "reqwest", + "serde", + "serde_json", + "syn 2.0.29", + "toml 0.7.8", + "walkdir", +] + +[[package]] +name = "ethers-contract-derive" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9ce44906fc871b3ee8c69a695ca7ec7f70e50cb379c9b9cb5e532269e492f6" +dependencies = [ + "Inflector", + "const-hex", + "ethers-contract-abigen", + "ethers-core", + "proc-macro2 1.0.66", + "quote 1.0.33", + "serde_json", + "syn 2.0.29", +] + +[[package]] +name = "ethers-core" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0a17f0708692024db9956b31d7a20163607d2745953f5ae8125ab368ba280ad" +dependencies = [ + "arrayvec 0.7.4", + "bytes 1.4.0", + "cargo_metadata 0.17.0", + "chrono", + "const-hex", + "elliptic-curve 0.13.6", + "ethabi 18.0.0", + "generic-array 0.14.7", + "k256 0.13.1", + "num_enum 0.7.0", + "once_cell", + "open-fastrlp", + "rand 0.8.5", + "rlp", + "serde", + "serde_json", + "strum 0.25.0", + "syn 2.0.29", + "tempfile", + "thiserror", + "tiny-keccak 2.0.2", + "unicode-xid 0.2.4", +] + +[[package]] +name = "ethers-etherscan" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e53451ea4a8128fbce33966da71132cf9e1040dcfd2a2084fd7733ada7b2045" +dependencies = [ + "ethers-core", + "reqwest", + "semver", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "ethers-middleware" +version = "2.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0c339aad74ae5c451d27e0e49c7a3c7d22620b119b4f9291d7aa21f72d7f366" +dependencies = [ + "async-trait", + "auto_impl", + "ethers-contract", + "ethers-core", + "ethers-etherscan", + "ethers-providers", + "ethers-signers", + "futures-channel", + "futures-locks", + "futures-util", + "instant", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", + "url", +] + +[[package]] +name = "ethers-providers" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6838fa110e57d572336178b7c79e94ff88ef976306852d8cb87d9e5b1fc7c0b5" +dependencies = [ + "async-trait", + "auto_impl", + "base64 0.21.2", + "bytes 1.4.0", + "const-hex", + "enr", + "ethers-core", + "futures-core", + "futures-timer", + "futures-util", + "hashers", + "http", + "instant", + "jsonwebtoken", + "once_cell", + "pin-project", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-tungstenite", + "tracing", + "tracing-futures", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "ws_stream_wasm", +] + +[[package]] +name = "ethers-signers" +version = "2.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4864d387456a9c09a1157fa10e1528b29d90f1d859443acf06a1b23365fb518c" +dependencies = [ + "async-trait", + "coins-bip32", + "coins-bip39", + "elliptic-curve 0.13.6", + "eth-keystore", + "ethers-core", + "hex", + "rand 0.8.5", + "sha2 0.10.6", + "thiserror", + "tracing", +] + +[[package]] +name = "ethers-solc" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de34e484e7ae3cab99fbfd013d6c5dc7f9013676a4e0e414d8b12e1213e8b3ba" +dependencies = [ + "cfg-if 1.0.0", + "const-hex", + "dirs 5.0.1", + "dunce", + "ethers-core", + "glob", + "home", + "md-5", + "num_cpus", + "once_cell", + "path-slash", + "rayon", + "regex", + "semver", + "serde", + "serde_json", + "solang-parser", + "svm-rs", + "thiserror", + "tiny-keccak 2.0.2", + "tokio", + "tracing", + "walkdir", + "yansi", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -2098,6 +2706,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "ff_ce" version = "0.14.3" @@ -2168,6 +2786,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.27" @@ -2223,7 +2847,7 @@ dependencies = [ "digest 0.9.0", "hex", "indexmap 1.9.3", - "itertools", + "itertools 0.10.5", "lazy_static", "num-bigint 0.4.3", "num-derive 0.2.5", @@ -2255,7 +2879,7 @@ dependencies = [ "digest 0.9.0", "hex", "indexmap 1.9.3", - "itertools", + "itertools 0.10.5", "lazy_static", "num-bigint 0.4.3", "num-derive 0.2.5", @@ -2270,6 +2894,16 @@ dependencies = [ "tiny-keccak 1.5.0", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -2370,6 +3004,16 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +[[package]] +name = "futures-locks" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" +dependencies = [ + "futures-channel", + "futures-task", +] + [[package]] name = "futures-macro" version = "0.3.28" @@ -2400,7 +3044,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" dependencies = [ "gloo-timers", - "send_wrapper", + "send_wrapper 0.4.0", ] [[package]] @@ -2422,6 +3066,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -2439,6 +3092,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -2629,7 +3283,18 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ - "ff", + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", "rand_core 0.6.4", "subtle", ] @@ -2693,9 +3358,18 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" + +[[package]] +name = "hashers" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" +dependencies = [ + "fxhash", +] [[package]] name = "hashlink" @@ -3062,12 +3736,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", ] [[package]] @@ -3130,6 +3813,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -3454,9 +4146,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ "cfg-if 1.0.0", - "ecdsa", - "elliptic-curve", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.6", +] + +[[package]] +name = "k256" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa 0.16.8", + "elliptic-curve 0.13.6", + "once_cell", "sha2 0.10.6", + "signature 2.1.0", ] [[package]] @@ -3478,6 +4184,32 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "lalrpop" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83be602e051ada38d90c7841092adabeb585197afe9dabb20e4f8375cc87846e" +dependencies = [ + "ascii-canvas", + "bit-set", + "ena", + "itertools 0.11.0", + "lalrpop-util", + "petgraph", + "regex", + "regex-syntax 0.7.4", + "string_cache", + "term", + "tiny-keccak 2.0.2", + "unicode-xid 0.2.4", +] + +[[package]] +name = "lalrpop-util" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "365d88f9d803538a06641e6736f21d95ecf9226dc1693421212e62c405cdd199" + [[package]] name = "language-tags" version = "0.3.2" @@ -3855,13 +4587,14 @@ dependencies = [ [[package]] name = "multivm" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "vlog", "vm", "vm_1_3_2", "vm_m5", "vm_m6", + "vm_virtual_blocks", "zksync_contracts", "zksync_state", "zksync_types", @@ -3897,6 +4630,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + [[package]] name = "nix" version = "0.26.2" @@ -4139,7 +4878,16 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70bf6736f74634d299d00086f02986875b3c2d924781a6a2cb6c201e73da0ceb" +dependencies = [ + "num_enum_derive 0.7.0", ] [[package]] @@ -4155,12 +4903,15 @@ dependencies = [ ] [[package]] -name = "num_threads" -version = "0.1.6" +name = "num_enum_derive" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "56ea360eafe1022f7cc56cd7b869ed57330fb2453d0c7831d99b74c65d2f5597" dependencies = [ - "libc", + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", ] [[package]] @@ -4190,6 +4941,31 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec 0.7.4", + "auto_impl", + "bytes 1.4.0", + "ethereum-types 0.14.1", + "open-fastrlp-derive", +] + +[[package]] +name = "open-fastrlp-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +dependencies = [ + "bytes 1.4.0", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + [[package]] name = "openssl" version = "0.10.56" @@ -4244,6 +5020,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "os_info" version = "3.7.0" @@ -4302,7 +5084,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b92ea9ddac0d6e1db7c49991e7d397d34a9fd814b4c93cda53788e8eef94e35" dependencies = [ - "aes", + "aes 0.6.0", "aes-ctr", "block-modes", "digest 0.9.0", @@ -4312,7 +5094,7 @@ dependencies = [ "pbkdf2 0.7.5", "ripemd160", "rustc-hex", - "scrypt", + "scrypt 0.5.0", "secp256k1 0.20.3", "sha2 0.9.9", "subtle", @@ -4448,12 +5230,29 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + [[package]] name = "pbkdf2" version = "0.6.0" @@ -4472,10 +5271,32 @@ dependencies = [ "base64ct", "crypto-mac 0.10.1", "hmac 0.10.1", - "password-hash", + "password-hash 0.1.4", "sha2 0.9.9", ] +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", + "password-hash 0.4.2", + "sha2 0.10.6", +] + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -4550,6 +5371,77 @@ dependencies = [ "sha2 0.10.6", ] +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.0.2", +] + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures 0.3.28", + "rustc_version", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared 0.11.2", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" version = "1.1.3" @@ -4614,6 +5506,16 @@ dependencies = [ "spki 0.6.0", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.8", + "spki 0.7.2", +] + [[package]] name = "pkg-config" version = "0.3.27" @@ -4632,6 +5534,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + [[package]] name = "prettyplease" version = "0.2.12" @@ -4665,6 +5573,7 @@ dependencies = [ "impl-codec 0.6.0", "impl-rlp", "impl-serde 0.4.0", + "scale-info", "uint", ] @@ -4674,7 +5583,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml", + "toml 0.5.11", ] [[package]] @@ -4684,7 +5593,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit 0.19.14", + "toml_edit 0.19.15", ] [[package]] @@ -4761,7 +5670,7 @@ dependencies = [ [[package]] name = "prometheus_exporter" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "metrics", @@ -5254,6 +6163,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + [[package]] name = "ring" version = "0.16.20" @@ -5269,6 +6188,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "ripemd160" version = "0.9.1" @@ -5287,9 +6215,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes 1.4.0", + "rlp-derive", "rustc-hex", ] +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + [[package]] name = "rocksdb" version = "0.21.0" @@ -5421,7 +6361,16 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "399f290ffc409596022fce5ea5d4138184be4784f2b28c62c59f0d8389059a15" dependencies = [ - "cipher", + "cipher 0.2.5", +] + +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher 0.4.4", ] [[package]] @@ -5433,6 +6382,30 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scale-info" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +dependencies = [ + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec 3.6.4", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + [[package]] name = "schannel" version = "0.1.22" @@ -5459,11 +6432,23 @@ dependencies = [ "pbkdf2 0.6.0", "rand 0.7.3", "rand_core 0.5.1", - "salsa20", + "salsa20 0.7.2", "sha2 0.9.9", "subtle", ] +[[package]] +name = "scrypt" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.11.0", + "salsa20 0.10.2", + "sha2 0.10.6", +] + [[package]] name = "sct" version = "0.7.0" @@ -5480,7 +6465,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "base16ct", + "base16ct 0.1.1", "der 0.6.1", "generic-array 0.14.7", "pkcs8 0.9.0", @@ -5488,6 +6473,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.8", + "generic-array 0.14.7", + "pkcs8 0.10.2", + "subtle", + "zeroize", +] + [[package]] name = "secp256k1" version = "0.20.3" @@ -5563,6 +6562,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + [[package]] name = "sentry" version = "0.31.5" @@ -5668,7 +6673,7 @@ dependencies = [ "thiserror", "time", "url", - "uuid", + "uuid 1.4.1", ] [[package]] @@ -5712,6 +6717,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -5874,6 +6888,16 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + [[package]] name = "simple_asn1" version = "0.6.2" @@ -5887,15 +6911,10 @@ dependencies = [ ] [[package]] -name = "simplelog" -version = "0.12.1" +name = "siphasher" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" -dependencies = [ - "log", - "termcolor", - "time", -] +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "skeptic" @@ -5904,7 +6923,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" dependencies = [ "bytecount", - "cargo_metadata", + "cargo_metadata 0.14.2", "error-chain", "glob", "pulldown-cmark", @@ -5984,6 +7003,20 @@ dependencies = [ "sha-1 0.9.8", ] +[[package]] +name = "solang-parser" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cb9fa2fa2fa6837be8a2495486ff92e3ffe68a99b6eeba288e139efdd842457" +dependencies = [ + "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "phf", + "thiserror", + "unicode-xid 0.2.4", +] + [[package]] name = "spin" version = "0.5.2" @@ -6010,6 +7043,16 @@ dependencies = [ "der 0.6.1", ] +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.8", +] + [[package]] name = "splitmut" version = "0.2.1" @@ -6022,7 +7065,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" dependencies = [ - "itertools", + "itertools 0.10.5", "nom", "unicode_categories", ] @@ -6053,7 +7096,7 @@ dependencies = [ "chrono", "crc", "crossbeam-queue 0.3.8", - "dirs", + "dirs 4.0.0", "either", "event-listener", "futures-channel", @@ -6136,6 +7179,19 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot 0.12.1", + "phf_shared 0.10.0", + "precomputed-hash", +] + [[package]] name = "stringprep" version = "0.1.3" @@ -6188,7 +7244,16 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros", + "strum_macros 0.24.3", +] + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros 0.25.3", ] [[package]] @@ -6204,12 +7269,45 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck 0.4.1", + "proc-macro2 1.0.66", + "quote 1.0.33", + "rustversion", + "syn 2.0.29", +] + [[package]] name = "subtle" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "svm-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597e3a746727984cb7ea2487b6a40726cad0dbe86628e7d429aa6b8c4c153db4" +dependencies = [ + "dirs 5.0.1", + "fs2", + "hex", + "once_cell", + "reqwest", + "semver", + "serde", + "serde_json", + "sha2 0.10.6", + "thiserror", + "url", + "zip", +] + [[package]] name = "syn" version = "0.15.44" @@ -6253,7 +7351,7 @@ dependencies = [ "derivative", "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=dev)", "hex", - "itertools", + "itertools 0.10.5", "num-bigint 0.4.3", "num-derive 0.3.3", "num-integer", @@ -6310,6 +7408,17 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi 0.3.9", +] + [[package]] name = "termcolor" version = "1.1.3" @@ -6377,8 +7486,6 @@ checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" dependencies = [ "deranged", "itoa", - "libc", - "num_threads", "serde", "time-core", "time-macros", @@ -6493,6 +7600,21 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki-roots 0.25.2", +] + [[package]] name = "tokio-util" version = "0.6.10" @@ -6531,11 +7653,26 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + [[package]] name = "toml_datetime" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -6545,16 +7682,18 @@ checksum = "5376256e44f2443f8896ac012507c19a012df0fe8758b55246ae51a2279db51f" dependencies = [ "combine", "indexmap 1.9.3", - "itertools", + "itertools 0.10.5", ] [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -6607,7 +7746,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", - "uuid", + "uuid 1.4.1", ] [[package]] @@ -6656,6 +7795,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.1.3" @@ -6711,6 +7860,26 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes 1.4.0", + "data-encoding", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "typenum" version = "1.16.0" @@ -6851,12 +8020,28 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf8parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom 0.2.10", + "serde", +] + [[package]] name = "uuid" version = "1.4.1" @@ -6929,7 +8114,7 @@ dependencies = [ [[package]] name = "vlog" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "chrono", "sentry", @@ -6941,16 +8126,16 @@ dependencies = [ [[package]] name = "vm" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "hex", - "itertools", + "itertools 0.10.5", "once_cell", "thiserror", "tracing", "vise", - "zk_evm 1.3.3", + "zk_evm 1.4.0", "zksync_config", "zksync_contracts", "zksync_state", @@ -6961,12 +8146,12 @@ dependencies = [ [[package]] name = "vm_1_3_2" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "ethabi 18.0.0", "hex", - "itertools", + "itertools 0.10.5", "once_cell", "thiserror", "tracing", @@ -6982,10 +8167,10 @@ dependencies = [ [[package]] name = "vm_m5" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "hex", - "itertools", + "itertools 0.10.5", "once_cell", "thiserror", "tracing", @@ -7003,10 +8188,10 @@ dependencies = [ [[package]] name = "vm_m6" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "hex", - "itertools", + "itertools 0.10.5", "once_cell", "thiserror", "tracing", @@ -7022,6 +8207,26 @@ dependencies = [ "zksync_utils", ] +[[package]] +name = "vm_virtual_blocks" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" +dependencies = [ + "anyhow", + "hex", + "itertools 0.10.5", + "once_cell", + "thiserror", + "tracing", + "vise", + "zk_evm 1.3.3", + "zksync_config", + "zksync_contracts", + "zksync_state", + "zksync_types", + "zksync_utils", +] + [[package]] name = "walkdir" version = "2.3.3" @@ -7351,6 +8556,25 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "ws_stream_wasm" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" +dependencies = [ + "async_io_stream", + "futures 0.3.28", + "js-sys", + "log", + "pharos", + "rustc_version", + "send_wrapper 0.6.0", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wyz" version = "0.2.0" @@ -7366,19 +8590,45 @@ dependencies = [ "tap", ] +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + [[package]] name = "zeroize" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes 0.8.3", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils 0.8.16", + "flate2", + "hmac 0.12.1", + "pbkdf2 0.11.0", + "sha1", + "time", + "zstd 0.11.2+zstd.1.5.2", +] + [[package]] name = "zk_evm" version = "1.3.1" source = "git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.1-rc0#877ba31cc1d82316fd924e8d83a9f5f1a77b1b9a" dependencies = [ "blake2 0.10.6", - "k256", + "k256 0.11.6", "lazy_static", "num 0.4.1", "serde", @@ -7435,7 +8685,7 @@ name = "zkevm-assembly" version = "1.3.1" source = "git+https://github.com/matter-labs/era-zkEVM-assembly.git?tag=v1.3.1-rc0#dabbb07e84dd886ee90dde2b5dde0acbf9b0123a" dependencies = [ - "env_logger", + "env_logger 0.9.3", "hex", "lazy_static", "log", @@ -7454,7 +8704,7 @@ name = "zkevm-assembly" version = "1.3.2" source = "git+https://github.com/matter-labs/era-zkEVM-assembly.git?branch=v1.3.2#3c61d450cbe6548068be8f313ed02f1bd229a865" dependencies = [ - "env_logger", + "env_logger 0.9.3", "hex", "lazy_static", "log", @@ -7479,7 +8729,7 @@ dependencies = [ "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", "derivative", "hex", - "itertools", + "itertools 0.10.5", "rand 0.4.6", "rand 0.8.5", "serde", @@ -7507,7 +8757,7 @@ dependencies = [ "bitflags 2.4.0", "blake2 0.10.6", "ethereum-types 0.14.1", - "k256", + "k256 0.11.6", "lazy_static", "sha2 0.10.6", "sha3 0.10.6", @@ -7523,7 +8773,7 @@ dependencies = [ "codegen 0.2.0", "crossbeam 0.8.2", "derivative", - "env_logger", + "env_logger 0.9.3", "hex", "num-bigint 0.4.3", "num-integer", @@ -7550,7 +8800,7 @@ dependencies = [ "codegen 0.2.0", "crossbeam 0.8.2", "derivative", - "env_logger", + "env_logger 0.9.3", "hex", "rayon", "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon.git?branch=poseidon2)", @@ -7564,19 +8814,41 @@ dependencies = [ "zkevm-assembly 1.3.2", ] +[[package]] +name = "zksync-web3-rs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bc9b106393359ac013c2527db318ced4ca838d26ef03488233af557ebe5da8" +dependencies = [ + "async-trait", + "clap 4.3.23", + "env_logger 0.10.0", + "ethers", + "ethers-contract", + "hex", + "lazy_static", + "log", + "serde", + "serde_json", + "sha2 0.9.9", + "thiserror", + "tokio", +] + [[package]] name = "zksync_basic_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "serde", + "serde_json", "web3", ] [[package]] name = "zksync_circuit_breaker" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7599,7 +8871,7 @@ dependencies = [ [[package]] name = "zksync_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "bigdecimal", @@ -7618,7 +8890,7 @@ dependencies = [ [[package]] name = "zksync_contracts" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "envy", "ethabi 18.0.0", @@ -7632,7 +8904,7 @@ dependencies = [ [[package]] name = "zksync_core" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "actix-cors", "actix-rt", @@ -7647,7 +8919,7 @@ dependencies = [ "futures 0.3.28", "governor", "hex", - "itertools", + "itertools 0.10.5", "jsonrpc-core 18.0.0 (git+https://github.com/matter-labs/jsonrpc.git?branch=master)", "jsonrpc-core-client", "jsonrpc-derive", @@ -7695,7 +8967,7 @@ dependencies = [ [[package]] name = "zksync_crypto" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "base64 0.13.1", "blake2 0.10.6", @@ -7710,19 +8982,19 @@ dependencies = [ [[package]] name = "zksync_dal" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "bigdecimal", "bincode", "hex", - "itertools", + "itertools 0.10.5", "num 0.3.1", "once_cell", "serde", "serde_json", "sqlx", - "strum", + "strum 0.24.1", "thiserror", "tokio", "tracing", @@ -7737,7 +9009,7 @@ dependencies = [ [[package]] name = "zksync_eth_client" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7757,7 +9029,7 @@ dependencies = [ [[package]] name = "zksync_eth_signer" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "async-trait", "hex", @@ -7776,7 +9048,7 @@ dependencies = [ [[package]] name = "zksync_health_check" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "async-trait", "futures 0.3.28", @@ -7789,7 +9061,7 @@ dependencies = [ [[package]] name = "zksync_mempool" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "tracing", "zksync_types", @@ -7798,7 +9070,7 @@ dependencies = [ [[package]] name = "zksync_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "leb128", "once_cell", @@ -7815,7 +9087,7 @@ dependencies = [ [[package]] name = "zksync_mini_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "once_cell", "zksync_basic_types", @@ -7825,7 +9097,7 @@ dependencies = [ [[package]] name = "zksync_object_store" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7843,7 +9115,7 @@ dependencies = [ [[package]] name = "zksync_prover_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7863,7 +9135,7 @@ dependencies = [ [[package]] name = "zksync_queued_job_processor" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7875,9 +9147,10 @@ dependencies = [ [[package]] name = "zksync_state" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", + "itertools 0.10.5", "metrics", "mini-moka", "tokio", @@ -7892,7 +9165,7 @@ dependencies = [ [[package]] name = "zksync_storage" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "num_cpus", "once_cell", @@ -7904,23 +9177,25 @@ dependencies = [ [[package]] name = "zksync_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "blake2 0.10.6", "chrono", "codegen 0.1.0", "ethereum-types 0.12.1", + "hex", "num 0.3.1", - "num_enum", + "num_enum 0.6.1", "once_cell", "parity-crypto", "rlp", "serde", "serde_json", "serde_with", - "strum", + "strum 0.24.1", "thiserror", "zk_evm 1.3.3", + "zk_evm 1.4.0", "zkevm_test_harness 1.3.3", "zksync_basic_types", "zksync_config", @@ -7932,13 +9207,13 @@ dependencies = [ [[package]] name = "zksync_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "bigdecimal", "futures 0.3.28", "hex", - "itertools", + "itertools 0.10.5", "metrics", "num 0.3.1", "reqwest", @@ -7954,14 +9229,14 @@ dependencies = [ [[package]] name = "zksync_verification_key_generator_and_server" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "bincode", "circuit_testing", "ff_ce", "hex", - "itertools", + "itertools 0.10.5", "once_cell", "serde_json", "structopt", @@ -7974,11 +9249,11 @@ dependencies = [ [[package]] name = "zksync_web3_decl" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "bigdecimal", "chrono", - "itertools", + "itertools 0.10.5", "jsonrpsee", "rlp", "serde", @@ -7987,13 +9262,32 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + [[package]] name = "zstd" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ - "zstd-safe", + "zstd-safe 6.0.6", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c602f2dc..b5802ed8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,15 +11,14 @@ categories = ["cryptography"] publish = false # We don't want to publish our binaries. [dependencies] -zksync_basic_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_core = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -vm = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -vlog = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_utils = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_state = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } +zksync_basic_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_core = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +vm = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_utils = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_state = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } @@ -48,11 +47,13 @@ bigdecimal = { version = "0.2.0" } hex = "0.4" ethabi = "16.0.0" itertools = "0.10.5" -log = "0.4.20" -simplelog = "0.12.1" rustc-hash = "1.1.0" +indexmap = "2.0.1" +chrono = { version = "0.4.31", default-features = false } [dev-dependencies] httptest = "0.15.4" tempdir = "0.3.7" -maplit = "1.0.2" \ No newline at end of file +maplit = "1.0.2" +zksync-web3-rs = "0.1.1" +ethers = { version = "2.0.4", features = ["rustls"] } \ No newline at end of file diff --git a/Makefile b/Makefile index ceabeed9..8ca281bc 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ clean-contracts: rebuild-contracts: cd etc/system-contracts && yarn build; yarn preprocess; yarn build-bootloader ./scripts/refresh_contracts.sh + ./scripts/refresh_test_contracts.sh # Build the Rust project rust-build: @@ -33,7 +34,7 @@ rust-doc: lint: cd e2e-tests && yarn && yarn lint && yarn fmt && yarn typecheck cargo fmt --all -- --check - cargo clippy -Zunstable-options -- -D warnings --allow clippy::unwrap_used + cargo clippy -p era_test_node -Zunstable-options -- -D warnings --allow clippy::unwrap_used # Fix lint errors for Rust code lint-fix: @@ -62,4 +63,8 @@ new-release-tag: echo "\n\033[0;32mGit tag creation SUCCESSFUL! Use the following command to push the tag:\033[0m" && \ echo "git push origin v$$VERSION_NUMBER" -.PHONY: build-contracts clean-contracts rebuild-contracts rust-build lint test test-e2e all clean build-% new-release-tag +# Create the rust book +book: + mdbook build docs/rustbook + +.PHONY: build-contracts clean-contracts rebuild-contracts rust-build lint test test-e2e all clean build-% new-release-tag book diff --git a/README.md b/README.md index b8936dc7..c043c102 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,14 @@ Please note that `era-test-node` is still in its **alpha** stage. Some features make run ``` +## 📄 System Contracts + +The system contract within the node can be specified via the `--dev-system-contracts` option. +It can take one of the following options: + * `built-in`: Use the compiled built-in contracts + * `built-in-no-verify`: Use the compiled built-in contracts, but without signature verification + * `local`: Load contracts from `ZKSYNC_HOME` + ## 📃 Logging The node may be started in either of `debug`, `info`, `warn` or `error` logging levels via the `--log` option: @@ -78,6 +86,8 @@ Additionally, the file path can be provided via the `--log-file-path` option (de era_test_node --log=error --log-file-path=run.log run ``` +The logging can be configured during runtime via the [`config_setLogLevel`](./SUPPORTED_APIS.md#config_setloglevel) and [`config_setLogging`](./SUPPORTED_APIS.md#config_setlogging) methods. + ## 📃 Caching The node will cache certain network request by default to disk in the `.cache` directory. Alternatively the caching can be disabled or set to in-memory only diff --git a/SUPPORTED_APIS.md b/SUPPORTED_APIS.md index df2c441d..0b5db81f 100644 --- a/SUPPORTED_APIS.md +++ b/SUPPORTED_APIS.md @@ -21,10 +21,12 @@ The `status` options are: | [`CONFIG`](#config-namespace) | [`config_setShowStorageLogs`](#config_setshowstoragelogs) | `SUPPORTED` | Updates `show_storage_logs` to print storage log reads/writes | | [`CONFIG`](#config-namespace) | [`config_setShowVmDetails`](#config_setshowvmdetails) | `SUPPORTED` | Updates `show_vm_details` to print more detailed results from vm execution | | [`CONFIG`](#config-namespace) | [`config_setShowGasDetails`](#config_setshowgasdetails) | `SUPPORTED` | Updates `show_gas_details` to print more details about gas estimation and usage | -| `DEBUG` | `debug_traceCall` | `NOT IMPLEMENTED`
[GitHub Issue #61](https://github.com/matter-labs/era-test-node/issues/61) | Performs a call and returns structured traces of the execution | -| `DEBUG` | `debug_traceBlockByHash` | `NOT IMPLEMENTED`
[GitHub Issue #63](https://github.com/matter-labs/era-test-node/issues/63) | Returns structured traces for operations within the block of the specified block hash | -| `DEBUG` | `debug_traceBlockByNumber` | `NOT IMPLEMENTED`
[GitHub Issue #64](https://github.com/matter-labs/era-test-node/issues/64) | Returns structured traces for operations within the block of the specified block number | -| `DEBUG` | `debug_traceTransaction` | `NOT IMPLEMENTED`
[GitHub Issue #65](https://github.com/matter-labs/era-test-node/issues/65) | Returns a structured trace of the execution of the specified transaction | +| [`CONFIG`](#config-namespace) | [`config_setLogLevel`](#config_setloglevel) | `SUPPORTED` | Sets the logging level for the node and only displays the node logs. | +| [`CONFIG`](#config-namespace) | [`config_setLogging`](#config_setlogging) | `SUPPORTED` | Sets the fine-tuned logging levels for the node and any of its dependencies | +| [`DEBUG`](#debug-namespace) | [`debug_traceCall`](#debug_tracecall) | `SUPPORTED` | Performs a call and returns structured traces of the execution | +| [`DEBUG`](#debug-namespace) | [`debug_traceBlockByHash`](#debug_traceblockbyhash) | `SUPPORTED` | Returns structured traces for operations within the block of the specified block hash | +| [`DEBUG`](#debug-namespace) | [`debug_traceBlockByNumber`](#debug_traceblockbynumber) | `SUPPORTED` | Returns structured traces for operations within the block of the specified block number | +| [`DEBUG`](#debug-namespace) | [`debug_traceTransaction`](#debug_tracetransaction) | `SUPPORTED` | Returns a structured trace of the execution of the specified transaction | | `ETH` | `eth_accounts` | `SUPPORTED` | Returns a list of addresses owned by client | | [`ETH`](#eth-namespace) | [`eth_chainId`](#eth_chainid) | `SUPPORTED` | Returns the currently configured chain id
_(default is `260`)_ | | `ETH` | `eth_coinbase` | `NOT IMPLEMENTED` | Returns the client coinbase address | @@ -47,9 +49,9 @@ The `status` options are: | [`ETH`](#eth-namespace) | [`eth_getFilterLogs`](#eth_getfilterlogs) | `SUPPORTED` | Returns an array of all logs matching filter with given id | | [`ETH`](#eth-namespace) | [`eth_getLogs`](#eth_getlogs) | `SUPPORTED` | Returns an array of all logs matching a given filter object | | `ETH` | `eth_getProof` | `NOT IMPLEMENTED` | Returns the details for the account at the specified address and block number, the account's Merkle proof, and the storage values for the specified storage keys with their Merkle-proofs | -| `ETH` | `eth_getStorageAt` | `NOT IMPLEMENTED`
[GitHub Issue #45](https://github.com/matter-labs/era-test-node/issues/45) | Returns the value from a storage position at a given address | -| `ETH` | `eth_getTransactionByBlockHashAndIndex` | `NOT IMPLEMENTED`
[GitHub Issue #46](https://github.com/matter-labs/era-test-node/issues/46) | Returns information about a transaction by block hash and transaction index position | -| `ETH` | `eth_getTransactionByBlockNumberAndIndex` | `NOT IMPLEMENTED`
[GitHub Issue #47](https://github.com/matter-labs/era-test-node/issues/47) | Returns information about a transaction by block number and transaction index position | +| [`ETH`](#eth-namespace) | [`eth_getStorageAt`](#eth_getstorageat) | `SUPPORTED` | Returns the value from a storage position at a given address | +| [`ETH`](#eth-namespace) | [`eth_getTransactionByBlockHashAndIndex`](#eth_gettransactionbyblockhashandindex) | `SUPPORTED` | Returns information about a transaction by block hash and transaction index position | +| [`ETH`](#eth-namespace) | [`eth_getTransactionByBlockNumberAndIndex`](#eth_gettransactionbyblocknumberandindex) | `SUPPORTED` | Returns information about a transaction by block number and transaction index position | | [`ETH`](#eth-namespace) | [`eth_getTransactionReceipt`](#eth_gettransactionreceipt) | `SUPPORTED` | Returns the receipt of a transaction by transaction hash | | `ETH` | `eth_getUncleByBlockHashAndIndex` | `NOT IMPLEMENTED` | Returns information about a uncle of a block by hash and uncle index position | | `ETH` | `eth_getUncleByBlockNumberAndIndex` | `NOT IMPLEMENTED` | Returns information about a uncle of a block by hash and uncle index position | @@ -62,7 +64,7 @@ The `status` options are: | [`ETH`](#eth-namespace) | [`eth_newBlockFilter`](#`eth_newblockfilter) | `SUPPORTED` | Creates a filter in the node, to notify when a new block arrives | | [`ETH`](#eth-namespace) | [`eth_newFilter`](#`eth_newfilter) | `SUPPORTED` | Creates a filter object, based on filter options, to notify when the state changes (logs) | | [`ETH`](#eth-namespace) | [`eth_newPendingTransactionFilter`](#`eth_newpendingtransactionfilter) | `SUPPORTED` | Creates a filter in the node, to notify when new pending transactions arrive | -| `ETH` | `eth_protocolVersion` | `NOT IMPLEMENTED`
[GitHub Issue #48](https://github.com/matter-labs/era-test-node/issues/48) | Returns the current ethereum protocol version | +| [`ETH`](#eth-namespace)` | [`eth_protocolVersion`](#eth_protocolversion) | `SUPPORTED` | Returns the current ethereum protocol version | | `ETH` | `eth_sendTransaction` | `NOT IMPLEMENTED` | Creates new message call transaction or a contract creation, if the data field contains code | | `ETH` | `eth_sign` | `NOT IMPLEMENTED` | The sign method calculates an Ethereum specific signature with: `sign(keccak256("\x19Ethereum Signed Message:\n" + message.length + message)))` | | `ETH` | `eth_signTransaction` | `NOT IMPLEMENTED` | Signs a transaction that can be submitted to the network at a later time using `eth_sendRawTransaction` | @@ -78,7 +80,7 @@ The `status` options are: | [`EVM`](#evm-namespace) | [`evm_increaseTime`](#evm_increasetime) | `SUPPORTED` | Jump forward in time by the given amount of time, in seconds | | [`EVM`](#evm-namespace) | [`evm_mine`](#evm_mine) | `SUPPORTED` | Force a single block to be mined | | `EVM` | `evm_removeAccount` | `NOT IMPLEMENTED` | Removes an account | -| `EVM` | `evm_revert` | `NOT IMPLEMENTED`
[GitHub Issue #70](https://github.com/matter-labs/era-test-node/issues/70) | Revert the state of the blockchain to a previous snapshot | +| [`EVM`](#evm-namespace) | [`evm_revert`](#evm_revert) | `SUPPORTED` | Revert the state of the blockchain to a previous snapshot | | `EVM` | `evm_setAccountBalance` | `NOT IMPLEMENTED` | Sets the given account's balance to the specified WEI value | | `EVM` | `evm_setAccountCode` | `NOT IMPLEMENTED` | Sets the given account's code to the specified data | | `EVM` | `evm_setAccountNonce` | `NOT IMPLEMENTED` | Sets the given account's nonce to the specified value | @@ -88,7 +90,7 @@ The `status` options are: | `EVM` | `evm_setIntervalMining` | `NOT IMPLEMENTED` | Enables (with a numeric argument greater than 0) or disables (with a numeric argument equal to 0), the automatic mining of blocks at a regular interval of milliseconds, each of which will include all pending transactions | | [`EVM`](#evm-namespace) | [`evm_setNextBlockTimestamp`](#evm_setnextblocktimestamp) | `SUPPORTED` | Works like `evm_increaseTime`, but takes the exact timestamp that you want in the next block, and increases the time accordingly | | [`EVM`](#evm-namespace) | [`evm_setTime`](#evm_settime) | `SUPPORTED` | Sets the internal clock time to the given timestamp | -| `EVM` | `evm_snapshot` | `NOT IMPLEMENTED`
[GitHub Issue #69](https://github.com/matter-labs/era-test-node/issues/69) | Snapshot the state of the blockchain at the current block | +| [`EVM`](#evm-namespace) | [`evm_snapshot`](#evm_snapshot) | `SUPPORTED` | Snapshot the state of the blockchain at the current block | | `HARDHAT` | `hardhat_addCompilationResult` | `NOT IMPLEMENTED` | Add information about compiled contracts | | `HARDHAT` | `hardhat_dropTransaction` | `NOT IMPLEMENTED` | Remove a transaction from the mempool | | [`HARDHAT`](#hardhat-namespace) | [`hardhat_impersonateAccount`](#hardhat_impersonateaccount) | `SUPPORTED` | Impersonate an account | @@ -97,7 +99,7 @@ The `status` options are: | [`HARDHAT`](#hardhat-namespace) | [`hardhat_mine`](#hardhat_mine) | Mine any number of blocks at once, in constant time | | `HARDHAT` | `hardhat_reset` | `NOT IMPLEMENTED` | Resets the state of the network | | [`HARDHAT`](#hardhat-namespace) | [`hardhat_setBalance`](#hardhat_setbalance) | `SUPPORTED` | Modifies the balance of an account | -| `HARDHAT` | `hardhat_setCode` | `NOT IMPLEMENTED` | Sets the bytecode of a given account | +| [`HARDHAT`](#hardhat-namespace) | [`hardhat_setCode`](#hardhat_setcode) | `SUPPORTED` | Sets the bytecode of a given account | | `HARDHAT` | `hardhat_setCoinbase` | `NOT IMPLEMENTED` | Sets the coinbase address | | `HARDHAT` | `hardhat_setLoggingEnabled` | `NOT IMPLEMENTED` | Enables or disables logging in Hardhat Network | | `HARDHAT` | `hardhat_setMinGasPrice` | `NOT IMPLEMENTED` | Sets the minimum gas price | @@ -112,8 +114,8 @@ The `status` options are: | [`ZKS`](#zks-namespace) | [`zks_estimateFee`](#zks_estimateFee) | `SUPPORTED` | Gets the Fee estimation data for a given Request | | `ZKS` | `zks_estimateGasL1ToL2` | `NOT IMPLEMENTED` | Estimate of the gas required for a L1 to L2 transaction | | `ZKS` | `zks_getAllAccountBalances` | `NOT IMPLEMENTED` | Returns all balances for confirmed tokens given by an account address | -| `ZKS` | `zks_getBlockDetails` | `NOT IMPLEMENTED` | Returns additional zkSync-specific information about the L2 block | -| `ZKS` | `zks_getBridgeContracts` | `NOT IMPLEMENTED` | Returns L1/L2 addresses of default bridges | +| [`ZKS`](#zks-namespace) | [`zks_getBridgeContracts`](#zks_getbridgecontracts) | `SUPPORTED` | Returns L1/L2 addresses of default bridges | +| [`ZKS`](#zks-namespace) | [`zks_getBlockDetails`](#zks_getblockdetails) | `SUPPORTED` | Returns additional zkSync-specific information about the L2 block | | `ZKS` | `zks_getBytecodeByHash` | `NOT IMPLEMENTED` | Returns bytecode of a transaction given by its hash | | `ZKS` | `zks_getConfirmedTokens` | `NOT IMPLEMENTED` | Returns [address, symbol, name, and decimal] information of all tokens within a range of ids given by parameters `from` and `limit` | | `ZKS` | `zks_getL1BatchBlockRange` | `NOT IMPLEMENTED` | Returns the range of blocks contained within a batch given by batch number | @@ -121,10 +123,10 @@ The `status` options are: | `ZKS` | `zks_getL2ToL1LogProof` | `NOT IMPLEMENTED` | Given a transaction hash, and an index of the L2 to L1 log produced within the transaction, it returns the proof for the corresponding L2 to L1 log | | `ZKS` | `zks_getL2ToL1MsgProof` | `NOT IMPLEMENTED` | Given a block, a sender, a message, and an optional message log index in the block containing the L1->L2 message, it returns the proof for the message sent via the L1Messenger system contract | | `ZKS` | `zks_getMainContract` | `NOT IMPLEMENTED` | Returns the address of the zkSync Era contract | -| `ZKS` | `zks_getRawBlockTransactions` | `NOT IMPLEMENTED` | Returns data of transactions in a block | +| [`ZKS`](#zks-namespace) | [`zks_getRawBlockTransactions`](#zks_getrawblocktransactions) | `SUPPORTED` | Returns data of transactions in a block | | `ZKS` | `zks_getTestnetPaymaster` | `NOT IMPLEMENTED` | Returns the address of the testnet paymaster | | [`ZKS`](#zks-namespace) | [`zks_getTokenPrice`](#zks_getTokenPrice) | `SUPPORTED` | Gets the USD price of a token
_(`ETH` is hard-coded to `1_500`, while some others are `1`)_ | -| `ZKS` | `zks_getTransactionDetails` | `NOT IMPLEMENTED` | Returns data from a specific transaction given by the transaction hash | +| [`ZKS`](#zks-namespace) | [`zks_getTransactionDetails`](#zks_gettransactiondetails) | `SUPPORTED` | Returns data from a specific transaction given by the transaction hash | | `ZKS` | `zks_L1BatchNumber` | `NOT IMPLEMENTED` | Returns the latest L1 batch number | | `ZKS` | `zks_L1ChainId` | `NOT IMPLEMENTED` | Returns the chain id of the underlying L1 | @@ -291,6 +293,210 @@ curl --request POST \ --data '{"jsonrpc": "2.0","id": "1","method": "config_setResolveHashes","params": [true]}' ``` +### `config_setLogLevel` + +[source](src/configuration_api.rs) + +Sets the logging level for the node and only displays the node logs. + +#### Arguments + ++ `level: LogLevel ('trace', 'debug', 'info', 'warn', 'error')` + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0","id": "1","method": "config_setLogLevel","params": ["trace"]}' +``` + +### `config_setLogging` + +[source](src/configuration_api.rs) + +Sets the fine-tuned logging levels for the node and any of its dependencies. +The directive format is comma-separated `module=level` for any number of modules. + +#### Arguments + ++ `directive: String (module=level,other_module=level)` + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0","id": "1","method": "config_setLogging","params": ["era_test_node=trace,hyper=debug"]}' +``` + +## `DEBUG NAMESPACE` + +### `debug_traceCall` + +[source](src/debug.rs) + +The `debug_traceCall` is similar to `eth_call` but returns call traces for each call. + +Currently calls can only be traced on the latest block. This is the default and hence the block argument can be omitted. + +The third argument mirrors the [`TraceConfig` of go-ethereum](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#traceconfig), but with the restriction that the only supported tracer is `CallTracer`. Memory, Stack and Storage traces are not supported. + +#### Arguments + ++ `transaction: Transaction` + ++ `block: BlockNumber` + ++ `tracer: TracerConfig` + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "2", + "method": "debug_traceCall", + "params": [{ + "to": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049", + "data": "0x0000", + "from": "0xa61464658AfeAf65CccaaFD3a512b69A83B77618", + "gas": "0x0000", + "gasPrice": "0x0000", + "value": "0x0000", + "nonce": "0x0000" + }, "latest"] + }' +``` + +### `debug_traceTransaction` + +[source](src/debug.rs) + +Returns call traces for the transaction with given hash. + +Currently only transactions executed on the dev node itself (ie, not from upstream when using fork mode) can be traced. + +The third argument mirrors the [`TraceConfig` of go-ethereum](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#traceconfig), but with the restriction that the only supported tracer is `CallTracer`. Memory, Stack and Storage traces are not supported. + +#### Arguments + +- `tx_hash: H256` + +- `options: TracerConfig` (optional) + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "2", + "method": "debug_traceTransaction", + "params": [ + "0xd3a94ff697a573cb174ecce05126e952ecea6dee051526a3e389747ff86b0d99", + { "tracer": "callTracer", "tracerConfig": { "onlyTopCall": true } } + ] + }' +``` + +### `debug_traceBlockByHash` + +[source](src/debug.rs) + +Returns call traces for each transaction within a given block. + +Currently only transactions from blocks mined on the dev node itself (ie, not from upstream when using fork mode) can be traced. + +The third argument mirrors the [`TraceConfig` of go-ethereum](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#traceconfig), but with the restriction that the only supported tracer is `CallTracer`. Memory, Stack and Storage traces are not supported. + +#### Arguments + +- `blockHash: H256` + +- `options: TracerConfig` (optional) + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "2", + "method": "debug_traceBlockByHash", + "params": [ + "0xd3a94ff697a573cb174ecce05126e952ecea6dee051526a3e389747ff86b0d99", + { "tracer": "callTracer", "tracerConfig": { "onlyTopCall": true } } + ] + }' +``` + +### `debug_traceBlockByNumber` + +[source](src/debug.rs) + +Returns call traces for each transaction within a given block. + +Currently only transactions from blocks mined on the dev node itself (ie, not from upstream when using fork mode) can be traced. + +The third argument mirrors the [`TraceConfig` of go-ethereum](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#traceconfig), but with the restriction that the only supported tracer is `CallTracer`. Memory, Stack and Storage traces are not supported. + +#### Arguments + +- `blockNumber: BlockNumber` + +- `options: TracerConfig` (optional) + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "2", + "method": "debug_traceBlockByNumber", + "params": [ + "latest", + { "tracer": "callTracer", "tracerConfig": { "onlyTopCall": true } } + ] + }' +``` + ## `NETWORK NAMESPACE` ### `net_version` @@ -784,7 +990,6 @@ curl --request POST \ }' ``` - ### `eth_getFilterLogs` [source](src/node.rs) @@ -1071,6 +1276,121 @@ curl --request POST \ }' ``` +### `eth_getStorageAt` + +[source](src/node.rs) + +Returns the value from a storage position at a given address. + +#### Arguments + ++ `address: H160` ++ `position: U256` ++ `blockNumber: BlockIdVariant` + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "1", + "method": "eth_getStorageAt", + "params": ["0x123456789abcdef123456789abcdef1234567890", "0x0", "latest"] +}' +``` + +### `eth_getTransactionByBlockHashAndIndex` + +[source](src/node.rs) + +Returns information about a transaction by block hash and transaction index position + +#### Arguments + ++ `block_hash: H256` ++ `index: U64` + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "1", + "method": "eth_getTransactionByBlockHashAndIndex", + "params": ["0x0000000000000000000000000000000000000000000000000000000000000008", "0x1"] +}' +``` + +### `eth_getTransactionByBlockNumberAndIndex` + +[source](src/node.rs) + +Returns information about a transaction by block number and transaction index position + +#### Arguments + ++ `block_number: BlockNumber` ++ `index: U64` + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "1", + "method": "eth_getTransactionByBlockNumberAndIndex", + "params": ["latest", "0x1"] +}' +``` + +### `eth_protocolVersion` + +[source](src/node.rs) + +Returns the current ethereum protocol version. + +#### Arguments + ++ _NONE_ + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "1", + "method": "eth_protocolVersion" +}' +``` + ## `HARDHAT NAMESPACE` ### `hardhat_setBalance` @@ -1218,6 +1538,38 @@ curl --request POST \ }' ``` +### `hardhat_setCode` + +[source](src/hardhat.rs) + +Sets the code for a given address. + +#### Arguments + ++ `address: Address` - The `Address` whose code will be updated ++ `code: Bytes` - The code to set to + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "1", + "method": "hardhat_setCode", + "params": [ + "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049", + [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] + ] + }' +``` + ## `EVM NAMESPACE` ### `evm_mine` @@ -1310,6 +1662,52 @@ curl --request POST \ --data '{"jsonrpc": "2.0","id": "1","method": "evm_setTime","params": [1672527600]}' ``` +### `evm_snapshot` + +[source](src/evm.rs) + +Snapshot the state of the blockchain at the current block. + +#### Arguments + ++ _NONE_ + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0","id": "1","method": "evm_snapshot"}' +``` + +### `evm_revert` + +[source](src/evm.rs) + +Revert the state of the blockchain to a previous snapshot + +#### Arguments + ++ `snapshot_id: U64` + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0","id": "1","method": "evm_revert","params": ["0x1"]}' +``` + ## `ZKS NAMESPACE` ### `zks_estimateFee` @@ -1370,3 +1768,99 @@ curl --request POST \ --header 'content-type: application/json' \ --data '{"jsonrpc": "2.0","id": "1","method": "zks_getTokenPrice","params": ["0x0000000000000000000000000000000000000000"]}' ``` + +### `zks_getTransactionDetails` + +[source](src/zks.rs) + +Returns data from a specific transaction given by the transaction hash. + +#### Arguments + ++ `transactionHash: H256` + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0","id": "1","method": "zks_getTransactionDetails","params": ["0xa5d62a85561295ed58f8daad4e9442691e6da4301a859f364d28a02917d6e04d"]}' +``` + +### `zks_getBlockDetails` + +[source](src/zks.rs) + +Returns additional zkSync-specific information about the L2 block. + +#### Arguments + ++ `block: u32` - The number of the block + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0", "id": 1, "method": "zks_getBlockDetails", "params": [ 140599 ]}' +``` + +### `zks_getBridgeContracts` + +[source](src/zks.rs) + +Returns L1/L2 addresses of default bridges. + +#### Arguments + ++ _NONE_ + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{ + "jsonrpc": "2.0", + "id": "2", + "method": "zks_getBridgeContracts" + }' +``` + +### `zks_getRawBlockTransactions` + +[source](src/zks.rs) + +Returns data of transactions in a block. + +#### Arguments + ++ `block: u32` - The number of the block + +#### Status + +`SUPPORTED` + +#### Example + +```bash +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0", "id": 1, "method": "zks_getRawBlockTransactions", "params": [ 140599 ]}' +``` diff --git a/docs/rustbook/.gitignore b/docs/rustbook/.gitignore new file mode 100644 index 00000000..7585238e --- /dev/null +++ b/docs/rustbook/.gitignore @@ -0,0 +1 @@ +book diff --git a/docs/rustbook/book.toml b/docs/rustbook/book.toml new file mode 100644 index 00000000..8c5f4029 --- /dev/null +++ b/docs/rustbook/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["matter-labs"] +language = "en" +multilingual = false +src = "src" +title = "Era Test Node" diff --git a/docs/rustbook/src/SUMMARY.md b/docs/rustbook/src/SUMMARY.md new file mode 100644 index 00000000..22889fb4 --- /dev/null +++ b/docs/rustbook/src/SUMMARY.md @@ -0,0 +1,22 @@ +# Summary + +- [Introduction](./introduction.md) + +# User Guide + +- [Installation](./installation.md) +- [Usage](./usage/README.md) + - [Basic](./usage/basic.md) + - [Forking Networks](./usage/fork.md) + - [Replay Remote Transactions](./usage/remote-tx.md) + - [Deploying Contracts](./usage/deploy-contracts.md) + - [Testing](./usage/testing.md) +- [Draft Chapter]() + +# Reference Guide + +- [Draft Chapter]() + +----------- + +[Contributors](misc/contributors.md) \ No newline at end of file diff --git a/docs/rustbook/src/installation.md b/docs/rustbook/src/installation.md new file mode 100644 index 00000000..e969f722 --- /dev/null +++ b/docs/rustbook/src/installation.md @@ -0,0 +1,15 @@ +# Installation + +The node may be installed in the following ways: + +## zksync-cli +You can set up In-Memory Node quickly with `npx zksync-cli dev start`. +> *Note:* at the moment this method won't allow you to use additional features like forking networks or replaying transactions. + +## Release binary +Download `era-test-node`` from latest [Release](https://github.com/matter-labs/era-test-node/releases/latest) + +## Build from source +The project can be built from [source](https://github.com/matter-labs/era-test-node/releases/latest). Please note that you may +require some [prerequisites](https://github.com/matter-labs/era-test-node/tree/v0.1.0-alpha.6#-prerequisites) including the rust toolchain +to build the project from scratch. \ No newline at end of file diff --git a/docs/rustbook/src/introduction.md b/docs/rustbook/src/introduction.md new file mode 100644 index 00000000..9af4b5ac --- /dev/null +++ b/docs/rustbook/src/introduction.md @@ -0,0 +1,10 @@ +# Introduction + +The In-memory node uses an in-memory database for storing state information and simplified hashmaps for tracking blocks and transactions. +In fork mode, it retrieves missing storage data from a remote source when not available locally. +Moreover it also uses the remote server (openchain) to resolve the ABI and topics to human readable names. + +You can visit the `era-test-node` repository [here](https://github.com/matter-labs/era-test-node) to learn more. + +Please keep in mind that `era-test-node` is still in its **alpha** stage, so some features might not be fully supported yet and may not work as fully intended. +It is [open-sourced](https://github.com/matter-labs/era-test-node) and contributions are welcomed. \ No newline at end of file diff --git a/docs/rustbook/src/misc/contributors.md b/docs/rustbook/src/misc/contributors.md new file mode 100644 index 00000000..0e5eb41a --- /dev/null +++ b/docs/rustbook/src/misc/contributors.md @@ -0,0 +1,5 @@ +# Contributors + +Here is a list of the contributors who have helped improving mdBook. Big shout-out to them! + +* [nbaztec](https://github.com/nbaztec) \ No newline at end of file diff --git a/docs/rustbook/src/usage/README.md b/docs/rustbook/src/usage/README.md new file mode 100644 index 00000000..f61d7b51 --- /dev/null +++ b/docs/rustbook/src/usage/README.md @@ -0,0 +1,50 @@ +# Usage + +In-Memory node can be utilized for a variety of reasons. + + +## Network Details +The `era_test_node` has the following default network configurations: + +* **L2 RPC:** `http://localhost:8011` +* **Network Id:** 260 + +These can be configured to your preference. + +> *Note:* Please note that the existing implementation does not facilitate communication with Layer 1. As a result, an L1 RPC is not available. + +## Caching + +The node will cache certain network request by default to disk in the `.cache` directory. Alternatively the caching can be disabled or set to in-memory only +via the `--cache=none|memory|disk` parameter. + +```bash +era_test_node --cache=none run +``` + +```bash +era_test_node --cache=memory run +``` + +Additionally when using `--cache=disk`, the cache directory may be specified via `--cache-dir` and the cache may +be reset on startup via `--reset-cache` parameters. +```bash +era_test_node --cache=disk --cache-dir=/tmp/foo --reset-cache run +``` + +## Pre-configured Rich Wallets + +The node also includes pre-configured "rich" accounts for testing: + +| Account Id | Private Key | +| ------------- | ------------- | +|0x36615Cf349d7F6344891B1e7CA7C72883F5dc049 | 0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 | +|0xa61464658AfeAf65CccaaFD3a512b69A83B77618 | 0xac1e735be8536c6534bb4f17f06f6afc73b2b5ba84ac2cfb12f7461b20c0bbe3 | +|0x0D43eB5B8a47bA8900d84AA36656c92024e9772e | 0xd293c684d884d56f8d6abd64fc76757d3664904e309a0645baf8522ab6366d9e | +|0xA13c10C0D5bd6f79041B9835c63f91de35A15883 | 0x850683b40d4a740aa6e745f889a6fdc8327be76e122f5aba645a5b02d0248db8 | +|0x8002cD98Cfb563492A6fB3E7C8243b7B9Ad4cc92 | 0xf12e28c0eb1ef4ff90478f6805b68d63737b7f33abfa091601140805da450d93 | +|0x4F9133D1d3F50011A6859807C837bdCB31Aaab13 | 0xe667e57a9b8aaa6709e51ff7d093f1c5b73b63f9987e4ab4aa9a5c699e024ee8 | +|0xbd29A1B981925B94eEc5c4F1125AF02a2Ec4d1cA | 0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959 | +|0xedB6F5B4aab3dD95C7806Af42881FF12BE7e9daa | 0x74d8b3a188f7260f67698eb44da07397a298df5427df681ef68c45b34b61f998 | +|0xe706e60ab5Dc512C36A4646D719b889F398cbBcB | 0xbe79721778b48bcc679b78edac0ce48306a8578186ffcb9f2ee455ae6efeace1 | +|0xE90E12261CCb0F3F7976Ae611A29e84a6A85f424 | 0x3eb15da85647edd9a1159a4a13b9e7c56877c4eb33f614546d4db06a51868b1c | diff --git a/docs/rustbook/src/usage/basic.md b/docs/rustbook/src/usage/basic.md new file mode 100644 index 00000000..c6b03545 --- /dev/null +++ b/docs/rustbook/src/usage/basic.md @@ -0,0 +1,33 @@ +# Basic + +Start the node: + +```sh +era_test_node run +``` + +The expected output will be as follows: + + +```log +12:34:56 [INFO] Starting network with chain id: L2ChainId(260) +12:34:56 [INFO] Rich Accounts +12:34:56 [INFO] ============= +12:34:56 [INFO] Account #0: 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049 (1_000_000_000_000 ETH) +12:34:56 [INFO] Private Key: 0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 +12:34:56 [INFO] +12:34:56 [INFO] Account #1: 0xa61464658AfeAf65CccaaFD3a512b69A83B77618 (1_000_000_000_000 ETH) +12:34:56 [INFO] Private Key: 0xac1e735be8536c6534bb4f17f06f6afc73b2b5ba84ac2cfb12f7461b20c0bbe3 + +... + +12:34:56 [INFO] Account #9: 0xE90E12261CCb0F3F7976Ae611A29e84a6A85f424 (1_000_000_000_000 ETH) +12:34:56 [INFO] Private Key: 0x3eb15da85647edd9a1159a4a13b9e7c56877c4eb33f614546d4db06a51868b1c +12:34:56 [INFO] +12:34:56 [INFO] ======================================== +12:34:56 [INFO] Node is ready at 127.0.0.1:8011 +12:34:56 [INFO] ======================================== +``` + +> *Note:* When utilizing `era-test-node` with MetaMask, it's essential to note that any restart of the in-memory node will necessitate a reset of MetaMask's +cached account data (nonce, etc). To do this, navigate to `Settings`, then `Advanced`, and finally, select `Clear activity tab data`. diff --git a/docs/rustbook/src/usage/bootloader.md b/docs/rustbook/src/usage/bootloader.md new file mode 100644 index 00000000..210d7a7d --- /dev/null +++ b/docs/rustbook/src/usage/bootloader.md @@ -0,0 +1 @@ +# Testing Bootloader diff --git a/docs/rustbook/src/usage/deploy-contracts.md b/docs/rustbook/src/usage/deploy-contracts.md new file mode 100644 index 00000000..82501d0d --- /dev/null +++ b/docs/rustbook/src/usage/deploy-contracts.md @@ -0,0 +1,24 @@ +# Deploying Contracts + +For the deployment of your contracts, you have the flexibility to choose between two preferred methods: either by using Hardhat +with the `hardhat-zksync-deploy` and `hardhat-zksync-solc` plugins, or via `foundry-zksync`. +The following example will detail the process using `foundry-zksync`. + +Before proceeding, ensure that you've compiled your contracts using `zkforge zk-build`. +For instructions on how to do this, please refer to this [link](https://github.com/matter-labs/foundry-zksync#compile-with-zkforge-zk-build). + +```sh +zkforge zkc contracts/Greeter.sol:Greeter --constructor-args "ZkSync and Foundry" --private-key 7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 --rpc-url http://localhost:8011 --chain 260 +``` + +Here's an example of what you should expect to see: +```log +Deploying contract... ++-------------------------------------------------+ +Contract successfully deployed to address: 0x0a40ecde17dc16c4001bf0e4f5d5ff1818219b3b +Transaction Hash: 0x9d59bea38ca6f3cef365c23f339547bcc8ce28abb8344999ffffa5fa62c9ff8e +Gas used: 2570407 +Effective gas price: 500 +Block Number: 8072361 ++-------------------------------------------------+ +``` \ No newline at end of file diff --git a/docs/rustbook/src/usage/fork.md b/docs/rustbook/src/usage/fork.md new file mode 100644 index 00000000..461708a5 --- /dev/null +++ b/docs/rustbook/src/usage/fork.md @@ -0,0 +1,83 @@ +# Forking Networks + +To fork the `testnet`, use the following command: +```sh +era_test_node fork testnet +``` + +You can also fork `mainnet` with +```sh +era_test_node fork mainnet +``` + +The expected output will be as follows: + +```log +12:34:56 [INFO] Creating fork from "https://testnet.era.zksync.dev:443" L1 block: L1BatchNumber(128846) L2 block: 12088718 with timestamp 1695822231, L1 gas price 2500000014 and protocol version: Some(Version15) +12:34:56 [INFO] Starting network with chain id: L2ChainId(260) +12:34:56 [INFO] Rich Accounts +12:34:56 [INFO] ============= +12:34:56 [INFO] Account #0: 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049 (1_000_000_000_000 ETH) +12:34:56 [INFO] Private Key: 0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 +12:34:56 [INFO] +12:34:56 [INFO] Account #1: 0xa61464658AfeAf65CccaaFD3a512b69A83B77618 (1_000_000_000_000 ETH) +12:34:56 [INFO] Private Key: 0xac1e735be8536c6534bb4f17f06f6afc73b2b5ba84ac2cfb12f7461b20c0bbe3 + +... + +12:34:56 [INFO] Account #9: 0xE90E12261CCb0F3F7976Ae611A29e84a6A85f424 (1_000_000_000_000 ETH) +12:34:56 [INFO] Private Key: 0x3eb15da85647edd9a1159a4a13b9e7c56877c4eb33f614546d4db06a51868b1c +12:34:56 [INFO] +12:34:56 [INFO] ======================================== +12:34:56 [INFO] Node is ready at 127.0.0.1:8011 +12:34:56 [INFO] ======================================== +``` + +This command starts the node, forked at the current head of the testnet. + +You also have the option to specify a custom http endpoint and a custom forking height, like so: + +```sh +# Usage: era_test_node fork --fork-at +era_test_node fork --fork-at 7000000 mainnet http://172.17.0.3:3060 +``` + +## Sending network calls + +You can send network calls against a running `era-test-node`. You can check the testnet LINK balance or mainnet USDT using `curl` or [foundry-zksync](https://github.com/matter-labs/foundry-zksync). + +To get started, launch the local in-memory node: +```sh +era_test_node fork testnet +``` + +Next, use curl to send a network call: +```sh +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78", "data":"0x06fdde03"}, "latest"],"id":1}' http://localhost:8011 +``` + +Here's an example of what you should expect to see: +```log +{"jsonrpc":"2.0","result":"0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000018436861696e4c696e6b20546f6b656e2028676f65726c69290000000000000000","id":1} +``` + +Or, if you prefer, use [foundry-zksync](https://github.com/matter-labs/foundry-zksync). Make sure to install and configure `foundry-zksync` before proceeding +(for installation instructions, please see this [link](https://github.com/matter-labs/foundry-zksync/tree/main#foundry-with-zksync-era-v01)): +```sh +zkcast call 0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78 "name()(string)" --rpc-url http://localhost:8011 +``` + +Here's an example of what you should expect to see: +```log +ChainLink Token (goerli) +``` + +Retrieve the balance of a particular contract: +```sh +zkcast call 0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78 "balanceOf(address)(uint256)" 0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78 --rpc-url http://localhost:8011 +``` + +Here's an example of what you should expect to see: +```log +28762283719941475444443116625665 +``` \ No newline at end of file diff --git a/docs/rustbook/src/usage/remote-tx.md b/docs/rustbook/src/usage/remote-tx.md new file mode 100644 index 00000000..4d4ebdaa --- /dev/null +++ b/docs/rustbook/src/usage/remote-tx.md @@ -0,0 +1,76 @@ +# Replay Remote Transactions + +If you wish to replay a remote transaction locally for deep debugging, use the following command: + +```sh +# Usage: era_test_node replay_tx +era_test_node replay_tx testnet 0x7f039bcbb1490b855be37e74cf2400503ad57f51c84856362f99b0cbf1ef478a +``` + +For more detailed transaction information, such as call traces, add the `--show-calls` flag. If you want to see ABI names, add the `--resolve-hashes` flag. Here's an example: + +```sh +# Usage: era_test_node replay_tx +era_test_node --show-calls=user --resolve-hashes replay_tx testnet 0x7f039bcbb1490b855be37e74cf2400503ad57f51c84856362f99b0cbf1ef478a +``` + +Alternatively (if your node is already running) you can use `config_setShowCalls` and `config_setResolveHashes` RPC endpoints to configure these values. Here's an example: + +```sh +# era_test_node already running... + +# Set show-calls to User +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0","id": "1","method": "config_setShowCalls","params": ["user"]}' + +# Enable resolve-hashes +curl --request POST \ + --url http://localhost:8011/ \ + --header 'content-type: application/json' \ + --data '{"jsonrpc": "2.0","id": "1","method": "config_setResolveHashes","params": [true]}' +``` + +Here's an example of what you should expect to see when `--show-calls` and `--resolve-hashes` are configured: + +```log +Creating fork from "https://testnet.era.zksync.dev:443" L1 block: L1BatchNumber(94420) L2 block: 8072359 with timestamp 1687337488 and L1 gas price 2500011172 +Starting network with chain id: L2ChainId(280) +Running 1 transactions (one per batch) + +Executing 0x7f039bcbb1490b855be37e74cf2400503ad57f51c84856362f99b0cbf1ef478a +Transaction: SUCCESS +Initiator: 0x55362182242a4de20ea8a0ec055b2134bb24e23d Payer: 0x55362182242a4de20ea8a0ec055b2134bb24e23d +Gas Limit: 797128 used: 351250 refunded: 445878 + +==== Console logs: + +==== 18 call traces. Use --show-calls flag to display more info. +Call(Normal) 0x55362182242a4de20ea8a0ec055b2134bb24e23d validateTransaction(bytes32, bytes32, tuple) 730485 + Call(Normal) 0x0000000000000000000000000000000000000001 0xbb1e83e6 698040 +Call(Normal) 0x55362182242a4de20ea8a0ec055b2134bb24e23d payForTransaction(bytes32, bytes32, tuple) 703647 +Call(Normal) 0x55362182242a4de20ea8a0ec055b2134bb24e23d executeTransaction(bytes32, bytes32, tuple) 647199 + Call(Mimic) 0x6eef3310e09df3aa819cc2aa364d4f3ad2e6ffe3 swapExactETHForTokens(uint256,address[],address,uint256) 596358 + Call(Normal) 0x053f26a020de152a947b8ba7d8974c85c5fc5b81 getPair(address,address) 577647 + Call(Normal) 0xc0b7c869ba924c05f64333d9caa21f4424eb4b30 getReserves() 570402 + Call(Mimic) 0x8a144308792a23aadb118286ac0dec646f638908 deposit() 534807 + Call(Normal) 0x053f26a020de152a947b8ba7d8974c85c5fc5b81 getPair(address,address) 526050 + Call(Normal) 0x8a144308792a23aadb118286ac0dec646f638908 transfer(address,uint256) 522900 + Call(Normal) 0x053f26a020de152a947b8ba7d8974c85c5fc5b81 getPair(address,address) 497007 + Call(Normal) 0xc0b7c869ba924c05f64333d9caa21f4424eb4b30 swap(uint256,uint256,address,bytes) 492660 + Call(Normal) 0x880f03ca84e6cf0d0871c9818a2981debaba22b3 transfer(address,uint256) 465948 + Call(Normal) 0x880f03ca84e6cf0d0871c9818a2981debaba22b3 balanceOf(address) 432495 + Call(Normal) 0x8a144308792a23aadb118286ac0dec646f638908 balanceOf(address) 430290 + +==== 9 events +EthToken System Contract Transfer(address,address,uint256), 0x0000…e23d, 0x0000…8001 +EthToken System Contract Transfer(address,address,uint256), 0x0000…e23d, 0x0000…ffe3 +EthToken System Contract Transfer(address,address,uint256), 0x0000…ffe3, 0x0000…8908 +0x8a144308792a23aadb118286ac0dec646f638908 Deposit(address,uint256), 0x0000…ffe3 +0x8a144308792a23aadb118286ac0dec646f638908 Transfer(address,address,uint256), 0x0000…ffe3, 0x0000…4b30 +0x880f03ca84e6cf0d0871c9818a2981debaba22b3 Transfer(address,address,uint256), 0x0000…4b30, 0x0000…e23d +0xc0b7c869ba924c05f64333d9caa21f4424eb4b30 Sync(uint112,uint112) +0xc0b7c869ba924c05f64333d9caa21f4424eb4b30 Swap(address,uint256,uint256,uint256,uint256,address), 0x0000…ffe3, 0x0000…e23d +EthToken System Contract Transfer(address,address,uint256), 0x0000…8001, 0x0000…e23d +``` \ No newline at end of file diff --git a/docs/rustbook/src/usage/testing.md b/docs/rustbook/src/usage/testing.md new file mode 100644 index 00000000..9f8ee1c8 --- /dev/null +++ b/docs/rustbook/src/usage/testing.md @@ -0,0 +1,145 @@ +# Testing + +The node can be used to test different parameters of the system locally. + + +### Testing bootloader and system contracts +In-memory node allows testing of the currently compiled bootloader and system contracts. +This makes it possible to examine the effects of changes on already deployed contracts. + +> *Note:* These commands assume you have set `$ZKSYNC_HOME` in your shell profile file (e.g. `~/.bash_profile`, `~/.zshrc`) +to target your local copy of `era-test-node`. For instance: + +```sh +# Add path here: +export ZKSYNC_HOME=/path/to/era-test-node + +export PATH=$ZKSYNC_HOME/bin:$PATH +``` + +Firstly, you will need to preprocess and compile the contracts: +```sh +cd etc/system-contracts +yarn preprocess && yarn hardhat run ./scripts/compile-yul.ts +``` + +To use the locally compiled bootloader and system contracts, run: +```sh +RUST_LOG=vm=trace era_test_node --dev-use-local-contracts fork testnet +``` + +## Writing and running tests locally +This section demonstrates how to author and execute tests locally against `era-test-node` using the `mocha` and `chai` testing frameworks. + +### Project configuration +Start by creating a new Hardhat project. If you need guidance, follow the [getting started guide](https://era.zksync.io/docs/tools/hardhat/getting-started.html). + +To incorporate the test libraries, execute: +```sh +yarn add -D mocha chai @types/mocha @types/chai +``` + +Add the following lines to your package.json in the root folder: +```json +"scripts": { + "test": "NODE_ENV=test hardhat test" +} +``` + +This script makes it possible to run tests in a Hardhat environment with the `NODE_ENV` env variable set as `test`. + +### Configuring tests +Adjust `hardhat.config.ts` to use the local node for testing: +> *Note:* Ensure `era-test-node` is running in another process before executing `yarn test`. + +```ts +import "@matterlabs/hardhat-zksync-deploy"; +import "@matterlabs/hardhat-zksync-solc"; + +module.exports = { + zksolc: { + version: "latest", + settings: {}, + }, + defaultNetwork: "zkSyncTestnet", + networks: { + hardhat: { + zksync: true, + }, + zkSyncTestnet: { + url: "http://localhost:8011", + ethNetwork: "http://localhost:8545", + zksync: true, + }, + }, + solidity: { + version: "0.8.17", + }, +}; +``` + +### Writing test scripts +Now, create your first test! Construct a test/main.test.ts file with the following code: + +```ts +import { expect } from "chai"; +import { Wallet, Provider, Contract } from "zksync-web3"; +import * as hre from "hardhat"; +import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; + +const RICH_WALLET_PK = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; + +describe("Greeter", function () { + it("Should return the new greeting once it's changed", async function () { + const provider = Provider.getDefaultProvider(); + + const wallet = new Wallet(RICH_WALLET_PK, provider); + const deployer = new Deployer(hre, wallet); + + const artifact = await deployer.loadArtifact("Greeter"); + const greeter = await deployer.deploy(artifact, ["Hi"]); + + expect(await greeter.greet()).to.eq("Hi"); + + const setGreetingTx = await greeter.setGreeting("Hola, mundo!"); + // wait until the transaction is mined + await setGreetingTx.wait(); + + expect(await greeter.greet()).to.equal("Hola, mundo!"); + }); +}); +``` + +To run the test file, execute: +```sh +yarn test +``` + +Well done! You've successfully run your first local tests with zkSync Era and `era-test-node`. + +## CI/CD Testing with GitHub Actions +A GitHub Action is available for integrating era-test-node into your CI/CD environments. +This action offers high configurability and streamlines the process of testing your applications in an automated way. + +You can find this GitHub Action in the marketplace [here](https://github.com/marketplace/actions/era-test-node-action). + +### Example Usage +Below is an example yaml configuration to use the era-test-node GitHub Action in your workflow: +```yml +name: Run Era Test Node Action + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Run Era Test Node + uses: dutterbutter/era-test-node-action@latest +``` \ No newline at end of file diff --git a/e2e-tests/.eslintrc.js b/e2e-tests/.eslintrc.js index db5dbb3a..03905dc1 100644 --- a/e2e-tests/.eslintrc.js +++ b/e2e-tests/.eslintrc.js @@ -20,10 +20,11 @@ module.exports = { ecmaVersion: "latest", sourceType: "module", }, - plugins: ["@typescript-eslint"], + plugins: ["@typescript-eslint", "mocha"], // Add rule exceptions here if they are too onerous to comply with rules: { "@typescript-eslint/ban-ts-comment": "off", + "mocha/no-exclusive-tests": "error", }, }; diff --git a/e2e-tests/.yarn/install-state.gz b/e2e-tests/.yarn/install-state.gz new file mode 100644 index 00000000..57c21171 Binary files /dev/null and b/e2e-tests/.yarn/install-state.gz differ diff --git a/e2e-tests/.yarnrc.yml b/e2e-tests/.yarnrc.yml new file mode 100644 index 00000000..3186f3f0 --- /dev/null +++ b/e2e-tests/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/e2e-tests/contracts/Primary.sol b/e2e-tests/contracts/Primary.sol new file mode 100644 index 00000000..0dcf8f37 --- /dev/null +++ b/e2e-tests/contracts/Primary.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "./Secondary.sol"; + +contract Primary { + Secondary secondary; + + constructor(address _secondary) { + secondary = Secondary(_secondary); + } + + function name() public pure returns (string memory) { + return "Primary"; + } + + function calculate(uint256 value) public returns (uint) { + return secondary.multiply(value); + } + + function shouldRevert() public view returns (uint) { + return secondary.shouldRevert(); + } +} diff --git a/e2e-tests/contracts/Return5.sol b/e2e-tests/contracts/Return5.sol new file mode 100644 index 00000000..f14a2709 --- /dev/null +++ b/e2e-tests/contracts/Return5.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-3.0 + +pragma solidity >=0.8.2 <0.9.0; + +contract Return5 { + function value() public pure returns (uint8) { + return 5; + } +} diff --git a/e2e-tests/contracts/Secondary.sol b/e2e-tests/contracts/Secondary.sol new file mode 100644 index 00000000..a2ca5680 --- /dev/null +++ b/e2e-tests/contracts/Secondary.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +contract Secondary { + uint data; + + constructor(uint _data) { + data = _data; + } + + function name() public pure returns (string memory) { + return "Secondary"; + } + + function multiply(uint256 value) public view returns (uint) { + return data * value; + } + + function shouldRevert() public pure returns (uint) { + require(false, "This should revert"); + return 1; + } +} diff --git a/e2e-tests/package.json b/e2e-tests/package.json index d047554d..1b88c87f 100644 --- a/e2e-tests/package.json +++ b/e2e-tests/package.json @@ -20,6 +20,7 @@ "chai": "^4.3.7", "eslint": "^8.48.0", "eslint-config-prettier": "^9.0.0", + "eslint-plugin-mocha": "^10.2.0", "ethers": "^5.7.2", "hardhat": "^2.12.4", "mocha": "^10.2.0", diff --git a/e2e-tests/test/debug-apis.test.ts b/e2e-tests/test/debug-apis.test.ts new file mode 100644 index 00000000..9dd77328 --- /dev/null +++ b/e2e-tests/test/debug-apis.test.ts @@ -0,0 +1,167 @@ +import { expect } from "chai"; +import { Wallet } from "zksync-web3"; +import * as hre from "hardhat"; +import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; +import { RichAccounts } from "../helpers/constants"; +import { deployContract, expectThrowsAsync, getTestProvider } from "../helpers/utils"; +import { BigNumber } from "ethers"; + +const provider = getTestProvider(); + +describe("debug_traceCall", function () { + it("Should return error if block is not 'latest' or unspecified", async function () { + expectThrowsAsync(async () => { + await provider.send("debug_traceCall", [{ to: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" }, "earliest"]); + }, "block parameter should be 'latest' or unspecified"); + + expectThrowsAsync(async () => { + await provider.send("debug_traceCall", [{ to: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" }, "1"]); + }, "block parameter should be 'latest' or unspecified"); + }); + + it("Should only trace top-level calls with onlyTopCall", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + + const deployer = new Deployer(hre, wallet); + const secondary = await deployContract(deployer, "Secondary", ["3"]); + await deployContract(deployer, "Primary", [secondary.address]); + + const result = await provider.send("debug_traceCall", [ + { + to: secondary.address, + data: secondary.interface.encodeFunctionData("multiply", ["4"]), + gas: "0x5f5e100", + }, + "latest", + { tracer: "callTracer", tracerConfig: { onlyTopCall: true } }, + ]); + + const { calls, revertReason } = result; + + // call should be successful + expect(revertReason).to.equal(null); + + // should have no subcalls + expect(calls.length).to.equal(0); + }); + + it("Should trace contract calls", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + + const deployer = new Deployer(hre, wallet); + const secondary = await deployContract(deployer, "Secondary", ["3"]); + const primary = await deployContract(deployer, "Primary", [secondary.address]); + + const result = await provider.send("debug_traceCall", [ + { + to: primary.address, + data: primary.interface.encodeFunctionData("calculate", ["4"]), + gas: "0x5f5e100", + }, + ]); + + const { calls, output, revertReason } = result; + + // call should be successful + expect(revertReason).to.equal(null); + + // subcall from primary to secondary contract should be present + const contract_call = calls[0].calls.at(-1).calls[0].calls[0]; + expect(contract_call.from.toLowerCase()).to.equal(primary.address.toLowerCase()); + expect(contract_call.to.toLowerCase()).to.equal(secondary.address.toLowerCase()); + + const [output_number] = primary.interface.decodeFunctionResult("calculate", output); + expect(output_number.toNumber()).to.equal(12); + }); +}); + +describe("debug_traceTransaction", function () { + it("Should return null if txn hash is unknown", async function () { + const result = await provider.send("debug_traceTransaction", [ + "0xd3a94ff697a573cb174ecce05126e952ecea6dee051526a3e389747ff86b0d99", + ]); + expect(result).to.equal(null); + }); + + it("Should trace prior transactions", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + + const txReceipt = await greeter.setGreeting("Luke Skywalker"); + const trace = await provider.send("debug_traceTransaction", [txReceipt.hash]); + + // call should be successful + expect(trace.error).to.equal(null); + expect(trace.calls.length).to.equal(1); + + // gas limit should match + expect(BigNumber.from(trace.gas).toNumber()).to.equal(txReceipt.gasLimit.toNumber()); + }); + + it("Should respect only_top_calls option", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + + const txReceipt = await greeter.setGreeting("Luke Skywalker"); + const trace = await provider.send("debug_traceTransaction", [ + txReceipt.hash, + { tracer: "callTracer", tracerConfig: { onlyTopCall: true } }, + ]); + + // call should be successful + expect(trace.error).to.equal(null); + expect(trace.calls.length).to.equal(0); + }); +}); + +describe("debug_traceBlockByHash", function () { + it("Should trace prior blocks", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + + const txReceipt = await greeter.setGreeting("Luke Skywalker"); + const latestBlock = await provider.getBlock("latest"); + const block = await provider.getBlock(latestBlock.number - 1); + + const traces = await provider.send("debug_traceBlockByHash", [block.hash]); + + // block should have 1 traces + expect(traces.length).to.equal(1); + + // should contain trace for our tx + const trace = traces[0].result; + expect(trace.input).to.equal(txReceipt.data); + }); +}); + +describe("debug_traceBlockByNumber", function () { + it("Should trace prior blocks", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + + const txReceipt = await greeter.setGreeting("Luke Skywalker"); + + // latest block will be empty, check we get no traces for it + const empty_traces = await provider.send("debug_traceBlockByNumber", ["latest"]); + expect(empty_traces.length).to.equal(0); + + // latest - 1 should contain our traces + const latestBlock = await provider.getBlock("latest"); + const traces = await provider.send("debug_traceBlockByNumber", [(latestBlock.number - 1).toString(16)]); + + // block should have 1 traces + expect(traces.length).to.equal(1); + + // should contain trace for our tx + const trace = traces[0].result; + expect(trace.input).to.equal(txReceipt.data); + }); +}); diff --git a/e2e-tests/test/evm-apis.test.ts b/e2e-tests/test/evm-apis.test.ts index 112b8a2f..17d6d950 100644 --- a/e2e-tests/test/evm-apis.test.ts +++ b/e2e-tests/test/evm-apis.test.ts @@ -1,8 +1,10 @@ import { expect } from "chai"; -import { getTestProvider } from "../helpers/utils"; +import * as hre from "hardhat"; +import { deployContract, getTestProvider } from "../helpers/utils"; import { Wallet } from "zksync-web3"; import { RichAccounts } from "../helpers/constants"; -import { ethers } from "ethers"; +import { BigNumber, ethers } from "ethers"; +import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; const provider = getTestProvider(); @@ -91,3 +93,41 @@ describe("evm_setTime", function () { expect(newBlockTimestamp).to.equal(expectedTimestamp); }); }); + +describe("evm_snapshot", function () { + it("Should return incrementing snapshot ids", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + expect(await greeter.greet()).to.eq("Hi"); + + // Act + const snapshotId1 = await provider.send("evm_snapshot", []); + const snapshotId2 = await provider.send("evm_snapshot", []); + + // Assert + expect(await greeter.greet()).to.eq("Hi"); + expect(BigNumber.from(snapshotId1).toString()).to.eq("1"); + expect(BigNumber.from(snapshotId2).toString()).to.eq("2"); + }); +}); + +describe("evm_revert", function () { + it("Should revert with correct snapshot id", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + expect(await greeter.greet()).to.eq("Hi"); + const snapshotId = await provider.send("evm_snapshot", []); + const setGreetingTx = await greeter.setGreeting("Hola, mundo!"); + await setGreetingTx.wait(); + expect(await greeter.greet()).to.equal("Hola, mundo!"); + + // Act + const reverted: boolean = await provider.send("evm_revert", [snapshotId]); + + // Assert + expect(await greeter.greet()).to.eq("Hi"); + expect(reverted).to.be.true; + }); +}); diff --git a/e2e-tests/test/hardhat-apis.test.ts b/e2e-tests/test/hardhat-apis.test.ts index 9c01e882..b39d635a 100644 --- a/e2e-tests/test/hardhat-apis.test.ts +++ b/e2e-tests/test/hardhat-apis.test.ts @@ -1,8 +1,12 @@ import { expect } from "chai"; import { Wallet } from "zksync-web3"; -import { getTestProvider } from "../helpers/utils"; +import { deployContract, getTestProvider } from "../helpers/utils"; import { RichAccounts } from "../helpers/constants"; import { ethers } from "hardhat"; +import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; +import * as hre from "hardhat"; +import { keccak256 } from "ethers/lib/utils"; +import { BigNumber } from "ethers"; const provider = getTestProvider(); @@ -84,3 +88,62 @@ xdescribe("hardhat_impersonateAccount & hardhat_stopImpersonatingAccount", funct expect(await provider.getBalance(RichAccounts[0].Account)).to.equal(beforeBalance.sub(0.42)); }); }); + +describe("hardhat_setCode", function () { + it("Should set code at an address", async function () { + // Arrange + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const address = "0x1000000000000000000000000000000000001111"; + const artifact = await deployer.loadArtifact("Return5"); + const contractCode = [...ethers.utils.arrayify(artifact.deployedBytecode)]; + + // Act + await provider.send("hardhat_setCode", [address, contractCode]); + + // Assert + const result = await provider.send("eth_call", [ + { + to: address, + data: keccak256(ethers.utils.toUtf8Bytes("value()")).substring(0, 10), + from: wallet.address, + gas: "0x1000", + gasPrice: "0x0ee6b280", + value: "0x0", + nonce: "0x1", + }, + "latest", + ]); + expect(BigNumber.from(result).toNumber()).to.eq(5); + }); + + it("Should update code with a different smart contract", async function () { + // Arrange + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + expect(await greeter.greet()).to.eq("Hi"); + const artifact = await deployer.loadArtifact("Return5"); + const newContractCode = [...ethers.utils.arrayify(artifact.deployedBytecode)]; + + // Act + await provider.send("hardhat_setCode", [greeter.address, newContractCode]); + + // Assert + const result = await provider.send("eth_call", [ + { + to: greeter.address, + data: keccak256(ethers.utils.toUtf8Bytes("value()")).substring(0, 10), + from: wallet.address, + gas: "0x1000", + gasPrice: "0x0ee6b280", + value: "0x0", + nonce: "0x1", + }, + "latest", + ]); + expect(BigNumber.from(result).toNumber()).to.eq(5); + }); +}); diff --git a/e2e-tests/test/zks-apis.test.ts b/e2e-tests/test/zks-apis.test.ts index 555500d4..35770486 100644 --- a/e2e-tests/test/zks-apis.test.ts +++ b/e2e-tests/test/zks-apis.test.ts @@ -1,9 +1,11 @@ import { expect } from "chai"; -import { getTestProvider } from "../helpers/utils"; +import { deployContract, getTestProvider } from "../helpers/utils"; import { Wallet } from "zksync-web3"; import { RichAccounts } from "../helpers/constants"; import { ethers } from "ethers"; +import * as hre from "hardhat"; import { TransactionRequest } from "zksync-web3/build/src/types"; +import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; const provider = getTestProvider(); @@ -14,8 +16,7 @@ interface Fee { max_priority_fee_per_gas: ethers.BigNumber; } -// TODO: Investigate why this test is failing for CI vs local development -xdescribe("zks_estimateFee", function () { +describe("zks_estimateFee", function () { it("Should return fee estimation data for transfer of 1 ETH", async function () { // Arrange const wallet = new Wallet(RichAccounts[0].PrivateKey, provider); @@ -30,7 +31,7 @@ xdescribe("zks_estimateFee", function () { const response: Fee = await provider.send("zks_estimateFee", [transaction]); // Assert - expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("1233024"), "Unexpected gas_limit"); + expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("1230957"), "Unexpected gas_limit"); expect(ethers.BigNumber.from(response.gas_per_pubdata_limit)).to.eql( ethers.BigNumber.from("4080"), "Unexpected gas_per_pubdata_limit" @@ -58,3 +59,96 @@ describe("zks_getTokenPrice", function () { expect(response).to.equal("1500"); }); }); + +describe("zks_getTransactionDetails", function () { + it("Should return transaction details for locally-executed transactions", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + + const txReceipt = await greeter.setGreeting("Luke Skywalker"); + const details = await provider.send("zks_getTransactionDetails", [txReceipt.hash]); + + expect(details["status"]).to.equal("included"); + expect(details["initiatorAddress"].toLowerCase()).to.equal(wallet.address.toLowerCase()); + }); +}); + +describe("zks_getBridgeContracts", function () { + it("Should return default values", async function () { + const bridgeAddresses = await provider.send("zks_getBridgeContracts", []); + + expect(bridgeAddresses).to.deep.equal({ + l1Erc20DefaultBridge: "0x0000000000000000000000000000000000000000", + l2Erc20DefaultBridge: "0x0000000000000000000000000000000000000000", + l1WethBridge: null, + l2WethBridge: null, + }); + }); +}); + +describe("zks_getBlockDetails", function () { + it("Should return block details for locally-produced blocks", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + await greeter.setGreeting("Luke Skywalker"); + + const latestBlock = await provider.getBlock("latest"); + const details = await provider.send("zks_getBlockDetails", [latestBlock.number]); + + expect(details["timestamp"]).to.equal(latestBlock.timestamp); + }); +}); + +describe("zks_getBytecodeByHash", function () { + it("Should fetch the stored bytecode at address", async function () { + // Arrange + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + const artifact = await deployer.loadArtifact("Greeter"); + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + const deployedContract = await greeter.deployTransaction.wait(); + expect(await greeter.greet()).to.eq("Hi"); + + // get the bytecode hash from the event + const contractDeployedHash = ethers.utils + .keccak256(ethers.utils.toUtf8Bytes("ContractDeployed(address,bytes32,address)")) + .substring(2); + const logs = await provider.send("eth_getLogs", [ + { + fromBlock: ethers.utils.hexlify(deployedContract.blockNumber), + toBlock: ethers.utils.hexlify(deployedContract.blockNumber), + address: "0x0000000000000000000000000000000000008006", // L2 Deployer address + topics: [contractDeployedHash], + }, + ]); + expect(logs).to.not.be.empty; + expect(logs[0].topics).to.have.lengthOf(4); + const bytecodeHash = logs[0].topics[2]; + + // Act + const bytecode = await provider.send("zks_getBytecodeByHash", [bytecodeHash]); + + // Assert + expect(ethers.utils.hexlify(bytecode)).to.equal(artifact.deployedBytecode); + }); +}); + +describe("zks_getRawBlockTransactions", function () { + it("Should return transactions for locally-produced blocks", async function () { + const wallet = new Wallet(RichAccounts[0].PrivateKey); + const deployer = new Deployer(hre, wallet); + + const greeter = await deployContract(deployer, "Greeter", ["Hi"]); + const receipt = await greeter.setGreeting("Luke Skywalker"); + + const latestBlock = await provider.getBlock("latest"); + const txns = await provider.send("zks_getRawBlockTransactions", [latestBlock.number - 1]); + + expect(txns.length).to.equal(1); + expect(txns[0]["execute"]["calldata"]).to.equal(receipt.data); + }); +}); diff --git a/e2e-tests/yarn.lock b/e2e-tests/yarn.lock index 6efc34cd..b417312f 100644 --- a/e2e-tests/yarn.lock +++ b/e2e-tests/yarn.lock @@ -62,15 +62,10 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.4.0": - version "4.8.2" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.8.2.tgz#26585b7c0ba36362893d3a3c206ee0c57c389616" - integrity sha512-0MGxAVt1m/ZK+LTJp/j0qF7Hz97D9O/FH9Ms3ltnyIdDD57cbb1ACIQTkbHvNXtWDv5TPq7w5Kq56+cNukbo7g== - -"@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1": - version "4.8.1" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.8.1.tgz#8c4bb756cc2aa7eaf13cfa5e69c83afb3260c20c" - integrity sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ== +"@eslint-community/regexpp@^4.4.0", "@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1": + version "4.9.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.9.1.tgz#449dfa81a57a1d755b09aa58d826c1262e4283b4" + integrity sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA== "@eslint/eslintrc@^2.1.2": version "2.1.2" @@ -87,10 +82,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.49.0": - version "8.49.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.49.0.tgz#86f79756004a97fa4df866835093f1df3d03c333" - integrity sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w== +"@eslint/js@8.51.0": + version "8.51.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.51.0.tgz#6d419c240cfb2b66da37df230f7e7eef801c32fa" + integrity sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg== "@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.7.0": version "5.7.0" @@ -434,6 +429,11 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" +"@fastify/busboy@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.0.0.tgz#f22824caff3ae506b18207bad4126dbc6ccdb6b8" + integrity sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ== + "@humanwhocodes/config-array@^0.11.11": version "0.11.11" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844" @@ -549,31 +549,31 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomicfoundation/ethereumjs-block@5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz#6f89664f55febbd723195b6d0974773d29ee133d" - integrity sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-trie" "6.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" +"@nomicfoundation/ethereumjs-block@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz#13a7968f5964f1697da941281b7f7943b0465d04" + integrity sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" ethereum-cryptography "0.1.3" ethers "^5.7.1" -"@nomicfoundation/ethereumjs-blockchain@7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz#80e0bd3535bfeb9baa29836b6f25123dab06a726" - integrity sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.1" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-ethash" "3.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-trie" "6.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" +"@nomicfoundation/ethereumjs-blockchain@7.0.2": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz#45323b673b3d2fab6b5008535340d1b8fea7d446" + integrity sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-ethash" "3.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" abstract-level "^1.0.3" debug "^4.3.3" ethereum-cryptography "0.1.3" @@ -581,103 +581,103 @@ lru-cache "^5.1.1" memory-level "^1.0.0" -"@nomicfoundation/ethereumjs-common@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz#4702d82df35b07b5407583b54a45bf728e46a2f0" - integrity sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g== +"@nomicfoundation/ethereumjs-common@4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz#a15d1651ca36757588fdaf2a7d381a150662a3c3" + integrity sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg== dependencies: - "@nomicfoundation/ethereumjs-util" "9.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.2" crc-32 "^1.2.0" -"@nomicfoundation/ethereumjs-ethash@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz#65ca494d53e71e8415c9a49ef48bc921c538fc41" - integrity sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w== +"@nomicfoundation/ethereumjs-ethash@3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz#da77147f806401ee996bfddfa6487500118addca" + integrity sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg== dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" abstract-level "^1.0.3" bigint-crypto-utils "^3.0.23" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-evm@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz#f35681e203363f69ce2b3d3bf9f44d4e883ca1f1" - integrity sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ== +"@nomicfoundation/ethereumjs-evm@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz#4c2f4b84c056047102a4fa41c127454e3f0cfcf6" + integrity sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ== dependencies: "@ethersproject/providers" "^5.7.1" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" debug "^4.3.3" ethereum-cryptography "0.1.3" mcl-wasm "^0.7.1" rustbn.js "~0.2.0" -"@nomicfoundation/ethereumjs-rlp@5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz#0b30c1cf77d125d390408e391c4bb5291ef43c28" - integrity sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ== +"@nomicfoundation/ethereumjs-rlp@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz#4fee8dc58a53ac6ae87fb1fca7c15dc06c6b5dea" + integrity sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA== -"@nomicfoundation/ethereumjs-statemanager@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz#8824a97938db4471911e2d2f140f79195def5935" - integrity sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ== +"@nomicfoundation/ethereumjs-statemanager@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz#3ba4253b29b1211cafe4f9265fee5a0d780976e0" + integrity sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA== dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" debug "^4.3.3" ethereum-cryptography "0.1.3" ethers "^5.7.1" js-sdsl "^4.1.4" -"@nomicfoundation/ethereumjs-trie@6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz#662c55f6b50659fd4b22ea9f806a7401cafb7717" - integrity sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA== +"@nomicfoundation/ethereumjs-trie@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz#9a6dbd28482dca1bc162d12b3733acab8cd12835" + integrity sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ== dependencies: - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" "@types/readable-stream" "^2.3.13" ethereum-cryptography "0.1.3" readable-stream "^3.6.0" -"@nomicfoundation/ethereumjs-tx@5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz#7629dc2036b4a33c34e9f0a592b43227ef4f0c7d" - integrity sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w== +"@nomicfoundation/ethereumjs-tx@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz#117813b69c0fdc14dd0446698a64be6df71d7e56" + integrity sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g== dependencies: "@chainsafe/ssz" "^0.9.2" "@ethersproject/providers" "^5.7.2" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-util@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz#530cda8bae33f8b5020a8f199ed1d0a2ce48ec89" - integrity sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA== +"@nomicfoundation/ethereumjs-util@9.0.2": + version "9.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz#16bdc1bb36f333b8a3559bbb4b17dac805ce904d" + integrity sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ== dependencies: "@chainsafe/ssz" "^0.10.0" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-vm@7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz#7d035e0993bcad10716c8b36e61dfb87fa3ca05f" - integrity sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.1" - "@nomicfoundation/ethereumjs-blockchain" "7.0.1" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-evm" "2.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-statemanager" "2.0.1" - "@nomicfoundation/ethereumjs-trie" "6.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" +"@nomicfoundation/ethereumjs-vm@7.0.2": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz#3b0852cb3584df0e18c182d0672a3596c9ca95e6" + integrity sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-blockchain" "7.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-evm" "2.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-statemanager" "2.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" debug "^4.3.3" ethereum-cryptography "0.1.3" mcl-wasm "^0.7.1" @@ -769,9 +769,9 @@ integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== "@scure/base@~1.1.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" - integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== "@scure/bip32@1.1.5": version "1.1.5" @@ -896,16 +896,16 @@ "@types/node" "*" "@types/bn.js@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.2.tgz#162f5238c46f4bcbac07a98561724eca1fcf0c5e" + integrity sha512-dkpZu0szUtn9UXTmw+e0AJFd4D2XAxDnsCLdc05SfqpqzPEBft8eQr8uaFitfo/dUUOZERaLec2hHMG87A4Dxg== dependencies: "@types/node" "*" "@types/chai@^4.3.4": - version "4.3.5" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.5.tgz#ae69bcbb1bebb68c4ac0b11e9d8ed04526b3562b" - integrity sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng== + version "4.3.8" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.8.tgz#aa200a264a3bc78ccfc1718eedbd3b9d5a591270" + integrity sha512-yW/qTM4mRBBcsA9Xw9FbcImYtFPY7sgr+G/O5RDYVmxiy9a+pE5FyoFUi8JYCZY5nicj8atrr1pcfPiYpeNGOA== "@types/json-schema@^7.0.12", "@types/json-schema@^7.0.9": version "7.0.13" @@ -923,19 +923,21 @@ integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== "@types/mocha@^10.0.1": - version "10.0.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.1.tgz#2f4f65bb08bc368ac39c96da7b2f09140b26851b" - integrity sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q== + version "10.0.2" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.2.tgz#96d63314255540a36bf24da094cce7a13668d73b" + integrity sha512-NaHL0+0lLNhX6d9rs+NSt97WH/gIlRHmszXbQ/8/MV/eVcFNdeJ/GYhrFuUc8K7WuPhRhTSdMkCp8VMzhUq85w== "@types/node@*": - version "20.5.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.0.tgz#7fc8636d5f1aaa3b21e6245e97d56b7f56702313" - integrity sha512-Mgq7eCtoTjT89FqNoTzzXg2XvCi5VMhRV6+I2aYanc6kQCBImeNaAYRs/DyoVqk1YEUJK5gN9VO7HRIdz4Wo3Q== + version "20.8.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.5.tgz#13352ae1f80032171616910e8aba2e3e52e57d96" + integrity sha512-SPlobFgbidfIeOYlzXiEjSYeIJiOCthv+9tSQVpvk4PAdIIc+2SmjNVzWXk9t0Y7dl73Zdf+OgXKHX9XtkqUpw== + dependencies: + undici-types "~5.25.1" "@types/node@^18.17.12": - version "18.17.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.18.tgz#acae19ad9011a2ab3d792232501c95085ba1838f" - integrity sha512-/4QOuy3ZpV7Ya1GTRz5CYSz3DgkKpyUptXuQ5PPce7uuyJAOR7r9FhkmxJfvcNUXyklbC63a+YvB3jxy7s9ngw== + version "18.18.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.5.tgz#afc0fd975df946d6e1add5bbf98264225b212244" + integrity sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A== "@types/pbkdf2@^3.0.0": version "3.1.0" @@ -953,22 +955,17 @@ safe-buffer "~5.1.1" "@types/secp256k1@^4.0.1": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" - integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.4.tgz#33c760de627fce1f449c2d4270da07e4da54c830" + integrity sha512-oN0PFsYxDZnX/qSJ5S5OwaEDTYfekhvaM5vqui2bu1AA39pKofmgL104Q29KiOXizXS2yLjSzc5YdTyMKdcy4A== dependencies: "@types/node" "*" -"@types/semver@^7.3.12": +"@types/semver@^7.3.12", "@types/semver@^7.5.0": version "7.5.3" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.3.tgz#9a726e116beb26c24f1ccd6850201e1246122e04" integrity sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw== -"@types/semver@^7.5.0": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.2.tgz#31f6eec1ed7ec23f4f05608d3a2d381df041f564" - integrity sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw== - "@typescript-eslint/eslint-plugin@^5.0.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db" @@ -986,15 +983,15 @@ tsutils "^3.21.0" "@typescript-eslint/eslint-plugin@latest": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.2.tgz#f18cc75c9cceac8080a9dc2e7d166008c5207b9f" - integrity sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q== + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.5.tgz#f4024b9f63593d0c2b5bd6e4ca027e6f30934d4f" + integrity sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.7.2" - "@typescript-eslint/type-utils" "6.7.2" - "@typescript-eslint/utils" "6.7.2" - "@typescript-eslint/visitor-keys" "6.7.2" + "@typescript-eslint/scope-manager" "6.7.5" + "@typescript-eslint/type-utils" "6.7.5" + "@typescript-eslint/utils" "6.7.5" + "@typescript-eslint/visitor-keys" "6.7.5" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -1013,14 +1010,14 @@ debug "^4.3.4" "@typescript-eslint/parser@latest": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.2.tgz#e0ae93771441b9518e67d0660c79e3a105497af4" - integrity sha512-KA3E4ox0ws+SPyxQf9iSI25R6b4Ne78ORhNHeVKrPQnoYsb9UhieoiRoJgrzgEeKGOXhcY1i8YtOeCHHTDa6Fw== - dependencies: - "@typescript-eslint/scope-manager" "6.7.2" - "@typescript-eslint/types" "6.7.2" - "@typescript-eslint/typescript-estree" "6.7.2" - "@typescript-eslint/visitor-keys" "6.7.2" + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.5.tgz#8d7ca3d1fbd9d5a58cc4d30b2aa797a760137886" + integrity sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw== + dependencies: + "@typescript-eslint/scope-manager" "6.7.5" + "@typescript-eslint/types" "6.7.5" + "@typescript-eslint/typescript-estree" "6.7.5" + "@typescript-eslint/visitor-keys" "6.7.5" debug "^4.3.4" "@typescript-eslint/scope-manager@5.62.0": @@ -1031,13 +1028,13 @@ "@typescript-eslint/types" "5.62.0" "@typescript-eslint/visitor-keys" "5.62.0" -"@typescript-eslint/scope-manager@6.7.2": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.2.tgz#cf59a2095d2f894770c94be489648ad1c78dc689" - integrity sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw== +"@typescript-eslint/scope-manager@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz#1cf33b991043886cd67f4f3600b8e122fc14e711" + integrity sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A== dependencies: - "@typescript-eslint/types" "6.7.2" - "@typescript-eslint/visitor-keys" "6.7.2" + "@typescript-eslint/types" "6.7.5" + "@typescript-eslint/visitor-keys" "6.7.5" "@typescript-eslint/type-utils@5.62.0": version "5.62.0" @@ -1049,13 +1046,13 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/type-utils@6.7.2": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.2.tgz#ed921c9db87d72fa2939fee242d700561454f367" - integrity sha512-36F4fOYIROYRl0qj95dYKx6kybddLtsbmPIYNK0OBeXv2j9L5nZ17j9jmfy+bIDHKQgn2EZX+cofsqi8NPATBQ== +"@typescript-eslint/type-utils@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.5.tgz#0a65949ec16588d8956f6d967f7d9c84ddb2d72a" + integrity sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g== dependencies: - "@typescript-eslint/typescript-estree" "6.7.2" - "@typescript-eslint/utils" "6.7.2" + "@typescript-eslint/typescript-estree" "6.7.5" + "@typescript-eslint/utils" "6.7.5" debug "^4.3.4" ts-api-utils "^1.0.1" @@ -1064,10 +1061,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== -"@typescript-eslint/types@6.7.2": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.2.tgz#75a615a6dbeca09cafd102fe7f465da1d8a3c066" - integrity sha512-flJYwMYgnUNDAN9/GAI3l8+wTmvTYdv64fcH8aoJK76Y+1FCZ08RtI5zDerM/FYT5DMkAc+19E4aLmd5KqdFyg== +"@typescript-eslint/types@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.5.tgz#4571320fb9cf669de9a95d9849f922c3af809790" + integrity sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ== "@typescript-eslint/typescript-estree@5.62.0": version "5.62.0" @@ -1082,13 +1079,13 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@6.7.2": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.2.tgz#ce5883c23b581a5caf878af641e49dd0349238c7" - integrity sha512-kiJKVMLkoSciGyFU0TOY0fRxnp9qq1AzVOHNeN1+B9erKFCJ4Z8WdjAkKQPP+b1pWStGFqezMLltxO+308dJTQ== +"@typescript-eslint/typescript-estree@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz#4578de1a26e9f24950f029a4f00d1bfe41f15a39" + integrity sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg== dependencies: - "@typescript-eslint/types" "6.7.2" - "@typescript-eslint/visitor-keys" "6.7.2" + "@typescript-eslint/types" "6.7.5" + "@typescript-eslint/visitor-keys" "6.7.5" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -1109,17 +1106,17 @@ eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/utils@6.7.2": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.2.tgz#b9ef0da6f04932167a9222cb4ac59cb187165ebf" - integrity sha512-ZCcBJug/TS6fXRTsoTkgnsvyWSiXwMNiPzBUani7hDidBdj1779qwM1FIAmpH4lvlOZNF3EScsxxuGifjpLSWQ== +"@typescript-eslint/utils@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.5.tgz#ab847b53d6b65e029314b8247c2336843dba81ab" + integrity sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.7.2" - "@typescript-eslint/types" "6.7.2" - "@typescript-eslint/typescript-estree" "6.7.2" + "@typescript-eslint/scope-manager" "6.7.5" + "@typescript-eslint/types" "6.7.5" + "@typescript-eslint/typescript-estree" "6.7.5" semver "^7.5.4" "@typescript-eslint/visitor-keys@5.62.0": @@ -1130,12 +1127,12 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@6.7.2": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz#4cb2bd786f1f459731b0ad1584c9f73e1c7a4d5c" - integrity sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ== +"@typescript-eslint/visitor-keys@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz#84c68d6ceb5b12d5246b918b84f2b79affd6c2f1" + integrity sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg== dependencies: - "@typescript-eslint/types" "6.7.2" + "@typescript-eslint/types" "6.7.5" eslint-visitor-keys "^3.4.1" "@vue/eslint-config-prettier@^7.0.0": @@ -1560,13 +1557,6 @@ buildcheck@~0.0.6: resolved "https://registry.yarnpkg.com/buildcheck/-/buildcheck-0.0.6.tgz#89aa6e417cfd1e2196e3f8fe915eb709d2fe4238" integrity sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A== -busboy@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" - integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== - dependencies: - streamsearch "^1.1.0" - bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -1601,17 +1591,17 @@ catering@^2.1.0, catering@^2.1.1: integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== chai@^4.3.7: - version "4.3.7" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" - integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== + version "4.3.10" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.10.tgz#d784cec635e3b7e2ffb66446a63b4e33bd390384" + integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== dependencies: assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^4.1.2" - get-func-name "^2.0.0" - loupe "^2.3.1" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" pathval "^1.1.1" - type-detect "^4.0.5" + type-detect "^4.0.8" chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1630,10 +1620,12 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== +check-error@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" + integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== + dependencies: + get-func-name "^2.0.2" chokidar@3.5.3, chokidar@^3.4.0: version "3.5.3" @@ -1758,9 +1750,9 @@ core-util-is@~1.0.0: integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== cpu-features@~0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/cpu-features/-/cpu-features-0.0.8.tgz#a2d464b023b8ad09004c8cdca23b33f192f63546" - integrity sha512-BbHBvtYhUhksqTjr6bhNOjGgMnhwhGTQmOoZGD+K7BCaQDCuZl/Ve1ZxUSMRwVC4D/rkCPQ2MAIeYzrWyK7eEg== + version "0.0.9" + resolved "https://registry.yarnpkg.com/cpu-features/-/cpu-features-0.0.9.tgz#5226b92f0f1c63122b0a3eb84cb8335a4de499fc" + integrity sha512-AKjgn2rP2yJyfbepsmLfiYcmtNn/2eUvocUyM/09yB0YDiz39HteK/5/T4Onf0pmdYDMgkBoGvRLvEguzyL7wQ== dependencies: buildcheck "~0.0.6" nan "^2.17.0" @@ -1831,7 +1823,7 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -deep-eql@^4.1.2: +deep-eql@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== @@ -1844,9 +1836,9 @@ deep-is@^0.1.3: integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== define-data-property@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.0.tgz#0db13540704e1d8d479a0656cf781267531b9451" - integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g== + version "1.1.1" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" + integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== dependencies: get-intrinsic "^1.2.1" gopd "^1.0.1" @@ -2107,6 +2099,14 @@ eslint-plugin-import@^2.26.0: semver "^6.3.1" tsconfig-paths "^3.14.2" +eslint-plugin-mocha@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-10.2.0.tgz#15b05ce5be4b332bb0d76826ec1c5ebf67102ad6" + integrity sha512-ZhdxzSZnd1P9LqDPF0DBcFLpRIGdh1zkF2JHnQklKQOvrQtT73kdP5K9V2mzvbLR+cCAO9OI48NXK/Ax9/ciCQ== + dependencies: + eslint-utils "^3.0.0" + rambda "^7.4.0" + eslint-plugin-prettier@^4.0.0: version "4.2.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" @@ -2160,14 +2160,14 @@ eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4 integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.48.0: - version "8.49.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.49.0.tgz#09d80a89bdb4edee2efcf6964623af1054bf6d42" - integrity sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ== + version "8.51.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.51.0.tgz#4a82dae60d209ac89a5cff1604fea978ba4950f3" + integrity sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" "@eslint/eslintrc" "^2.1.2" - "@eslint/js" "8.49.0" + "@eslint/js" "8.51.0" "@humanwhocodes/config-array" "^0.11.11" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -2412,11 +2412,11 @@ find-up@^2.1.0: locate-path "^2.0.0" flat-cache@^3.0.4: - version "3.1.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.0.tgz#0e54ab4a1a60fe87e2946b6b00657f1c99e1af3f" - integrity sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew== + version "3.1.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.1.tgz#a02a15fdec25a8f844ff7cc658f03dd99eb4609b" + integrity sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q== dependencies: - flatted "^3.2.7" + flatted "^3.2.9" keyv "^4.5.3" rimraf "^3.0.2" @@ -2425,15 +2425,15 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -flatted@^3.2.7: +flatted@^3.2.9: version "3.2.9" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== follow-redirects@^1.12.1: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== for-each@^0.3.3: version "0.3.3" @@ -2492,14 +2492,14 @@ fs.realpath@^1.0.0: integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== function.prototype.name@^1.1.6: version "1.1.6" @@ -2526,10 +2526,10 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== +get-func-name@^2.0.0, get-func-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" @@ -2588,9 +2588,9 @@ glob@^7.1.3: path-is-absolute "^1.0.0" globals@^13.19.0: - version "13.22.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.22.0.tgz#0c9fcb9c48a2494fbb5edbfee644285543eba9d8" - integrity sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw== + version "13.23.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.23.0.tgz#ef31673c926a0976e1f61dab4dca57e0c0a8af02" + integrity sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA== dependencies: type-fest "^0.20.2" @@ -2631,22 +2631,22 @@ graphemer@^1.4.0: integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== hardhat@^2.12.4: - version "2.17.1" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.17.1.tgz#4b6c8c8f624fd23d9f40185a4af24815d05a486a" - integrity sha512-1PxRkfjhEzXs/wDxI5YgzYBxNmvzifBTjYzuopwel+vXpAhCudplusJthN5eig0FTs4qbi828DBIITEDh8x9LA== + version "2.18.1" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.18.1.tgz#6339d656dbf0510b51457b0f0746e5b9cc7a1756" + integrity sha512-b55rW7Ka+fvJeg6oWuBTXoYQEUurevCCankjGNTwczwD3GnkhV9GEei7KUT+9IKmWx3lC+zyxlFxeDbg0gUoHw== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/ethereumjs-block" "5.0.1" - "@nomicfoundation/ethereumjs-blockchain" "7.0.1" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-evm" "2.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-statemanager" "2.0.1" - "@nomicfoundation/ethereumjs-trie" "6.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - "@nomicfoundation/ethereumjs-vm" "7.0.1" + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-blockchain" "7.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-evm" "2.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-statemanager" "2.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + "@nomicfoundation/ethereumjs-vm" "7.0.2" "@nomicfoundation/solidity-analyzer" "^0.1.0" "@sentry/node" "^5.18.1" "@types/bn.js" "^5.1.0" @@ -2724,11 +2724,9 @@ has-tostringtag@^1.0.0: has-symbols "^1.0.2" has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" + version "1.0.4" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.4.tgz#2eb2860e000011dae4f1406a86fe80e530fb2ec6" + integrity sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ== hash-base@^3.0.0: version "3.1.0" @@ -2798,9 +2796,9 @@ ignore@^5.2.0, ignore@^5.2.4: integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== immutable@^4.0.0-rc.12: - version "4.3.2" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.2.tgz#f89d910f8dfb6e15c03b2cae2faaf8c1f66455fe" - integrity sha512-oGXzbEDem9OOpDWZu88jGiYCvIsLHMvGw+8OXlpsvTFvIQplQbjg1B1cvKg8f7Hoch6+NGjpPsH1Fr+Mc2D1aA== + version "4.3.4" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f" + integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA== import-fresh@^3.2.1: version "3.3.0" @@ -3089,18 +3087,18 @@ jsonparse@^1.2.0: integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== keccak@^3.0.0, keccak@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" - integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== + version "3.0.4" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== dependencies: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" readable-stream "^3.6.0" keyv@^4.5.3: - version "4.5.3" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.3.tgz#00873d2b046df737963157bd04f294ca818c9c25" - integrity sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug== + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== dependencies: json-buffer "3.0.1" @@ -3178,7 +3176,7 @@ log-symbols@4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -loupe@^2.3.1: +loupe@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== @@ -3369,9 +3367,9 @@ ms@2.1.3, ms@^2.1.1: integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== nan@^2.17.0: - version "2.17.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" - integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== + version "2.18.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" + integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== nanoid@3.3.3: version "3.3.3" @@ -3399,16 +3397,16 @@ node-addon-api@^2.0.0: integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== node-fetch@^2.6.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" - integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== + version "4.6.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" + integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" @@ -3672,6 +3670,11 @@ queue-microtask@^1.2.2, queue-microtask@^1.2.3: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +rambda@^7.4.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/rambda/-/rambda-7.5.0.tgz#1865044c59bc0b16f63026c6e5a97e4b1bbe98fe" + integrity sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -3760,9 +3763,9 @@ resolve@1.17.0: path-parse "^1.0.6" resolve@^1.22.4: - version "1.22.6" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.6.tgz#dd209739eca3aef739c626fea1b4f3c506195362" - integrity sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw== + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: is-core-module "^2.13.0" path-parse "^1.0.7" @@ -4012,11 +4015,6 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -streamsearch@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" - integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== - string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -4286,7 +4284,7 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@^4.0.0, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== @@ -4365,12 +4363,17 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~5.25.1: + version "5.25.3" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3" + integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA== + undici@^5.14.0: - version "5.23.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.23.0.tgz#e7bdb0ed42cebe7b7aca87ced53e6eaafb8f8ca0" - integrity sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg== + version "5.26.3" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.26.3.tgz#ab3527b3d5bb25b12f898dfd22165d472dd71b79" + integrity sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw== dependencies: - busboy "^1.6.0" + "@fastify/busboy" "^2.0.0" universalify@^0.1.0: version "0.1.2" diff --git a/etc/system-contracts/contracts/Console.sol b/etc/system-contracts/contracts/Console.sol deleted file mode 100644 index 87106a90..00000000 --- a/etc/system-contracts/contracts/Console.sol +++ /dev/null @@ -1,159 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.4.22 <0.9.0; - -// List of console.log methods supported by our VM. -// Look at console_log.rs file to see how they are catched and displayed (only if TRACE level logging is enabled for console target). -// We don't support all the log methods (for example hardhat supports all type combinations up to 4) - as this drastically increases the compilation time. -library Console { - address constant CONSOLE_ADDRESS = - 0x000000000000000000636F6e736F6c652e6c6f67; - - function _sendLogPayload(bytes memory payload) private view { - address consoleAddress = CONSOLE_ADDRESS; - /// @solidity memory-safe-assembly - assembly { - pop( - staticcall( - gas(), - consoleAddress, - add(payload, 32), - mload(payload), - 0, - 0 - ) - ) - } - } - - function log() public view { - _sendLogPayload(abi.encodeWithSignature("log()")); - } - - function logInt(int256 p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(int256)", p0)); - } - - function logUint(uint256 p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); - } - - function logString(string memory p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function logBool(bool p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function logAddress(address p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function logBytes(bytes memory p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); - } - - function logBytes1(bytes1 p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); - } - - function logBytes2(bytes2 p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); - } - - function logBytes3(bytes3 p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); - } - - function logBytes4(bytes4 p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); - } - - function log(uint256 p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); - } - - function log(string memory p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function log(bool p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function log(address p0) public view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function log(uint256 p0, uint256 p1) public view { - _sendLogPayload( - abi.encodeWithSignature("log(uint256,uint256)", p0, p1) - ); - } - - function log(uint256 p0, string memory p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,string)", p0, p1)); - } - - function log(uint256 p0, bool p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(uint256,bool)", p0, p1)); - } - - function log(uint256 p0, address p1) public view { - _sendLogPayload( - abi.encodeWithSignature("log(uint256,address)", p0, p1) - ); - } - - function log(string memory p0, uint256 p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint256)", p0, p1)); - } - - function log(string memory p0, string memory p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); - } - - function log(string memory p0, bool p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); - } - - function log(string memory p0, address p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); - } - - function log(bool p0, uint256 p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint256)", p0, p1)); - } - - function log(bool p0, string memory p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); - } - - function log(bool p0, bool p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); - } - - function log(bool p0, address p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); - } - - function log(address p0, uint256 p1) public view { - _sendLogPayload( - abi.encodeWithSignature("log(address,uint256)", p0, p1) - ); - } - - function log(address p0, string memory p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); - } - - function log(address p0, bool p1) public view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); - } - - function log(address p0, address p1) public view { - _sendLogPayload( - abi.encodeWithSignature("log(address,address)", p0, p1) - ); - } -} diff --git a/etc/test-contracts/.gitignore b/etc/test-contracts/.gitignore new file mode 100644 index 00000000..b922ea06 --- /dev/null +++ b/etc/test-contracts/.gitignore @@ -0,0 +1,5 @@ +node_modules +typechain-types +cache-zk +artifacts-zk +build-info diff --git a/etc/test-contracts/SystemConfig.json b/etc/test-contracts/SystemConfig.json new file mode 100644 index 00000000..5ac25bb6 --- /dev/null +++ b/etc/test-contracts/SystemConfig.json @@ -0,0 +1,17 @@ +{ + "GUARANTEED_PUBDATA_BYTES": 4000, + "MAX_PUBDATA_PER_BATCH": 110000, + "MAX_TRANSACTIONS_IN_BATCH": 1024, + "BATCH_OVERHEAD_L2_GAS": 1200000, + "BATCH_OVERHEAD_L1_GAS": 1000000, + "L2_TX_INTRINSIC_GAS": 14070, + "L2_TX_INTRINSIC_PUBDATA": 0, + "L1_TX_INTRINSIC_L2_GAS": 167157, + "L1_TX_INTRINSIC_PUBDATA": 88, + "MAX_GAS_PER_TRANSACTION": 80000000, + "BOOTLOADER_MEMORY_FOR_TXS": 485225, + "REFUND_GAS": 7343, + "KECCAK_ROUND_COST_GAS": 40, + "SHA256_ROUND_COST_GAS": 7, + "ECRECOVER_COST_GAS": 1112 +} diff --git a/etc/test-contracts/contracts/tracing/Primary.sol b/etc/test-contracts/contracts/tracing/Primary.sol new file mode 100644 index 00000000..272d253f --- /dev/null +++ b/etc/test-contracts/contracts/tracing/Primary.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "./Secondary.sol"; + +contract Primary { + Secondary secondary; + + constructor(address _secondary) { + secondary = Secondary(_secondary); + } + + function name() public pure returns (string memory) { + return "Primary"; + } + + function calculate(uint256 value) public returns (uint) { + return secondary.multiply(value); + } + + function shouldRevert() public view returns (uint) { + return secondary.shouldRevert(); + } +} diff --git a/etc/test-contracts/contracts/tracing/Secondary.sol b/etc/test-contracts/contracts/tracing/Secondary.sol new file mode 100644 index 00000000..43c0cb3e --- /dev/null +++ b/etc/test-contracts/contracts/tracing/Secondary.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +contract Secondary { + uint data; + + constructor(uint _data) { + data = _data; + } + + function name() public pure returns (string memory) { + return "Secondary"; + } + + function multiply(uint256 value) public view returns (uint) { + return data * value; + } + + function shouldRevert() public pure returns (uint) { + require(false, "This should revert"); + return 1; + } +} diff --git a/etc/test-contracts/hardhat.config.ts b/etc/test-contracts/hardhat.config.ts new file mode 100644 index 00000000..6756762b --- /dev/null +++ b/etc/test-contracts/hardhat.config.ts @@ -0,0 +1,37 @@ +import '@nomiclabs/hardhat-solpp'; +import '@typechain/hardhat' +import '@nomiclabs/hardhat-ethers'; +import '@matterlabs/hardhat-zksync-solc'; + +const systemConfig = require('./SystemConfig.json'); + +export default { + zksolc: { + version: '1.3.14', + compilerSource: 'binary', + settings: { + isSystem: true + } + }, + zkSyncDeploy: { + zkSyncNetwork: 'http://localhost:3050', + ethNetwork: 'http://localhost:8545' + }, + solidity: { + version: '0.8.17' + }, + solpp: { + defs: (() => { + return { + ECRECOVER_COST_GAS: systemConfig.ECRECOVER_COST_GAS, + KECCAK_ROUND_COST_GAS: systemConfig.KECCAK_ROUND_COST_GAS, + SHA256_ROUND_COST_GAS: systemConfig.SHA256_ROUND_COST_GAS + } + })() + }, + networks: { + hardhat: { + zksync: true + } + } +}; diff --git a/etc/test-contracts/package.json b/etc/test-contracts/package.json new file mode 100644 index 00000000..f934e4a2 --- /dev/null +++ b/etc/test-contracts/package.json @@ -0,0 +1,48 @@ +{ + "name": "system-contracts", + "version": "0.1.0", + "repository": "git@github.com:matter-labs/system-contracts.git", + "license": "MIT", + "dependencies": { + "@matterlabs/hardhat-zksync-deploy": "^0.6.5", + "@nomiclabs/hardhat-solpp": "^2.0.1", + "commander": "^9.4.1", + "ethers": "^5.7.0", + "hardhat": "^2.11.0", + "preprocess": "^3.2.0", + "zksync-web3": "^0.13.0" + }, + "devDependencies": { + "@matterlabs/hardhat-zksync-solc": "^0.4.2", + "@nomiclabs/hardhat-ethers": "^2.0.6", + "@typechain/ethers-v5": "^10.0.0", + "@typechain/ethers-v6": "0.4.0", + "@typechain/hardhat": "8.0.0", + "@types/chai": "^4.3.1", + "@types/mocha": "^9.1.1", + "@types/node": "^17.0.34", + "chai": "^4.3.6", + "mocha": "^10.0.0", + "prettier": "^2.3.0", + "prettier-plugin-solidity": "^1.0.0-alpha.27", + "template-file": "^6.0.1", + "ts-generator": "^0.1.1", + "ts-node": "^10.7.0", + "typechain": "^8.1.1", + "typescript": "^4.6.4" + }, + "mocha": { + "timeout": 240000, + "exit": true, + "color": false, + "slow": 0, + "require": [ + "ts-node/register" + ] + }, + "scripts": { + "build": "hardhat compile", + "clean": "hardhat clean" + }, + "packageManager": "yarn@1.22.19" +} \ No newline at end of file diff --git a/etc/test-contracts/yarn.lock b/etc/test-contracts/yarn.lock new file mode 100644 index 00000000..ca539f0c --- /dev/null +++ b/etc/test-contracts/yarn.lock @@ -0,0 +1,3519 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@balena/dockerignore@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@balena/dockerignore/-/dockerignore-1.0.2.tgz#9ffe4726915251e8eb69f44ef3547e0da2c03e0d" + integrity sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q== + +"@blakek/curry@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@blakek/curry/-/curry-2.0.2.tgz#979e927bcf5fa0426d2af681d7131df5791d1cd4" + integrity sha512-B/KkDnZqm9Y92LwETU80BaxbQ61bYTR2GaAY41mKisaICwBoC8lcuw7lwQLl52InMhviCTJBO39GJOA8d+BrVw== + +"@blakek/deep@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@blakek/deep/-/deep-2.2.0.tgz#eb97488e4a0943df4da09ad50efba4a98789f5e5" + integrity sha512-aRq/qF1yrlhCWNk2tI4epXNpo+cA8/MrxsR5oIkpKKNYtYOQKjAxRMbgnhASPx+b328MkDN+T706yFKJg8VZkQ== + dependencies: + "@blakek/curry" "^2.0.2" + pathington "^1.1.7" + +"@chainsafe/as-sha256@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz#3639df0e1435cab03f4d9870cc3ac079e57a6fc9" + integrity sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg== + +"@chainsafe/persistent-merkle-tree@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz#4c9ee80cc57cd3be7208d98c40014ad38f36f7ff" + integrity sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + +"@chainsafe/persistent-merkle-tree@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz#2b4a62c9489a5739dedd197250d8d2f5427e9f63" + integrity sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + +"@chainsafe/ssz@^0.10.0": + version "0.10.2" + resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.10.2.tgz#c782929e1bb25fec66ba72e75934b31fd087579e" + integrity sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + "@chainsafe/persistent-merkle-tree" "^0.5.0" + +"@chainsafe/ssz@^0.9.2": + version "0.9.4" + resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.9.4.tgz#696a8db46d6975b600f8309ad3a12f7c0e310497" + integrity sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + "@chainsafe/persistent-merkle-tree" "^0.4.2" + case "^1.6.3" + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" + integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/contracts@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" + integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" + integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" + integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" + integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + +"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.1", "@ethersproject/providers@^5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" + integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + bech32 "1.1.4" + ws "7.4.6" + +"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" + integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + hash.js "1.1.7" + +"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" + integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/units@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" + integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/wallet@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" + integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/json-wallets" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" + integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@matterlabs/hardhat-zksync-deploy@^0.6.5": + version "0.6.5" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-deploy/-/hardhat-zksync-deploy-0.6.5.tgz#fe56bf30850e71c8d328ac1a06a100c1a0af6e3e" + integrity sha512-EZpvn8pDslfO3UA2obT8FOi5jsHhxYS5ndIR7tjL2zXKbvkbpoJR5rgKoGTJJm0riaCud674sQcxMOybVQ+2gg== + dependencies: + "@matterlabs/hardhat-zksync-solc" "0.4.2" + chalk "4.1.2" + ts-morph "^19.0.0" + +"@matterlabs/hardhat-zksync-solc@0.4.2", "@matterlabs/hardhat-zksync-solc@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.4.2.tgz#64121082e88c5ab22eb4e9594d120e504f6af499" + integrity sha512-6NFWPSZiOAoo7wNuhMg4ztj7mMEH+tLrx09WuCbcURrHPijj/KxYNsJD6Uw5lapKr7G8H7SQISGid1/MTXVmXQ== + dependencies: + "@nomiclabs/hardhat-docker" "^2.0.0" + chalk "4.1.2" + dockerode "^3.3.4" + fs-extra "^11.1.1" + proper-lockfile "^4.1.2" + semver "^7.5.1" + +"@metamask/eth-sig-util@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" + integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== + dependencies: + ethereumjs-abi "^0.6.8" + ethereumjs-util "^6.2.1" + ethjs-util "^0.1.6" + tweetnacl "^1.0.3" + tweetnacl-util "^0.15.1" + +"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== + +"@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@nomicfoundation/ethereumjs-block@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz#13a7968f5964f1697da941281b7f7943b0465d04" + integrity sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + ethereum-cryptography "0.1.3" + ethers "^5.7.1" + +"@nomicfoundation/ethereumjs-blockchain@7.0.2": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz#45323b673b3d2fab6b5008535340d1b8fea7d446" + integrity sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-ethash" "3.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + abstract-level "^1.0.3" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + level "^8.0.0" + lru-cache "^5.1.1" + memory-level "^1.0.0" + +"@nomicfoundation/ethereumjs-common@4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz#a15d1651ca36757588fdaf2a7d381a150662a3c3" + integrity sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg== + dependencies: + "@nomicfoundation/ethereumjs-util" "9.0.2" + crc-32 "^1.2.0" + +"@nomicfoundation/ethereumjs-ethash@3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz#da77147f806401ee996bfddfa6487500118addca" + integrity sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + abstract-level "^1.0.3" + bigint-crypto-utils "^3.0.23" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-evm@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz#4c2f4b84c056047102a4fa41c127454e3f0cfcf6" + integrity sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ== + dependencies: + "@ethersproject/providers" "^5.7.1" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + mcl-wasm "^0.7.1" + rustbn.js "~0.2.0" + +"@nomicfoundation/ethereumjs-rlp@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz#4fee8dc58a53ac6ae87fb1fca7c15dc06c6b5dea" + integrity sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA== + +"@nomicfoundation/ethereumjs-statemanager@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz#3ba4253b29b1211cafe4f9265fee5a0d780976e0" + integrity sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + ethers "^5.7.1" + js-sdsl "^4.1.4" + +"@nomicfoundation/ethereumjs-trie@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz#9a6dbd28482dca1bc162d12b3733acab8cd12835" + integrity sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + "@types/readable-stream" "^2.3.13" + ethereum-cryptography "0.1.3" + readable-stream "^3.6.0" + +"@nomicfoundation/ethereumjs-tx@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz#117813b69c0fdc14dd0446698a64be6df71d7e56" + integrity sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g== + dependencies: + "@chainsafe/ssz" "^0.9.2" + "@ethersproject/providers" "^5.7.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-util@9.0.2": + version "9.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz#16bdc1bb36f333b8a3559bbb4b17dac805ce904d" + integrity sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ== + dependencies: + "@chainsafe/ssz" "^0.10.0" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-vm@7.0.2": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz#3b0852cb3584df0e18c182d0672a3596c9ca95e6" + integrity sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-blockchain" "7.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-evm" "2.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-statemanager" "2.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + mcl-wasm "^0.7.1" + rustbn.js "~0.2.0" + +"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" + integrity sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w== + +"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz#6e25ccdf6e2d22389c35553b64fe6f3fdaec432c" + integrity sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA== + +"@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz#0a224ea50317139caeebcdedd435c28a039d169c" + integrity sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA== + +"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz#dfa085d9ffab9efb2e7b383aed3f557f7687ac2b" + integrity sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg== + +"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz#c9e06b5d513dd3ab02a7ac069c160051675889a4" + integrity sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w== + +"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz#8d328d16839e52571f72f2998c81e46bf320f893" + integrity sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA== + +"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz#9b49d0634b5976bb5ed1604a1e1b736f390959bb" + integrity sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w== + +"@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz#e2867af7264ebbcc3131ef837878955dd6a3676f" + integrity sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg== + +"@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz#0685f78608dd516c8cdfb4896ed451317e559585" + integrity sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ== + +"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz#c9a44f7108646f083b82e851486e0f6aeb785836" + integrity sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw== + +"@nomicfoundation/solidity-analyzer@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz#f5f4d36d3f66752f59a57e7208cd856f3ddf6f2d" + integrity sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg== + optionalDependencies: + "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.1" + "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-freebsd-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" + +"@nomiclabs/hardhat-docker@^2.0.0": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-docker/-/hardhat-docker-2.0.2.tgz#ae964be17951275a55859ff7358e9e7c77448846" + integrity sha512-XgGEpRT3wlA1VslyB57zyAHV+oll8KnV1TjwnxxC1tpAL04/lbdwpdO5KxInVN8irMSepqFpsiSkqlcnvbE7Ng== + dependencies: + dockerode "^2.5.8" + fs-extra "^7.0.1" + node-fetch "^2.6.0" + +"@nomiclabs/hardhat-ethers@^2.0.6": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0" + integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg== + +"@nomiclabs/hardhat-solpp@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-solpp/-/hardhat-solpp-2.0.1.tgz#04039b3745b8d2b48c9b8bec6509e9785631aaba" + integrity sha512-aWYvB91GPJcnye4Ph26Jd9BfBNNisI1iRNSbHB2i09OpxucSHAPMvvqTfWDN1HE5EMjqlTJ2rQLdlDcYqQxPJw== + dependencies: + fs-extra "^7.0.1" + solpp "^0.11.5" + +"@scure/base@~1.1.0": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + +"@scure/bip32@1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" + integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== + dependencies: + "@noble/hashes" "~1.2.0" + "@noble/secp256k1" "~1.7.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" + integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== + dependencies: + "@noble/hashes" "~1.2.0" + "@scure/base" "~1.1.0" + +"@sentry/core@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" + integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/hub@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" + integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== + dependencies: + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/minimal@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" + integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sentry/node@^5.18.1": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" + integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== + dependencies: + "@sentry/core" "5.30.0" + "@sentry/hub" "5.30.0" + "@sentry/tracing" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" + integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/types@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" + integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== + +"@sentry/utils@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" + integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== + dependencies: + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@solidity-parser/parser@^0.16.0": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.16.1.tgz#f7c8a686974e1536da0105466c4db6727311253c" + integrity sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw== + dependencies: + antlr4ts "^0.5.0-alpha.4" + +"@ts-morph/common@~0.20.0": + version "0.20.0" + resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" + integrity sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q== + dependencies: + fast-glob "^3.2.12" + minimatch "^7.4.3" + mkdirp "^2.1.6" + path-browserify "^1.0.1" + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + +"@typechain/ethers-v5@^10.0.0": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-10.2.1.tgz#50241e6957683281ecfa03fb5a6724d8a3ce2391" + integrity sha512-n3tQmCZjRE6IU4h6lqUGiQ1j866n5MTCBJreNEHHVWXa2u9GJTaeYyU1/k+1qLutkyw+sS6VAN+AbeiTqsxd/A== + dependencies: + lodash "^4.17.15" + ts-essentials "^7.0.1" + +"@typechain/ethers-v6@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v6/-/ethers-v6-0.4.0.tgz#fb9e9b8eeadc455fd1fc9048b2340309860deaca" + integrity sha512-vD3Agzz63Gf2XlU3ed2/y+8dLWQj+wf+4Eq+0JXsyOio/plyV5F6r0yYe+s3XdGI858U3Sr263pl8mliDrUqbw== + dependencies: + lodash "^4.17.15" + ts-essentials "^7.0.1" + +"@typechain/hardhat@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-8.0.0.tgz#60568b7a2d0260cc741fb0830a8caee8eb06ac64" + integrity sha512-XUVbqlMx8tJTOmzZCD/r196CidtNWAnTBZRcYxjLTKgcJMvc/kHQpWBnVMMB5QHxVKpYpCiz8g07FYCpG8rrjA== + dependencies: + fs-extra "^9.1.0" + +"@types/bn.js@^4.11.3": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/bn.js@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + dependencies: + "@types/node" "*" + +"@types/chai@^4.3.1": + version "4.3.6" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.6.tgz#7b489e8baf393d5dd1266fb203ddd4ea941259e6" + integrity sha512-VOVRLM1mBxIRxydiViqPcKn6MIxZytrbMpd6RJLIWKxUNr3zux8no0Oc7kJx0WAPIitgZ0gkrDS+btlqQpubpw== + +"@types/lru-cache@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" + integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== + +"@types/mkdirp@^0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" + integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== + dependencies: + "@types/node" "*" + +"@types/mocha@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" + integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== + +"@types/node@*": + version "20.6.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.0.tgz#9d7daa855d33d4efec8aea88cd66db1c2f0ebe16" + integrity sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg== + +"@types/node@^17.0.34": + version "17.0.45" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190" + integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== + +"@types/pbkdf2@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" + integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== + dependencies: + "@types/node" "*" + +"@types/prettier@^2.1.1": + version "2.7.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" + integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== + +"@types/readable-stream@^2.3.13": + version "2.3.15" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" + integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== + dependencies: + "@types/node" "*" + safe-buffer "~5.1.1" + +"@types/resolve@^0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" + integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + dependencies: + "@types/node" "*" + +"@types/secp256k1@^4.0.1": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== + dependencies: + "@types/node" "*" + +JSONStream@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" + integrity sha512-mn0KSip7N4e0UDPZHnqDsHECo5uGQrixQKnAskOM1BIB8hd7QKbd6il8IPRPudPHOeHiECoCFqhyMaRO9+nWyA== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" + integrity sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA== + dependencies: + buffer "^6.0.3" + catering "^2.1.0" + is-buffer "^2.0.5" + level-supports "^4.0.0" + level-transcoder "^1.0.1" + module-error "^1.0.1" + queue-microtask "^1.2.3" + +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +acorn@^8.4.1: + version "8.10.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + +adm-zip@^0.4.16: + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== + +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-colors@^4.1.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +ansi-escapes@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +antlr4@~4.8.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.8.0.tgz#f938ec171be7fc2855cd3a533e87647185b32b6a" + integrity sha512-en/MxQ4OkPgGJQ3wD/muzj1uDnFSzdFIhc2+c6bHZokWkuBb6RRvFjpWhPxWLbgQvaEzldJZ0GSQpfSAaE3hqg== + +antlr4ts@^0.5.0-alpha.4: + version "0.5.0-alpha.4" + resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a" + integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== + +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-back@^3.0.1, array-back@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + +array-back@^4.0.1, array-back@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" + integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== + +asn1@^0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bcrypt-pbkdf@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + +bigint-crypto-utils@^3.0.23: + version "3.3.0" + resolved "https://registry.yarnpkg.com/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz#72ad00ae91062cf07f2b1def9594006c279c1d77" + integrity sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bl@^1.0.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" + integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + +bl@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + +bn-str-256@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/bn-str-256/-/bn-str-256-1.9.1.tgz#898cebee70a3edc3968f97b4cebbc4771025aa82" + integrity sha512-u3muv3WO5sYv9nUQsPnDGLg731yNt/MOlKPK5pmBVqClcl7tY97tyfKxw8ed44HVrpi+7dkgJgQpbXP47a3GoQ== + dependencies: + decimal.js-light "^2.5.0" + lodash "^4.17.11" + +bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^3.0.2, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +browser-level@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browser-level/-/browser-level-1.0.1.tgz#36e8c3183d0fe1c405239792faaab5f315871011" + integrity sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.1" + module-error "^1.0.2" + run-parallel-limit "^1.1.0" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ== + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== + +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +buildcheck@~0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/buildcheck/-/buildcheck-0.0.6.tgz#89aa6e417cfd1e2196e3f8fe915eb709d2fe4238" + integrity sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A== + +busboy@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +camelcase@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +case@^1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" + integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== + +catering@^2.1.0, catering@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" + integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== + +chai@^4.3.6: + version "4.3.8" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.8.tgz#40c59718ad6928da6629c70496fe990b2bb5b17c" + integrity sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^4.1.2" + get-func-name "^2.0.0" + loupe "^2.3.1" + pathval "^1.1.1" + type-detect "^4.0.5" + +chalk@4.1.2, chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== + +chokidar@3.5.3, chokidar@^3.4.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chownr@^1.0.1, chownr@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +classic-level@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/classic-level/-/classic-level-1.3.0.tgz#5e36680e01dc6b271775c093f2150844c5edd5c8" + integrity sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.0" + module-error "^1.0.1" + napi-macros "^2.2.2" + node-gyp-build "^4.3.0" + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +code-block-writer@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" + integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +command-exists@^1.2.8: + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== + +command-line-args@^5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" + integrity sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg== + dependencies: + array-back "^3.1.0" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + +command-line-usage@^6.1.0: + version "6.1.3" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.3.tgz#428fa5acde6a838779dfa30e44686f4b6761d957" + integrity sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw== + dependencies: + array-back "^4.0.2" + chalk "^2.4.2" + table-layout "^1.0.2" + typical "^5.2.0" + +commander@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" + integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== + +commander@^2.19.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commander@^9.4.1: + version "9.5.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" + integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +concat-stream@~1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +cookie@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + +cpu-features@~0.0.8: + version "0.0.9" + resolved "https://registry.yarnpkg.com/cpu-features/-/cpu-features-0.0.9.tgz#5226b92f0f1c63122b0a3eb84cb8335a4de499fc" + integrity sha512-AKjgn2rP2yJyfbepsmLfiYcmtNn/2eUvocUyM/09yB0YDiz39HteK/5/T4Onf0pmdYDMgkBoGvRLvEguzyL7wQ== + dependencies: + buildcheck "~0.0.6" + nan "^2.17.0" + +crc-32@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" + integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +debug@^3.2.6: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decimal.js-light@^2.5.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934" + integrity sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg== + +deep-eql@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + +deep-extend@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +docker-modem@^1.0.8: + version "1.0.9" + resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-1.0.9.tgz#a1f13e50e6afb6cf3431b2d5e7aac589db6aaba8" + integrity sha512-lVjqCSCIAUDZPAZIeyM125HXfNvOmYYInciphNrLrylUtKyW66meAjSPXWchKVzoIYZx69TPnAepVSSkeawoIw== + dependencies: + JSONStream "1.3.2" + debug "^3.2.6" + readable-stream "~1.0.26-4" + split-ca "^1.0.0" + +docker-modem@^3.0.0: + version "3.0.8" + resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-3.0.8.tgz#ef62c8bdff6e8a7d12f0160988c295ea8705e77a" + integrity sha512-f0ReSURdM3pcKPNS30mxOHSbaFLcknGmQjwSfmbcdOw1XWKXVhukM3NJHhr7NpY9BIyyWQb0EBo3KQvvuU5egQ== + dependencies: + debug "^4.1.1" + readable-stream "^3.5.0" + split-ca "^1.0.1" + ssh2 "^1.11.0" + +dockerode@^2.5.8: + version "2.5.8" + resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-2.5.8.tgz#1b661e36e1e4f860e25f56e0deabe9f87f1d0acc" + integrity sha512-+7iOUYBeDTScmOmQqpUYQaE7F4vvIt6+gIZNHWhqAQEI887tiPFB9OvXI/HzQYqfUNvukMK+9myLW63oTJPZpw== + dependencies: + concat-stream "~1.6.2" + docker-modem "^1.0.8" + tar-fs "~1.16.3" + +dockerode@^3.3.4: + version "3.3.5" + resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.5.tgz#7ae3f40f2bec53ae5e9a741ce655fff459745629" + integrity sha512-/0YNa3ZDNeLr/tSckmD69+Gq+qVNhvKfAHNeZJBnp7EOP6RGKV8ORrJHkUn20So5wU+xxT7+1n5u8PjHbfjbSA== + dependencies: + "@balena/dockerignore" "^1.0.2" + docker-modem "^3.0.0" + tar-fs "~2.0.1" + +elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +enquirer@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" + integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== + dependencies: + ansi-colors "^4.1.1" + strip-ansi "^6.0.1" + +env-paths@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereum-cryptography@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" + integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== + dependencies: + "@noble/hashes" "1.2.0" + "@noble/secp256k1" "1.7.1" + "@scure/bip32" "1.1.5" + "@scure/bip39" "1.1.1" + +ethereumjs-abi@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.3" + +ethers@^5.7.0, ethers@^5.7.1: + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + dependencies: + "@ethersproject/abi" "5.7.0" + "@ethersproject/abstract-provider" "5.7.0" + "@ethersproject/abstract-signer" "5.7.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/base64" "5.7.0" + "@ethersproject/basex" "5.7.0" + "@ethersproject/bignumber" "5.7.0" + "@ethersproject/bytes" "5.7.0" + "@ethersproject/constants" "5.7.0" + "@ethersproject/contracts" "5.7.0" + "@ethersproject/hash" "5.7.0" + "@ethersproject/hdnode" "5.7.0" + "@ethersproject/json-wallets" "5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/logger" "5.7.0" + "@ethersproject/networks" "5.7.1" + "@ethersproject/pbkdf2" "5.7.0" + "@ethersproject/properties" "5.7.0" + "@ethersproject/providers" "5.7.2" + "@ethersproject/random" "5.7.0" + "@ethersproject/rlp" "5.7.0" + "@ethersproject/sha2" "5.7.0" + "@ethersproject/signing-key" "5.7.0" + "@ethersproject/solidity" "5.7.0" + "@ethersproject/strings" "5.7.0" + "@ethersproject/transactions" "5.7.0" + "@ethersproject/units" "5.7.0" + "@ethersproject/wallet" "5.7.0" + "@ethersproject/web" "5.7.1" + "@ethersproject/wordlists" "5.7.0" + +ethjs-util@0.1.6, ethjs-util@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +fast-glob@^3.2.12: + version "3.3.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fastq@^1.6.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + dependencies: + reusify "^1.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== + dependencies: + locate-path "^2.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +follow-redirects@^1.12.1, follow-redirects@^1.14.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +fp-ts@1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== + +fp-ts@^1.0.0: + version "1.19.5" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" + integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== + +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs-extra@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.1.tgz#da69f7c39f3b002378b0954bb6ae7efdc0876e2d" + integrity sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-extra@^7.0.0, fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== + +glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.2, glob@^7.1.3, glob@^7.1.6: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +hardhat@^2.11.0: + version "2.17.3" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.17.3.tgz#4cb15f2afdea5f108970ed72e5b81e6e53052cfb" + integrity sha512-SFZoYVXW1bWJZrIIKXOA+IgcctfuKXDwENywiYNT2dM3YQc4fXNaTbuk/vpPzHIF50upByx4zW5EqczKYQubsA== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-blockchain" "7.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-evm" "2.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-statemanager" "2.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + "@nomicfoundation/ethereumjs-vm" "7.0.2" + "@nomicfoundation/solidity-analyzer" "^0.1.0" + "@sentry/node" "^5.18.1" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + adm-zip "^0.4.16" + aggregate-error "^3.0.0" + ansi-escapes "^4.3.0" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + ethereum-cryptography "^1.0.3" + ethereumjs-abi "^0.6.8" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "7.2.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + keccak "^3.0.2" + lodash "^4.17.11" + mnemonist "^0.38.0" + mocha "^10.0.0" + p-map "^4.0.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + tsort "0.0.1" + undici "^5.14.0" + uuid "^8.3.2" + ws "^7.4.6" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.1.13, ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +immutable@^4.0.0-rc.12: + version "4.3.4" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f" + integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA== + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +io-ts@1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== + dependencies: + fp-ts "^1.0.0" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-buffer@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + +is-core-module@^2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" + integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== + dependencies: + has "^1.0.3" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +js-sdsl@^4.1.4: + version "4.4.2" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.2.tgz#2e3c031b1f47d3aca8b775532e3ebb0818e7f847" + integrity sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w== + +js-sha3@0.8.0, js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== + +keccak@^3.0.0, keccak@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" + integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== + optionalDependencies: + graceful-fs "^4.1.9" + +level-supports@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-4.0.1.tgz#431546f9d81f10ff0fea0e74533a0e875c08c66a" + integrity sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA== + +level-transcoder@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" + integrity sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w== + dependencies: + buffer "^6.0.3" + module-error "^1.0.1" + +level@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/level/-/level-8.0.0.tgz#41b4c515dabe28212a3e881b61c161ffead14394" + integrity sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ== + dependencies: + browser-level "^1.0.1" + classic-level "^1.2.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + +lodash@^4.17.11, lodash@^4.17.15: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +loupe@^2.3.1: + version "2.3.6" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" + integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== + dependencies: + get-func-name "^2.0.0" + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +mcl-wasm@^0.7.1: + version "0.7.9" + resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" + integrity sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +memory-level@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/memory-level/-/memory-level-1.0.0.tgz#7323c3fd368f9af2f71c3cd76ba403a17ac41692" + integrity sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og== + dependencies: + abstract-level "^1.0.0" + functional-red-black-tree "^1.0.1" + module-error "^1.0.1" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== + +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^7.4.3: + version "7.4.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" + integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== + dependencies: + brace-expansion "^2.0.1" + +minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mkdirp-classic@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + +mkdirp@^0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +mkdirp@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" + integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== + +mnemonist@^0.38.0: + version "0.38.5" + resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" + integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== + dependencies: + obliterator "^2.0.0" + +mocha@^10.0.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" + integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== + dependencies: + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + nanoid "3.3.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +module-error@^1.0.1, module-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" + integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +mz@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + +nan@^2.17.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" + integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== + +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== + +napi-macros@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.2.2.tgz#817fef20c3e0e40a963fbf7b37d1600bd0201044" + integrity sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g== + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-fetch@^2.6.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: + version "4.6.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" + integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +obliterator@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" + integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-limit@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" + integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== + dependencies: + yocto-queue "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== + dependencies: + p-limit "^1.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== + +path-browserify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-parse@^1.0.6, path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +pathington@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/pathington/-/pathington-1.1.7.tgz#caf2d2db899a31fea4e81e3657af6acde5171903" + integrity sha512-JxzhUzagDfNIOm4qqwQqP3rWeo7rNNOfIahy4n+3GTEdwXLqw5cJHUR0soSopQtNEv763lzxb6eA2xBllpR8zw== + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +pbkdf2@^3.0.17: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +preprocess@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/preprocess/-/preprocess-3.2.0.tgz#36b3e2c52331fbc6fabb26d4fd5709304b7e3675" + integrity sha512-cO+Rf+Ose/eD+ze8Hxd9p9nS1xT8thYqv8owG/V8+IS/Remd7Z17SvaRK/oJxp08yaM8zb+QTckDKJUul2pk7g== + dependencies: + xregexp "3.1.0" + +prettier-plugin-solidity@^1.0.0-alpha.27: + version "1.1.3" + resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.3.tgz#9a35124f578404caf617634a8cab80862d726cba" + integrity sha512-fQ9yucPi2sBbA2U2Xjh6m4isUTJ7S7QLc/XDDsktqqxYfTwdYKJ0EnnywXHwCGAaYbQNK+HIYPL1OemxuMsgeg== + dependencies: + "@solidity-parser/parser" "^0.16.0" + semver "^7.3.8" + solidity-comments-extractor "^0.0.7" + +prettier@^2.1.2, prettier@^2.3.0, prettier@^2.3.1: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +proper-lockfile@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" + integrity sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA== + dependencies: + graceful-fs "^4.2.4" + retry "^0.12.0" + signal-exit "^3.0.2" + +pump@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" + integrity sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +queue-microtask@^1.2.2, queue-microtask@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +raw-body@^2.4.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5: + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@~1.0.26-4: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +reduce-flatten@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" + integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-from-string@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve@1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@^1.10.0, resolve@^1.8.1: + version "1.22.4" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" + integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^2.2.8: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.2.3: + version "2.2.7" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== + dependencies: + bn.js "^5.2.0" + +run-parallel-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz#be80e936f5768623a38a963262d6bef8ff11e7ba" + integrity sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw== + dependencies: + queue-microtask "^1.2.2" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +rustbn.js@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" + integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scrypt-js@3.0.1, scrypt-js@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +secp256k1@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +semver@^5.5.0, semver@^5.6.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@^6.3.0: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.3.8, semver@^7.5.1: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +solc@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" + integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + follow-redirects "^1.12.1" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +solidity-comments-extractor@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" + integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== + +solpp@^0.11.5: + version "0.11.5" + resolved "https://registry.yarnpkg.com/solpp/-/solpp-0.11.5.tgz#e5f38b5acc952e1cc2e3871d490fdbed910938dd" + integrity sha512-LjzCGMrTDXtera2C4mbQGZSpBznP+o3/82L2CneAAMNbm+t4xPsvfrgJkIaY+IZ5YLrB8IXn7cYthwHMKvAWnQ== + dependencies: + antlr4 "~4.8.0" + axios "^0.21.1" + bn-str-256 "^1.9.1" + commander "^2.19.0" + ethereumjs-util "^6.0.0" + lodash "^4.17.11" + mz "^2.7.0" + resolve "^1.10.0" + semver "^5.6.0" + +source-map-support@^0.5.13: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +split-ca@^1.0.0, split-ca@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/split-ca/-/split-ca-1.0.1.tgz#6c83aff3692fa61256e0cd197e05e9de157691a6" + integrity sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ== + +ssh2@^1.11.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/ssh2/-/ssh2-1.14.0.tgz#8f68440e1b768b66942c9e4e4620b2725b3555bb" + integrity sha512-AqzD1UCqit8tbOKoj6ztDDi1ffJZ2rV2SwlgrVVrHPkV5vWqGJOVp5pmtj18PunkPJAuKQsnInyKV+/Nb2bUnA== + dependencies: + asn1 "^0.2.6" + bcrypt-pbkdf "^1.0.2" + optionalDependencies: + cpu-features "~0.0.8" + nan "^2.17.0" + +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + +string-format@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" + integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== + dependencies: + is-hex-prefixed "1.0.0" + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +table-layout@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" + integrity sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A== + dependencies: + array-back "^4.0.1" + deep-extend "~0.6.0" + typical "^5.2.0" + wordwrapjs "^4.0.0" + +tar-fs@~1.16.3: + version "1.16.3" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" + integrity sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw== + dependencies: + chownr "^1.0.1" + mkdirp "^0.5.1" + pump "^1.0.0" + tar-stream "^1.1.2" + +tar-fs@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.1.tgz#e44086c1c60d31a4f0cf893b1c4e155dabfae9e2" + integrity sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA== + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.0.0" + +tar-stream@^1.1.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" + integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== + dependencies: + bl "^1.0.0" + buffer-alloc "^1.2.0" + end-of-stream "^1.0.0" + fs-constants "^1.0.0" + readable-stream "^2.3.0" + to-buffer "^1.1.1" + xtend "^4.0.0" + +tar-stream@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" + integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== + dependencies: + bl "^4.0.3" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + +template-file@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/template-file/-/template-file-6.0.1.tgz#ce4d1f48e56d637cc94bb97ec205e6e035bbb2a5" + integrity sha512-02hOa1psJUOsahWfx8w3p40CCulA2/InNFFPh5xLq5rUUm2XTzvmtOn/SXV+KZaq7ylG58SYSnT4yW3y/Smn4w== + dependencies: + "@blakek/deep" "^2.2.0" + glob "^7.1.6" + mkdirp "^1.0.4" + p-limit "^4.0.0" + +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + +tmp@0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +to-buffer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" + integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +ts-command-line-args@^2.2.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz#e64456b580d1d4f6d948824c274cf6fa5f45f7f0" + integrity sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw== + dependencies: + chalk "^4.1.0" + command-line-args "^5.1.1" + command-line-usage "^6.1.0" + string-format "^2.0.0" + +ts-essentials@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-1.0.4.tgz#ce3b5dade5f5d97cf69889c11bf7d2da8555b15a" + integrity sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ== + +ts-essentials@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.3.tgz#686fd155a02133eedcc5362dc8b5056cde3e5a38" + integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== + +ts-generator@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ts-generator/-/ts-generator-0.1.1.tgz#af46f2fb88a6db1f9785977e9590e7bcd79220ab" + integrity sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ== + dependencies: + "@types/mkdirp" "^0.5.2" + "@types/prettier" "^2.1.1" + "@types/resolve" "^0.0.8" + chalk "^2.4.1" + glob "^7.1.2" + mkdirp "^0.5.1" + prettier "^2.1.2" + resolve "^1.8.1" + ts-essentials "^1.0.0" + +ts-morph@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-19.0.0.tgz#43e95fb0156c3fe3c77c814ac26b7d0be2f93169" + integrity sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ== + dependencies: + "@ts-morph/common" "~0.20.0" + code-block-writer "^12.0.0" + +ts-node@^10.7.0: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsort@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== + +tweetnacl-util@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== + +tweetnacl@^0.14.3: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + +tweetnacl@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + +typechain@^8.1.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.3.1.tgz#dccbc839b94877997536c356380eff7325395cfb" + integrity sha512-fA7clol2IP/56yq6vkMTR+4URF1nGjV82Wx6Rf09EsqD4tkzMAvEaqYxVFCavJm/1xaRga/oD55K+4FtuXwQOQ== + dependencies: + "@types/prettier" "^2.1.1" + debug "^4.3.1" + fs-extra "^7.0.0" + glob "7.1.7" + js-sha3 "^0.8.0" + lodash "^4.17.15" + mkdirp "^1.0.4" + prettier "^2.3.1" + ts-command-line-args "^2.2.0" + ts-essentials "^7.0.1" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== + +typescript@^4.6.4: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + +typical@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" + integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== + +undici@^5.14.0: + version "5.24.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.24.0.tgz#6133630372894cfeb3c3dab13b4c23866bd344b5" + integrity sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ== + dependencies: + busboy "^1.6.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + +unpipe@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +wordwrapjs@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" + integrity sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA== + dependencies: + reduce-flatten "^2.0.0" + typical "^5.2.0" + +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@7.4.6: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + +ws@^7.4.6: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +xregexp@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-3.1.0.tgz#14d8461e0bdd38224bfee5039a0898fc42fcd336" + integrity sha512-4Y1x6DyB8xRoxosooa6PlGWqmmSKatbzhrftZ7Purmm4B8R4qIEJG1A2hZsdz5DhmIqS0msC0I7KEq93GphEVg== + +xtend@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +yocto-queue@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" + integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== + +zksync-web3@^0.13.0: + version "0.13.4" + resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.13.4.tgz#1c5b1303436cb4cba1a0873ea07860b19f385331" + integrity sha512-AjCKhn9TRqsk2T9VLKxlod22rnVWOWGOjq+QXppFe2yTxZx9dVaai325OJ0aa7a3m5wx+9yhPqBu23jG2xPo5Q== diff --git a/scripts/refresh_contracts.sh b/scripts/refresh_contracts.sh index c5ad2ca0..2b6b49ba 100755 --- a/scripts/refresh_contracts.sh +++ b/scripts/refresh_contracts.sh @@ -6,7 +6,7 @@ DST_DIR=src/deps/contracts/ mkdir -p $DST_DIR -contracts=("AccountCodeStorage" "BootloaderUtilities" "Compressor" "ComplexUpgrader" "Console" "ContractDeployer" "DefaultAccount" "EmptyContract" "ImmutableSimulator" "KnownCodesStorage" "L1Messenger" "L2EthToken" "MsgValueSimulator" "NonceHolder" "SystemContext" ) +contracts=("AccountCodeStorage" "BootloaderUtilities" "Compressor" "ComplexUpgrader" "ContractDeployer" "DefaultAccount" "EmptyContract" "ImmutableSimulator" "KnownCodesStorage" "L1Messenger" "L2EthToken" "MsgValueSimulator" "NonceHolder" "SystemContext" ) for contract in "${contracts[@]}"; do cp $SRC_DIR/$contract.sol/$contract.json $DST_DIR diff --git a/scripts/refresh_test_contracts.sh b/scripts/refresh_test_contracts.sh new file mode 100755 index 00000000..10359f9c --- /dev/null +++ b/scripts/refresh_test_contracts.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -xe + +TEST_CONTRACT_ARTIFACTS="etc/test-contracts/artifacts-zk/cache-zk/solpp-generated-contracts" +TEST_CONTRACT_TARGET="src/deps/test-contracts" + +echo "Building test contracts" +(cd etc/test-contracts && yarn && yarn build) + +echo "Copying test contracts" +mkdir -p $TEST_CONTRACT_TARGET +find $TEST_CONTRACT_ARTIFACTS -name "*.json" ! -iname "*.dbg.json" -exec cp {} $TEST_CONTRACT_TARGET \; + +echo "Done" diff --git a/src/cache.rs b/src/cache.rs index 60eb5ed6..4e9fd2bc 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -7,13 +7,22 @@ use std::path::Path; use std::result::Result; use std::str::FromStr; use zksync_basic_types::H256; -use zksync_types::api::{Block, Transaction, TransactionVariant}; +use zksync_types::api::{Block, BridgeAddresses, Transaction, TransactionVariant}; use zksync_types::Transaction as RawTransaction; +/// Caches full blocks by their hashes const CACHE_TYPE_BLOCKS_FULL: &str = "blocks_full"; +/// Caches minimal blocks by their hashes const CACHE_TYPE_BLOCKS_MIN: &str = "blocks_min"; +/// Caches raw transactions by their hashes const CACHE_TYPE_BLOCK_RAW_TRANSACTIONS: &str = "block_raw_transactions"; +/// Caches transactions by their hashes const CACHE_TYPE_TRANSACTIONS: &str = "transactions"; +/// Caches arbitrary values by their keys +const CACHE_TYPE_KEY_VALUE: &str = "key_value"; + +/// Caching key for bridge addresses +const CACHE_KEY_BRIDGE_ADDRESSES: &str = "bridge_addresses"; /// Cache configuration. Can be one of: /// @@ -40,6 +49,7 @@ pub(crate) struct Cache { blocks_min: FxHashMap>, block_raw_transactions: FxHashMap>, transactions: FxHashMap, + bridge_addresses: Option, } impl Cache { @@ -57,9 +67,10 @@ impl Cache { CACHE_TYPE_BLOCKS_MIN, CACHE_TYPE_BLOCK_RAW_TRANSACTIONS, CACHE_TYPE_TRANSACTIONS, + CACHE_TYPE_KEY_VALUE, ] { fs::remove_dir_all(Path::new(dir).join(cache_type)).unwrap_or_else(|err| { - log::warn!( + tracing::warn!( "failed removing directory {:?}: {:?}", Path::new(dir).join(cache_type), err @@ -67,8 +78,9 @@ impl Cache { }); } - fs::remove_dir(Path::new(dir)) - .unwrap_or_else(|err| log::warn!("failed removing cache directory: {:?}", err)); + fs::remove_dir(Path::new(dir)).unwrap_or_else(|err| { + tracing::warn!("failed removing cache directory: {:?}", err) + }); } for cache_type in [ @@ -76,6 +88,7 @@ impl Cache { CACHE_TYPE_BLOCKS_MIN, CACHE_TYPE_BLOCK_RAW_TRANSACTIONS, CACHE_TYPE_TRANSACTIONS, + CACHE_TYPE_KEY_VALUE, ] { fs::create_dir_all(Path::new(dir).join(cache_type)).unwrap_or_else(|err| { panic!("failed creating directory {}: {:?}", cache_type, err) @@ -83,7 +96,7 @@ impl Cache { } cache .read_all_from_disk(dir) - .unwrap_or_else(|err| log::error!("failed reading cache from disk: {:?}", err)); + .unwrap_or_else(|err| tracing::error!("failed reading cache from disk: {:?}", err)); } cache @@ -186,6 +199,29 @@ impl Cache { self.transactions.insert(hash, transaction); } + /// Returns the cached bridge addresses for the provided hash. + pub(crate) fn get_bridge_addresses(&self) -> Option<&BridgeAddresses> { + if matches!(self.config, CacheConfig::None) { + return None; + } + + self.bridge_addresses.as_ref() + } + + /// Cache default bridge addresses. + pub(crate) fn set_bridge_addresses(&mut self, bridge_addresses: BridgeAddresses) { + if matches!(self.config, CacheConfig::None) { + return; + } + + self.write_to_disk( + CACHE_TYPE_KEY_VALUE, + String::from(CACHE_KEY_BRIDGE_ADDRESSES), + &bridge_addresses, + ); + self.bridge_addresses = Some(bridge_addresses); + } + /// Reads the cache contents from the disk, if available. fn read_all_from_disk(&mut self, dir: &str) -> Result<(), String> { for cache_type in [ @@ -193,6 +229,7 @@ impl Cache { CACHE_TYPE_BLOCKS_MIN, CACHE_TYPE_BLOCK_RAW_TRANSACTIONS, CACHE_TYPE_TRANSACTIONS, + CACHE_TYPE_KEY_VALUE, ] { let cache_dir = Path::new(dir).join(cache_type); let dir_listing = fs::read_dir(cache_dir.clone()) @@ -252,6 +289,18 @@ impl Cache { })?; self.transactions.insert(key, transaction); } + CACHE_TYPE_KEY_VALUE => match key.as_str() { + CACHE_KEY_BRIDGE_ADDRESSES => { + self.bridge_addresses = + Some(serde_json::from_reader(reader).map_err(|err| { + format!( + "failed parsing json for cache file '{:?}': {:?}", + key, err + ) + })?); + } + _ => return Err(format!("invalid cache_type_value key {}", cache_type)), + }, _ => return Err(format!("invalid cache_type {}", cache_type)), } } @@ -265,15 +314,15 @@ impl Cache { if let CacheConfig::Disk { dir, .. } = &self.config { let file = Path::new(&dir).join(cache_type).join(key); - log::debug!("writing cache {:?}", file); + tracing::debug!("writing cache {:?}", file); match File::create(file.clone()) { Ok(cache_file) => { let writer = BufWriter::new(cache_file); if let Err(err) = serde_json::to_writer(writer, data) { - log::error!("failed writing to cache '{:?}': {:?}", file, err); + tracing::error!("failed writing to cache '{:?}': {:?}", file, err); } } - Err(err) => log::error!("failed creating file: '{:?}': {:?}", file, err), + Err(err) => tracing::error!("failed creating file: '{:?}': {:?}", file, err), } } } @@ -282,9 +331,11 @@ impl Cache { #[cfg(test)] mod tests { use tempdir::TempDir; - use zksync_basic_types::U64; + use zksync_basic_types::{H160, U64}; use zksync_types::{Execute, ExecuteTransactionCommon}; + use crate::testing; + use super::*; #[test] @@ -330,6 +381,12 @@ mod tests { received_timestamp_ms: 0, raw_bytes: None, }]; + let bridge_addresses = BridgeAddresses { + l1_erc20_default_bridge: H160::repeat_byte(0x1), + l2_erc20_default_bridge: H160::repeat_byte(0x2), + l1_weth_bridge: Some(H160::repeat_byte(0x3)), + l2_weth_bridge: Some(H160::repeat_byte(0x4)), + }; let mut cache = Cache::new(CacheConfig::Memory); @@ -355,6 +412,12 @@ mod tests { cache.insert_transaction(H256::zero(), transaction.clone()); assert_eq!(Some(&transaction), cache.get_transaction(&H256::zero())); + + cache.set_bridge_addresses(bridge_addresses.clone()); + testing::assert_bridge_addresses_eq( + &bridge_addresses, + cache.get_bridge_addresses().expect("expected addresses"), + ); } #[test] @@ -381,6 +444,12 @@ mod tests { received_timestamp_ms: 0, raw_bytes: None, }]; + let bridge_addresses = BridgeAddresses { + l1_erc20_default_bridge: H160::repeat_byte(0x1), + l2_erc20_default_bridge: H160::repeat_byte(0x2), + l1_weth_bridge: Some(H160::repeat_byte(0x3)), + l2_weth_bridge: Some(H160::repeat_byte(0x4)), + }; let cache_dir = TempDir::new("cache-test").expect("failed creating temporary dir"); let cache_dir_path = cache_dir @@ -416,6 +485,12 @@ mod tests { cache.insert_transaction(H256::zero(), transaction.clone()); assert_eq!(Some(&transaction), cache.get_transaction(&H256::zero())); + cache.set_bridge_addresses(bridge_addresses.clone()); + testing::assert_bridge_addresses_eq( + &bridge_addresses, + cache.get_bridge_addresses().expect("expected addresses"), + ); + let new_cache = Cache::new(CacheConfig::Disk { dir: cache_dir_path, reset: false, @@ -435,6 +510,12 @@ mod tests { new_cache.get_block_raw_transactions(&0) ); assert_eq!(Some(&transaction), new_cache.get_transaction(&H256::zero())); + testing::assert_bridge_addresses_eq( + &bridge_addresses, + new_cache + .get_bridge_addresses() + .expect("expected addresses"), + ); } #[test] @@ -461,6 +542,12 @@ mod tests { received_timestamp_ms: 0, raw_bytes: None, }]; + let bridge_addresses = BridgeAddresses { + l1_erc20_default_bridge: H160::repeat_byte(0x1), + l2_erc20_default_bridge: H160::repeat_byte(0x2), + l1_weth_bridge: Some(H160::repeat_byte(0x3)), + l2_weth_bridge: Some(H160::repeat_byte(0x4)), + }; let cache_dir = TempDir::new("cache-test").expect("failed creating temporary dir"); let cache_dir_path = cache_dir @@ -496,6 +583,12 @@ mod tests { cache.insert_transaction(H256::zero(), transaction.clone()); assert_eq!(Some(&transaction), cache.get_transaction(&H256::zero())); + cache.set_bridge_addresses(bridge_addresses.clone()); + testing::assert_bridge_addresses_eq( + &bridge_addresses, + cache.get_bridge_addresses().expect("expected addresses"), + ); + let new_cache = Cache::new(CacheConfig::Disk { dir: cache_dir_path, reset: true, @@ -506,6 +599,7 @@ mod tests { assert_eq!(None, new_cache.get_block_hash(&2)); assert_eq!(None, new_cache.get_block_raw_transactions(&0)); assert_eq!(None, new_cache.get_transaction(&H256::zero())); + assert!(new_cache.get_bridge_addresses().is_none()); } #[test] diff --git a/src/configuration_api.rs b/src/configuration_api.rs index e5420d7c..868c7b95 100644 --- a/src/configuration_api.rs +++ b/src/configuration_api.rs @@ -4,6 +4,8 @@ use std::sync::{Arc, RwLock}; // External uses use jsonrpc_core::Result; use jsonrpc_derive::rpc; +use zksync_core::api_server::web3::backend_jsonrpc::error::into_jsrpc_error; +use zksync_web3_decl::error::Web3Error; // Workspace uses @@ -13,6 +15,7 @@ use crate::{ node::ShowCalls, node::ShowVMDetails, node::{ShowGasDetails, ShowStorageLogs}, + observability::LogLevel, }; pub struct ConfigurationApiNamespace { @@ -90,6 +93,29 @@ pub trait ConfigurationApiNamespaceT { /// The updated `resolve_hashes` value for the InMemoryNodeInner. #[rpc(name = "config_setResolveHashes", returns = "bool")] fn config_set_resolve_hashes(&self, value: bool) -> Result; + + /// Set the logging for the InMemoryNodeInner + /// + /// # Parameters + /// - `level`: The log level to set. One of: ["trace", "debug", "info", "warn", "error"] + /// + /// # Returns + /// `true` if the operation succeeded, `false` otherwise. + #[rpc(name = "config_setLogLevel", returns = "bool")] + fn config_set_log_level(&self, level: LogLevel) -> Result; + + /// Set the logging for the InMemoryNodeInner + /// + /// # Parameters + /// - `level`: The logging directive to set. Example: + /// * "my_crate=debug" + /// * "my_crate::module=trace" + /// * "my_crate=debug,other_crate=warn" + /// + /// # Returns + /// `true` if the operation succeeded, `false` otherwise. + #[rpc(name = "config_setLogging", returns = "bool")] + fn config_set_logging(&self, directive: String) -> Result; } impl ConfigurationApiNamespaceT @@ -166,4 +192,40 @@ impl ConfigurationApiNamespa inner.resolve_hashes = value; Ok(inner.resolve_hashes) } + + fn config_set_log_level(&self, level: LogLevel) -> Result { + if let Some(observability) = &self + .node + .read() + .map_err(|_| into_jsrpc_error(Web3Error::InternalError))? + .observability + { + match observability.set_log_level(level.clone()) { + Ok(_) => tracing::info!("set log level to '{}'", level), + Err(err) => { + tracing::error!("failed setting log level {:?}", err); + return Ok(false); + } + } + } + Ok(true) + } + + fn config_set_logging(&self, directive: String) -> Result { + if let Some(observability) = &self + .node + .read() + .map_err(|_| into_jsrpc_error(Web3Error::InternalError))? + .observability + { + match observability.set_logging(&directive) { + Ok(_) => tracing::info!("set logging to '{}'", directive), + Err(err) => { + tracing::error!("failed setting logging to '{}': {:?}", directive, err); + return Ok(false); + } + } + } + Ok(true) + } } diff --git a/src/console_log.rs b/src/console_log.rs index d21c9e6d..b6ef9bfc 100644 --- a/src/console_log.rs +++ b/src/console_log.rs @@ -1,9 +1,9 @@ use std::{collections::HashMap, str::FromStr}; use colored::Colorize; -use ethabi::{Contract, Function}; +use ethabi::param_type::Reader; +use ethabi::{Function, Param, StateMutability}; use itertools::Itertools; -use serde_json::Value; use zksync_types::vm_trace::Call; use zksync_types::H160; @@ -11,7 +11,7 @@ use zksync_types::H160; /// This is a popular debugging method used by hardhat and foundry. /// When user wants to log something, these tools are doing a call to a contract at a given (fake) address. /// The ConsoleLogHandler is catching this call, and printing it out -- but only if TRACE level log is enabled for 'console' target. -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct ConsoleLogHandler { /// Map from the 4-byte function signature to function itself. // This contract has many 'log' methods (depending on argument type) - so we have a map here, to be able to parse the arguments. @@ -24,30 +24,21 @@ pub const CONSOLE_ADDRESS: &str = "0x000000000000000000636f6e736f6c652e6c6f67"; impl Default for ConsoleLogHandler { fn default() -> Self { - let mut val: Value = - serde_json::from_slice(include_bytes!("deps/contracts/Console.json")).unwrap(); - - let contract: Contract = serde_json::from_value(val["abi"].take()).unwrap(); - - let mut signature_map: HashMap<[u8; 4], Function> = Default::default(); - - for (_, functions) in contract.functions.iter() { - for func in functions.iter() { - signature_map.insert(func.short_signature(), func.clone()); - } - } Self { - signature_map, + signature_map: get_log_functions() + .into_iter() + .map(|func| (func.short_signature(), func)) + .collect::>(), target_contract: H160::from_str(CONSOLE_ADDRESS).unwrap(), } } } impl ConsoleLogHandler { - pub fn handle_call_recurive(&self, current_call: &Call) { + pub fn handle_call_recursive(&self, current_call: &Call) { self.handle_call(current_call); for call in ¤t_call.calls { - self.handle_call_recurive(call); + self.handle_call_recursive(call); } } pub fn handle_call(&self, current_call: &Call) { @@ -68,6 +59,434 @@ impl ConsoleLogHandler { tokens.iter().map(|t| format!("{}", t)).join(" ") }) }); - log::info!("{}", message.cyan()); + tracing::info!("{}", message.cyan()); + } +} + +/// Returns the well-known log [Function]s. +fn get_log_functions() -> Vec { + LOG_FUNCTIONS + .iter() + .map(|func_decl| { + let (name, params) = func_decl + .trim_end_matches(')') + .split_once('(') + .unwrap_or_else(|| panic!("unable to obtain function name for '{}'", func_decl)); + + #[allow(deprecated)] // for deprecated field `constant` + Function { + name: String::from(name), + inputs: params + .split(',') + .enumerate() + .map(|(index, param)| Param { + name: format!("p{index}"), + kind: Reader::read(param).unwrap_or_else(|err| { + panic!( + "failed deserializing type '{}' for '{}' : {:?}", + param, func_decl, err + ) + }), + internal_type: Some(String::from(param)), + }) + .collect(), + outputs: vec![], + constant: false, + state_mutability: StateMutability::View, + } + }) + .collect() +} + +/// Represents the common log functions. +/// See https://github.com/NomicFoundation/hardhat/blob/main/packages/hardhat-core/console.sol +const LOG_FUNCTIONS: [&str; 378] = [ + "log(int256)", + "log(uint256)", + "log(string)", + "log(bool)", + "log(address)", + "log(bytes)", + "log(bytes1)", + "log(bytes2)", + "log(bytes3)", + "log(bytes4)", + "log(bytes5)", + "log(bytes6)", + "log(bytes7)", + "log(bytes8)", + "log(bytes9)", + "log(bytes10)", + "log(bytes11)", + "log(bytes12)", + "log(bytes13)", + "log(bytes14)", + "log(bytes15)", + "log(bytes16)", + "log(bytes17)", + "log(bytes18)", + "log(bytes19)", + "log(bytes20)", + "log(bytes21)", + "log(bytes22)", + "log(bytes23)", + "log(bytes24)", + "log(bytes25)", + "log(bytes26)", + "log(bytes27)", + "log(bytes28)", + "log(bytes29)", + "log(bytes30)", + "log(bytes31)", + "log(bytes32)", + "log(uint256)", + "log(string)", + "log(bool)", + "log(address)", + "log(uint256,uint256)", + "log(uint256,string)", + "log(uint256,bool)", + "log(uint256,address)", + "log(string,uint256)", + "log(string,string)", + "log(string,bool)", + "log(string,address)", + "log(bool,uint256)", + "log(bool,string)", + "log(bool,bool)", + "log(bool,address)", + "log(address,uint256)", + "log(address,string)", + "log(address,bool)", + "log(address,address)", + "log(uint256,uint256,uint256)", + "log(uint256,uint256,string)", + "log(uint256,uint256,bool)", + "log(uint256,uint256,address)", + "log(uint256,string,uint256)", + "log(uint256,string,string)", + "log(uint256,string,bool)", + "log(uint256,string,address)", + "log(uint256,bool,uint256)", + "log(uint256,bool,string)", + "log(uint256,bool,bool)", + "log(uint256,bool,address)", + "log(uint256,address,uint256)", + "log(uint256,address,string)", + "log(uint256,address,bool)", + "log(uint256,address,address)", + "log(string,uint256,uint256)", + "log(string,uint256,string)", + "log(string,uint256,bool)", + "log(string,uint256,address)", + "log(string,string,uint256)", + "log(string,string,string)", + "log(string,string,bool)", + "log(string,string,address)", + "log(string,bool,uint256)", + "log(string,bool,string)", + "log(string,bool,bool)", + "log(string,bool,address)", + "log(string,address,uint256)", + "log(string,address,string)", + "log(string,address,bool)", + "log(string,address,address)", + "log(bool,uint256,uint256)", + "log(bool,uint256,string)", + "log(bool,uint256,bool)", + "log(bool,uint256,address)", + "log(bool,string,uint256)", + "log(bool,string,string)", + "log(bool,string,bool)", + "log(bool,string,address)", + "log(bool,bool,uint256)", + "log(bool,bool,string)", + "log(bool,bool,bool)", + "log(bool,bool,address)", + "log(bool,address,uint256)", + "log(bool,address,string)", + "log(bool,address,bool)", + "log(bool,address,address)", + "log(address,uint256,uint256)", + "log(address,uint256,string)", + "log(address,uint256,bool)", + "log(address,uint256,address)", + "log(address,string,uint256)", + "log(address,string,string)", + "log(address,string,bool)", + "log(address,string,address)", + "log(address,bool,uint256)", + "log(address,bool,string)", + "log(address,bool,bool)", + "log(address,bool,address)", + "log(address,address,uint256)", + "log(address,address,string)", + "log(address,address,bool)", + "log(address,address,address)", + "log(uint256,uint256,uint256,uint256)", + "log(uint256,uint256,uint256,string)", + "log(uint256,uint256,uint256,bool)", + "log(uint256,uint256,uint256,address)", + "log(uint256,uint256,string,uint256)", + "log(uint256,uint256,string,string)", + "log(uint256,uint256,string,bool)", + "log(uint256,uint256,string,address)", + "log(uint256,uint256,bool,uint256)", + "log(uint256,uint256,bool,string)", + "log(uint256,uint256,bool,bool)", + "log(uint256,uint256,bool,address)", + "log(uint256,uint256,address,uint256)", + "log(uint256,uint256,address,string)", + "log(uint256,uint256,address,bool)", + "log(uint256,uint256,address,address)", + "log(uint256,string,uint256,uint256)", + "log(uint256,string,uint256,string)", + "log(uint256,string,uint256,bool)", + "log(uint256,string,uint256,address)", + "log(uint256,string,string,uint256)", + "log(uint256,string,string,string)", + "log(uint256,string,string,bool)", + "log(uint256,string,string,address)", + "log(uint256,string,bool,uint256)", + "log(uint256,string,bool,string)", + "log(uint256,string,bool,bool)", + "log(uint256,string,bool,address)", + "log(uint256,string,address,uint256)", + "log(uint256,string,address,string)", + "log(uint256,string,address,bool)", + "log(uint256,string,address,address)", + "log(uint256,bool,uint256,uint256)", + "log(uint256,bool,uint256,string)", + "log(uint256,bool,uint256,bool)", + "log(uint256,bool,uint256,address)", + "log(uint256,bool,string,uint256)", + "log(uint256,bool,string,string)", + "log(uint256,bool,string,bool)", + "log(uint256,bool,string,address)", + "log(uint256,bool,bool,uint256)", + "log(uint256,bool,bool,string)", + "log(uint256,bool,bool,bool)", + "log(uint256,bool,bool,address)", + "log(uint256,bool,address,uint256)", + "log(uint256,bool,address,string)", + "log(uint256,bool,address,bool)", + "log(uint256,bool,address,address)", + "log(uint256,address,uint256,uint256)", + "log(uint256,address,uint256,string)", + "log(uint256,address,uint256,bool)", + "log(uint256,address,uint256,address)", + "log(uint256,address,string,uint256)", + "log(uint256,address,string,string)", + "log(uint256,address,string,bool)", + "log(uint256,address,string,address)", + "log(uint256,address,bool,uint256)", + "log(uint256,address,bool,string)", + "log(uint256,address,bool,bool)", + "log(uint256,address,bool,address)", + "log(uint256,address,address,uint256)", + "log(uint256,address,address,string)", + "log(uint256,address,address,bool)", + "log(uint256,address,address,address)", + "log(string,uint256,uint256,uint256)", + "log(string,uint256,uint256,string)", + "log(string,uint256,uint256,bool)", + "log(string,uint256,uint256,address)", + "log(string,uint256,string,uint256)", + "log(string,uint256,string,string)", + "log(string,uint256,string,bool)", + "log(string,uint256,string,address)", + "log(string,uint256,bool,uint256)", + "log(string,uint256,bool,string)", + "log(string,uint256,bool,bool)", + "log(string,uint256,bool,address)", + "log(string,uint256,address,uint256)", + "log(string,uint256,address,string)", + "log(string,uint256,address,bool)", + "log(string,uint256,address,address)", + "log(string,string,uint256,uint256)", + "log(string,string,uint256,string)", + "log(string,string,uint256,bool)", + "log(string,string,uint256,address)", + "log(string,string,string,uint256)", + "log(string,string,string,string)", + "log(string,string,string,bool)", + "log(string,string,string,address)", + "log(string,string,bool,uint256)", + "log(string,string,bool,string)", + "log(string,string,bool,bool)", + "log(string,string,bool,address)", + "log(string,string,address,uint256)", + "log(string,string,address,string)", + "log(string,string,address,bool)", + "log(string,string,address,address)", + "log(string,bool,uint256,uint256)", + "log(string,bool,uint256,string)", + "log(string,bool,uint256,bool)", + "log(string,bool,uint256,address)", + "log(string,bool,string,uint256)", + "log(string,bool,string,string)", + "log(string,bool,string,bool)", + "log(string,bool,string,address)", + "log(string,bool,bool,uint256)", + "log(string,bool,bool,string)", + "log(string,bool,bool,bool)", + "log(string,bool,bool,address)", + "log(string,bool,address,uint256)", + "log(string,bool,address,string)", + "log(string,bool,address,bool)", + "log(string,bool,address,address)", + "log(string,address,uint256,uint256)", + "log(string,address,uint256,string)", + "log(string,address,uint256,bool)", + "log(string,address,uint256,address)", + "log(string,address,string,uint256)", + "log(string,address,string,string)", + "log(string,address,string,bool)", + "log(string,address,string,address)", + "log(string,address,bool,uint256)", + "log(string,address,bool,string)", + "log(string,address,bool,bool)", + "log(string,address,bool,address)", + "log(string,address,address,uint256)", + "log(string,address,address,string)", + "log(string,address,address,bool)", + "log(string,address,address,address)", + "log(bool,uint256,uint256,uint256)", + "log(bool,uint256,uint256,string)", + "log(bool,uint256,uint256,bool)", + "log(bool,uint256,uint256,address)", + "log(bool,uint256,string,uint256)", + "log(bool,uint256,string,string)", + "log(bool,uint256,string,bool)", + "log(bool,uint256,string,address)", + "log(bool,uint256,bool,uint256)", + "log(bool,uint256,bool,string)", + "log(bool,uint256,bool,bool)", + "log(bool,uint256,bool,address)", + "log(bool,uint256,address,uint256)", + "log(bool,uint256,address,string)", + "log(bool,uint256,address,bool)", + "log(bool,uint256,address,address)", + "log(bool,string,uint256,uint256)", + "log(bool,string,uint256,string)", + "log(bool,string,uint256,bool)", + "log(bool,string,uint256,address)", + "log(bool,string,string,uint256)", + "log(bool,string,string,string)", + "log(bool,string,string,bool)", + "log(bool,string,string,address)", + "log(bool,string,bool,uint256)", + "log(bool,string,bool,string)", + "log(bool,string,bool,bool)", + "log(bool,string,bool,address)", + "log(bool,string,address,uint256)", + "log(bool,string,address,string)", + "log(bool,string,address,bool)", + "log(bool,string,address,address)", + "log(bool,bool,uint256,uint256)", + "log(bool,bool,uint256,string)", + "log(bool,bool,uint256,bool)", + "log(bool,bool,uint256,address)", + "log(bool,bool,string,uint256)", + "log(bool,bool,string,string)", + "log(bool,bool,string,bool)", + "log(bool,bool,string,address)", + "log(bool,bool,bool,uint256)", + "log(bool,bool,bool,string)", + "log(bool,bool,bool,bool)", + "log(bool,bool,bool,address)", + "log(bool,bool,address,uint256)", + "log(bool,bool,address,string)", + "log(bool,bool,address,bool)", + "log(bool,bool,address,address)", + "log(bool,address,uint256,uint256)", + "log(bool,address,uint256,string)", + "log(bool,address,uint256,bool)", + "log(bool,address,uint256,address)", + "log(bool,address,string,uint256)", + "log(bool,address,string,string)", + "log(bool,address,string,bool)", + "log(bool,address,string,address)", + "log(bool,address,bool,uint256)", + "log(bool,address,bool,string)", + "log(bool,address,bool,bool)", + "log(bool,address,bool,address)", + "log(bool,address,address,uint256)", + "log(bool,address,address,string)", + "log(bool,address,address,bool)", + "log(bool,address,address,address)", + "log(address,uint256,uint256,uint256)", + "log(address,uint256,uint256,string)", + "log(address,uint256,uint256,bool)", + "log(address,uint256,uint256,address)", + "log(address,uint256,string,uint256)", + "log(address,uint256,string,string)", + "log(address,uint256,string,bool)", + "log(address,uint256,string,address)", + "log(address,uint256,bool,uint256)", + "log(address,uint256,bool,string)", + "log(address,uint256,bool,bool)", + "log(address,uint256,bool,address)", + "log(address,uint256,address,uint256)", + "log(address,uint256,address,string)", + "log(address,uint256,address,bool)", + "log(address,uint256,address,address)", + "log(address,string,uint256,uint256)", + "log(address,string,uint256,string)", + "log(address,string,uint256,bool)", + "log(address,string,uint256,address)", + "log(address,string,string,uint256)", + "log(address,string,string,string)", + "log(address,string,string,bool)", + "log(address,string,string,address)", + "log(address,string,bool,uint256)", + "log(address,string,bool,string)", + "log(address,string,bool,bool)", + "log(address,string,bool,address)", + "log(address,string,address,uint256)", + "log(address,string,address,string)", + "log(address,string,address,bool)", + "log(address,string,address,address)", + "log(address,bool,uint256,uint256)", + "log(address,bool,uint256,string)", + "log(address,bool,uint256,bool)", + "log(address,bool,uint256,address)", + "log(address,bool,string,uint256)", + "log(address,bool,string,string)", + "log(address,bool,string,bool)", + "log(address,bool,string,address)", + "log(address,bool,bool,uint256)", + "log(address,bool,bool,string)", + "log(address,bool,bool,bool)", + "log(address,bool,bool,address)", + "log(address,bool,address,uint256)", + "log(address,bool,address,string)", + "log(address,bool,address,bool)", + "log(address,bool,address,address)", + "log(address,address,uint256,uint256)", + "log(address,address,uint256,string)", + "log(address,address,uint256,bool)", + "log(address,address,uint256,address)", + "log(address,address,string,uint256)", + "log(address,address,string,string)", + "log(address,address,string,bool)", + "log(address,address,string,address)", + "log(address,address,bool,uint256)", + "log(address,address,bool,string)", + "log(address,address,bool,bool)", + "log(address,address,bool,address)", + "log(address,address,address,uint256)", + "log(address,address,address,string)", + "log(address,address,address,bool)", + "log(address,address,address,address)", +]; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_get_log_functions_compiles() { + assert_eq!(378, get_log_functions().len()); } } diff --git a/src/debug.rs b/src/debug.rs new file mode 100644 index 00000000..1eb162a1 --- /dev/null +++ b/src/debug.rs @@ -0,0 +1,576 @@ +use crate::{ + fork::ForkSource, + node::{InMemoryNodeInner, MAX_TX_SIZE}, + utils::{create_debug_output, to_real_block_number}, +}; +use itertools::Itertools; +use jsonrpc_core::{BoxFuture, Result}; +use once_cell::sync::OnceCell; +use std::sync::{Arc, RwLock}; +use vm::{constants::ETH_CALL_GAS_LIMIT, CallTracer, HistoryDisabled, TxExecutionMode, Vm}; +use zksync_basic_types::H256; +use zksync_core::api_server::web3::backend_jsonrpc::{ + error::into_jsrpc_error, namespaces::debug::DebugNamespaceT, +}; +use zksync_state::StorageView; +use zksync_types::{ + api::{BlockId, BlockNumber, DebugCall, ResultDebugCall, TracerConfig, TransactionVariant}, + l2::L2Tx, + transaction_request::CallRequest, + PackedEthSignature, Transaction, U64, +}; +use zksync_web3_decl::error::Web3Error; + +/// Implementation of DebugNamespaceImpl +pub struct DebugNamespaceImpl { + node: Arc>>, +} + +impl DebugNamespaceImpl { + /// Creates a new `Debug` instance with the given `node`. + pub fn new(node: Arc>>) -> Self { + Self { node } + } +} + +impl DebugNamespaceT + for DebugNamespaceImpl +{ + fn trace_block_by_number( + &self, + block: BlockNumber, + options: Option, + ) -> BoxFuture>> { + let only_top = options.is_some_and(|o| o.tracer_config.only_top_call); + let inner = Arc::clone(&self.node); + Box::pin(async move { + let inner = inner + .read() + .map_err(|_| into_jsrpc_error(Web3Error::InternalError))?; + + let block = { + let number = + to_real_block_number(block, U64::from(inner.current_miniblock)).as_u64(); + + inner + .block_hashes + .get(&number) + .and_then(|hash| inner.blocks.get(hash)) + .ok_or_else(|| { + into_jsrpc_error(Web3Error::SubmitTransactionError( + "Block not found".to_string(), + vec![], + )) + })? + }; + + let tx_hashes = block + .transactions + .iter() + .map(|tx| match tx { + TransactionVariant::Full(tx) => tx.hash, + TransactionVariant::Hash(hash) => *hash, + }) + .collect_vec(); + + let debug_calls = tx_hashes + .into_iter() + .map(|tx_hash| { + let tx = inner.tx_results.get(&tx_hash).ok_or_else(|| { + into_jsrpc_error(Web3Error::SubmitTransactionError( + "Transaction not found".to_string(), + vec![], + )) + })?; + Ok(tx.debug_info(only_top)) + }) + .collect::>>()? + .into_iter() + .map(|result| ResultDebugCall { result }) + .collect_vec(); + + Ok(debug_calls) + }) + } + + fn trace_block_by_hash( + &self, + hash: H256, + options: Option, + ) -> BoxFuture>> { + let only_top = options.is_some_and(|o| o.tracer_config.only_top_call); + let inner = Arc::clone(&self.node); + Box::pin(async move { + let inner = inner + .read() + .map_err(|_| into_jsrpc_error(Web3Error::InternalError))?; + + let block = inner.blocks.get(&hash).ok_or_else(|| { + into_jsrpc_error(Web3Error::SubmitTransactionError( + "Block not found".to_string(), + vec![], + )) + })?; + + let tx_hashes = block + .transactions + .iter() + .map(|tx| match tx { + TransactionVariant::Full(tx) => tx.hash, + TransactionVariant::Hash(hash) => *hash, + }) + .collect_vec(); + + let debug_calls = tx_hashes + .into_iter() + .map(|tx_hash| { + let tx = inner.tx_results.get(&tx_hash).ok_or_else(|| { + into_jsrpc_error(Web3Error::SubmitTransactionError( + "Transaction not found".to_string(), + vec![], + )) + })?; + Ok(tx.debug_info(only_top)) + }) + .collect::>>()? + .into_iter() + .map(|result| ResultDebugCall { result }) + .collect_vec(); + + Ok(debug_calls) + }) + } + + /// Trace execution of a transaction. + fn trace_call( + &self, + request: CallRequest, + block: Option, + options: Option, + ) -> BoxFuture> { + let only_top = options.is_some_and(|o| o.tracer_config.only_top_call); + let inner = Arc::clone(&self.node); + Box::pin(async move { + if block.is_some() && !matches!(block, Some(BlockId::Number(BlockNumber::Latest))) { + return Err(jsonrpc_core::Error::invalid_params( + "tracing only supported at `latest` block", + )); + } + + let inner = inner + .read() + .map_err(|_| into_jsrpc_error(Web3Error::InternalError))?; + + let mut l2_tx = match L2Tx::from_request(request.into(), MAX_TX_SIZE) { + Ok(tx) => tx, + Err(e) => { + let error = Web3Error::SerializationError(e); + return Err(into_jsrpc_error(error)); + } + }; + + let execution_mode = TxExecutionMode::EthCall; + let storage = StorageView::new(&inner.fork_storage).to_rc_ptr(); + + let bootloader_code = inner.system_contracts.contracts_for_l2_call(); + + // init vm + let (mut l1_batch_env, _block_context) = inner.create_l1_batch_env(storage.clone()); + + // update the enforced_base_fee within l1_batch_env to match the logic in zksync_core + l1_batch_env.enforced_base_fee = Some(l2_tx.common_data.fee.max_fee_per_gas.as_u64()); + let system_env = inner.create_system_env(bootloader_code.clone(), execution_mode); + let mut vm = Vm::new(l1_batch_env, system_env, storage, HistoryDisabled); + + // We must inject *some* signature (otherwise bootloader code fails to generate hash). + if l2_tx.common_data.signature.is_empty() { + l2_tx.common_data.signature = + PackedEthSignature::default().serialize_packed().into(); + } + + // Match behavior of zksync_core: + // Protection against infinite-loop eth_calls and alike: + // limiting the amount of gas the call can use. + l2_tx.common_data.fee.gas_limit = ETH_CALL_GAS_LIMIT.into(); + + let tx: Transaction = l2_tx.clone().into(); + vm.push_transaction(tx); + + let call_tracer_result = Arc::new(OnceCell::default()); + let tracer = CallTracer::new(call_tracer_result.clone(), HistoryDisabled); + let tx_result = vm.inspect(vec![Box::new(tracer)], vm::VmExecutionMode::OneTx); + + let call_traces = if only_top { + vec![] + } else { + Arc::try_unwrap(call_tracer_result) + .unwrap() + .take() + .unwrap_or_default() + }; + + let debug = + create_debug_output(&l2_tx, &tx_result, call_traces).map_err(into_jsrpc_error)?; + + Ok(debug) + }) + } + + fn trace_transaction( + &self, + tx_hash: H256, + options: Option, + ) -> BoxFuture>> { + let only_top = options.is_some_and(|o| o.tracer_config.only_top_call); + let inner = Arc::clone(&self.node); + Box::pin(async move { + let inner = inner + .read() + .map_err(|_| into_jsrpc_error(Web3Error::InternalError))?; + + Ok(inner + .tx_results + .get(&tx_hash) + .map(|tx| tx.debug_info(only_top))) + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{ + deps::system_contracts::bytecode_from_slice, + http_fork_source::HttpForkSource, + node::{InMemoryNode, TransactionResult}, + testing::{self, LogBuilder}, + }; + use ethers::abi::{short_signature, AbiEncode, HumanReadableParser, ParamType, Token}; + use zksync_basic_types::{Address, Nonce, H160, U256}; + use zksync_types::{ + api::{Block, CallTracerConfig, SupportedTracers, TransactionReceipt}, + transaction_request::CallRequestBuilder, + utils::deployed_address_create, + }; + + fn deploy_test_contracts(node: &InMemoryNode) -> (Address, Address) { + let private_key = H256::repeat_byte(0xee); + let from_account = zksync_types::PackedEthSignature::address_from_private_key(&private_key) + .expect("failed generating address"); + node.set_rich_account(from_account); + + // first, deploy secondary contract + let secondary_bytecode = bytecode_from_slice( + "Secondary", + include_bytes!("deps/test-contracts/Secondary.json"), + ); + let secondary_deployed_address = deployed_address_create(from_account, U256::zero()); + testing::deploy_contract( + &node, + H256::repeat_byte(0x1), + private_key, + secondary_bytecode, + Some((U256::from(2),).encode()), + Nonce(0), + ); + + // deploy primary contract using the secondary contract address as a constructor parameter + let primary_bytecode = bytecode_from_slice( + "Primary", + include_bytes!("deps/test-contracts/Primary.json"), + ); + let primary_deployed_address = deployed_address_create(from_account, U256::one()); + testing::deploy_contract( + &node, + H256::repeat_byte(0x1), + private_key, + primary_bytecode, + Some((secondary_deployed_address).encode()), + Nonce(1), + ); + (primary_deployed_address, secondary_deployed_address) + } + + #[tokio::test] + async fn test_trace_deployed_contract() { + let node = InMemoryNode::::default(); + let debug = DebugNamespaceImpl::new(node.get_inner()); + + let (primary_deployed_address, secondary_deployed_address) = deploy_test_contracts(&node); + + // trace a call to the primary contract + let func = HumanReadableParser::parse_function("calculate(uint)").unwrap(); + let calldata = func.encode_input(&[Token::Uint(U256::from(42))]).unwrap(); + let request = CallRequestBuilder::default() + .to(primary_deployed_address) + .data(calldata.clone().into()) + .gas(80_000_000.into()) + .build(); + let trace = debug + .trace_call(request.clone(), None, None) + .await + .expect("trace call"); + + // call should not revert + assert!(trace.error.is_none()); + assert!(trace.revert_reason.is_none()); + + // check that the call was successful + let output = + ethers::abi::decode(&[ParamType::Uint(256)], &trace.output.0.as_slice()).unwrap(); + assert_eq!(output[0], Token::Uint(U256::from(84))); + + // find the call to primary contract in the trace + let contract_call = trace + .calls + .first() + .unwrap() + .calls + .last() + .unwrap() + .calls + .first() + .unwrap(); + + assert_eq!(contract_call.to, primary_deployed_address); + assert_eq!(contract_call.input, calldata.into()); + + // check that it contains a call to secondary contract + let subcall = contract_call.calls.first().unwrap(); + assert_eq!(subcall.to, secondary_deployed_address); + assert_eq!(subcall.from, primary_deployed_address); + assert_eq!(subcall.output, U256::from(84).encode().into()); + } + + #[tokio::test] + async fn test_trace_only_top() { + let node = InMemoryNode::::default(); + let debug = DebugNamespaceImpl::new(node.get_inner()); + + let (primary_deployed_address, _) = deploy_test_contracts(&node); + + // trace a call to the primary contract + let func = HumanReadableParser::parse_function("calculate(uint)").unwrap(); + let calldata = func.encode_input(&[Token::Uint(U256::from(42))]).unwrap(); + let request = CallRequestBuilder::default() + .to(primary_deployed_address) + .data(calldata.into()) + .gas(80_000_000.into()) + .build(); + + // if we trace with onlyTopCall=true, we should get only the top-level call + let trace = debug + .trace_call( + request, + None, + Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }), + ) + .await + .expect("trace call"); + // call should not revert + assert!(trace.error.is_none()); + assert!(trace.revert_reason.is_none()); + + // call should not contain any subcalls + assert!(trace.calls.is_empty()); + } + + #[tokio::test] + async fn test_trace_reverts() { + let node = InMemoryNode::::default(); + let debug = DebugNamespaceImpl::new(node.get_inner()); + + let (primary_deployed_address, _) = deploy_test_contracts(&node); + + // trace a call to the primary contract + let request = CallRequestBuilder::default() + .to(primary_deployed_address) + .data(short_signature("shouldRevert()", &[]).into()) + .gas(80_000_000.into()) + .build(); + let trace = debug + .trace_call(request, None, None) + .await + .expect("trace call"); + + // call should revert + assert!(trace.revert_reason.is_some()); + + // find the call to primary contract in the trace + let contract_call = trace + .calls + .first() + .unwrap() + .calls + .last() + .unwrap() + .calls + .first() + .unwrap(); + + // the contract subcall should have reverted + assert!(contract_call.revert_reason.is_some()); + } + + #[tokio::test] + async fn test_trace_transaction() { + let node = InMemoryNode::::default(); + let inner = node.get_inner(); + { + let mut writer = inner.write().unwrap(); + writer.tx_results.insert( + H256::repeat_byte(0x1), + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: TransactionReceipt { + logs: vec![LogBuilder::new() + .set_address(H160::repeat_byte(0xa1)) + .build()], + ..Default::default() + }, + debug: testing::default_tx_debug_info(), + }, + ); + } + let result = DebugNamespaceImpl::new(inner) + .trace_transaction(H256::repeat_byte(0x1), None) + .await + .unwrap() + .unwrap(); + assert_eq!(result.calls.len(), 1); + } + + #[tokio::test] + async fn test_trace_transaction_only_top() { + let node = InMemoryNode::::default(); + let inner = node.get_inner(); + { + let mut writer = inner.write().unwrap(); + writer.tx_results.insert( + H256::repeat_byte(0x1), + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: TransactionReceipt { + logs: vec![LogBuilder::new() + .set_address(H160::repeat_byte(0xa1)) + .build()], + ..Default::default() + }, + debug: testing::default_tx_debug_info(), + }, + ); + } + let result = DebugNamespaceImpl::new(inner) + .trace_transaction( + H256::repeat_byte(0x1), + Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }), + ) + .await + .unwrap() + .unwrap(); + assert!(result.calls.is_empty()); + } + + #[tokio::test] + async fn test_trace_transaction_not_found() { + let node = InMemoryNode::::default(); + let inner = node.get_inner(); + let result = DebugNamespaceImpl::new(inner) + .trace_transaction(H256::repeat_byte(0x1), None) + .await + .unwrap(); + assert!(result.is_none()); + } + + #[tokio::test] + async fn test_trace_block_by_hash_empty() { + let node = InMemoryNode::::default(); + let inner = node.get_inner(); + { + let mut writer = inner.write().unwrap(); + let block = Block::::default(); + writer.blocks.insert(H256::repeat_byte(0x1), block); + } + let result = DebugNamespaceImpl::new(inner) + .trace_block_by_hash(H256::repeat_byte(0x1), None) + .await + .unwrap(); + assert_eq!(result.len(), 0); + } + + #[tokio::test] + async fn test_trace_block_by_hash() { + let node = InMemoryNode::::default(); + let inner = node.get_inner(); + { + let mut writer = inner.write().unwrap(); + let tx = zksync_types::api::Transaction::default(); + let tx_hash = tx.hash; + let mut block = Block::::default(); + block.transactions.push(TransactionVariant::Full(tx)); + writer.blocks.insert(H256::repeat_byte(0x1), block); + writer.tx_results.insert( + tx_hash, + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: TransactionReceipt::default(), + debug: testing::default_tx_debug_info(), + }, + ); + } + let result = DebugNamespaceImpl::new(inner) + .trace_block_by_hash(H256::repeat_byte(0x1), None) + .await + .unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result[0].result.calls.len(), 1); + } + + #[tokio::test] + async fn test_trace_block_by_number() { + let node = InMemoryNode::::default(); + let inner = node.get_inner(); + { + let mut writer = inner.write().unwrap(); + let tx = zksync_types::api::Transaction::default(); + let tx_hash = tx.hash; + let mut block = Block::::default(); + block.transactions.push(TransactionVariant::Full(tx)); + writer.blocks.insert(H256::repeat_byte(0x1), block); + writer.block_hashes.insert(0, H256::repeat_byte(0x1)); + writer.tx_results.insert( + tx_hash, + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: TransactionReceipt::default(), + debug: testing::default_tx_debug_info(), + }, + ); + } + // check `latest` alias + let result = DebugNamespaceImpl::new(node.get_inner()) + .trace_block_by_number(BlockNumber::Latest, None) + .await + .unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result[0].result.calls.len(), 1); + + // check block number + let result = DebugNamespaceImpl::new(node.get_inner()) + .trace_block_by_number(BlockNumber::Number(0.into()), None) + .await + .unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result[0].result.calls.len(), 1); + } +} diff --git a/src/deps/contracts/Console.json b/src/deps/contracts/Console.json deleted file mode 100644 index ae60f5db..00000000 --- a/src/deps/contracts/Console.json +++ /dev/null @@ -1,489 +0,0 @@ -{ - "_format": "hh-zksolc-artifact-1", - "contractName": "Console", - "sourceName": "cache-zk/solpp-generated-contracts/Console.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "p0", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "p1", - "type": "bool" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "p0", - "type": "bool" - }, - { - "internalType": "bool", - "name": "p1", - "type": "bool" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "p0", - "type": "address" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "p0", - "type": "string" - }, - { - "internalType": "address", - "name": "p1", - "type": "address" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "p0", - "type": "bool" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "p0", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "p1", - "type": "uint256" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "p0", - "type": "string" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "p0", - "type": "string" - }, - { - "internalType": "string", - "name": "p1", - "type": "string" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "p0", - "type": "uint256" - }, - { - "internalType": "string", - "name": "p1", - "type": "string" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "p0", - "type": "uint256" - }, - { - "internalType": "address", - "name": "p1", - "type": "address" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "p0", - "type": "address" - }, - { - "internalType": "string", - "name": "p1", - "type": "string" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "p0", - "type": "address" - }, - { - "internalType": "bool", - "name": "p1", - "type": "bool" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "p0", - "type": "address" - }, - { - "internalType": "uint256", - "name": "p1", - "type": "uint256" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "p0", - "type": "bool" - }, - { - "internalType": "address", - "name": "p1", - "type": "address" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "p0", - "type": "bool" - }, - { - "internalType": "string", - "name": "p1", - "type": "string" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "p0", - "type": "string" - }, - { - "internalType": "uint256", - "name": "p1", - "type": "uint256" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "p0", - "type": "string" - }, - { - "internalType": "bool", - "name": "p1", - "type": "bool" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "p0", - "type": "address" - }, - { - "internalType": "address", - "name": "p1", - "type": "address" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "p0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "p1", - "type": "uint256" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "p0", - "type": "uint256" - } - ], - "name": "log", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "p0", - "type": "address" - } - ], - "name": "logAddress", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "p0", - "type": "bool" - } - ], - "name": "logBool", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "p0", - "type": "bytes" - } - ], - "name": "logBytes", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes1", - "name": "p0", - "type": "bytes1" - } - ], - "name": "logBytes1", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes2", - "name": "p0", - "type": "bytes2" - } - ], - "name": "logBytes2", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes3", - "name": "p0", - "type": "bytes3" - } - ], - "name": "logBytes3", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "p0", - "type": "bytes4" - } - ], - "name": "logBytes4", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "p0", - "type": "int256" - } - ], - "name": "logInt", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "p0", - "type": "string" - } - ], - "name": "logString", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "p0", - "type": "uint256" - } - ], - "name": "logUint", - "outputs": [], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x0002000000000002000400000000000200010000000103550000006001100270000001b50010019d0000008001000039000000400010043f0000000101200190000000480000c13d0000000003000031000000040130008c000005520000413d0000000101000367000000000201043b000000e002200270000001b70420009c000000500000a13d000001b80420009c000000d40000213d000001c40420009c000001150000213d000001ca0420009c000001d50000213d000001cd0420009c0000032d0000613d000001ce0220009c000005520000c13d000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000400000001001d000001ea0110009c000005520000213d06cf06a10000040f000000000101004b0000000003000019000000010300c039000000400100043d000200000001001d000000440210003900000000003204350000002002100039000300000002001d000001f60300004100000000003204350000002403100039000000040200002900000000002304350000004402000039000000000021043506cf05f00000040f00000002010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e0000000001000416000000000101004b000005520000c13d000000200100003900000100001004430000012000000443000001b601000041000006d00001042e000001cf0420009c000000dd0000a13d000001d00420009c000001540000213d000001d60420009c000001fd0000213d000001d90420009c000003630000613d000001da0220009c000005520000c13d000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000202043b000001e80420009c000005520000213d0000002304200039000001e405000041000000000634004b00000000060000190000000006058019000001e407300197000001e404400197000000000874004b0000000005008019000000000474013f000001e40440009c00000000040600190000000004056019000000000404004b000005520000c13d0000000404200039000000000141034f000000000101043b000001e80410009c0000010f0000213d000000bf04100039000000200500008a000000000554016f000001e80450009c0000010f0000213d0000002404200039000000400050043f000000800010043f0000000002410019000000000232004b000005520000213d0000001f0210018f00000001034003670000000504100272000000970000613d00000000050000190000000506500210000000000763034f000000000707043b000000a00660003900000000007604350000000105500039000000000645004b0000008f0000413d000000000502004b000000a60000613d0000000504400210000000000343034f0000000302200210000000a004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f0000000000240435000000a001100039000000000001043500000024010000390000000101100367000000000101043b000001e80210009c000005520000213d0000000002000031000000040110003906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d000001ff020000410000000000230435000000240240003900000040030000390000000000320435000200000001001d0000006402400039000000800100003906cf06b70000040f000000000201001900000004030000290000000001320049000000240110008a00000044033000390000000000130435000000020100002906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001b90420009c000001790000213d000001bf0420009c000002210000213d000001c20420009c000003910000613d000001c30120009c000002e80000613d000005520000013d000001db0420009c000001a20000a13d000001dc0420009c0000024a0000213d000001df0420009c000003c40000613d000001e00220009c000005520000c13d000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000202043b000001e80420009c000005520000213d0000002304200039000001e405000041000000000634004b00000000060000190000000006058019000001e407300197000001e404400197000000000874004b0000000005008019000000000474013f000001e40440009c00000000040600190000000004056019000000000404004b000005520000c13d0000000404200039000000000141034f000000000101043b000002030410009c0000010f0000813d000000bf04100039000000200500008a000000000554016f000001e80450009c000005710000a13d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d100010430000001c50420009c000002790000213d000001c80420009c000003e40000613d000001c90220009c000005520000c13d000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000402043b000000000204004b0000000002000019000000010200c039000400000004001d000000000224004b000005520000c13d0000002401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000300000004001d0000004402400039000000400300003900000000003204350000002003400039000200000003001d000001f1020000410000000000230435000000240240003900000004030000290000000000320435000000640240003906cf06b70000040f00000003030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000003010000290000000003010433000000000100041400000002020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001d10420009c0000029e0000213d000001d40420009c0000040c0000613d000001d50120009c000005520000c13d000000040130008a000001e402000041000000200310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d000001fb01000041000000a00010043f00000004010000390000000101100367000000000101043b000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001ba0420009c000002c30000213d000001bd0420009c0000043f0000613d000001be0120009c000005520000c13d000000040130008a000001e402000041000000400310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d000001e701000041000000a00010043f00000004010000390000000101100367000000000101043b000000a40010043f00000024010000390000000101100367000000000101043b000000c40010043f0000004401000039000000800010043f0000010001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001e10420009c000005410000613d000001e20120009c0000047e0000613d000001e30120009c000005520000c13d000000040130008a000001e402000041000000400310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d06cf06ac0000040f000300000001001d06cf06a10000040f000000000101004b0000000003000019000000010300c039000000400100043d000200000001001d000000440210003900000000003204350000002002100039000400000002001d000002070300004100000000003204350000000302000029000000000202004b0000000003000019000000010300c039000000240210003900000000003204350000004402000039000000000021043506cf05f00000040f00000002010000290000000003010433000000000100041400000004020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001cb0420009c000004a90000613d000001cc0220009c000005520000c13d000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001ea0210009c000005520000213d000001f302000041000000a00020043f000000a40010043f00000024010000390000000101100367000000000101043b000000c40010043f0000004401000039000000800010043f0000010001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001d70420009c000004ca0000613d000001d80220009c000005520000c13d000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001ea0210009c000005520000213d000001fd02000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001c00420009c000004e50000613d000001c10220009c000005520000c13d000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000402100370000000000202043b000001ea0320009c000005520000213d0000002401100370000000000101043b000001ea0310009c000005520000213d000001eb03000041000000a00030043f000000a40020043f000000c40010043f0000004401000039000000800010043f0000010001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001dd0120009c000002e80000613d000001de0120009c000005520000c13d000000040130008a000001e402000041000000400310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d06cf06ac0000040f000000400400043d000300000004001d0000002003400039000400000003001d00000201020000410000000000230435000000000101004b0000000001000019000000010100c0390000002402400039000000000012043500000024010000390000000101100367000000000101043b0000004402400039000000000012043500000044010000390000000000140435000000000104001906cf05f00000040f00000003010000290000000003010433000000000100041400000004020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001c60420009c0000030e0000613d000001c70220009c000005520000c13d000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001ee02100197000000000221004b000005520000c13d000001ef02000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001d20420009c0000051d0000613d000001d30220009c000005520000c13d000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001f802100197000000000221004b000005520000c13d000001f902000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001bb0420009c0000030e0000613d000001bc0220009c000005520000c13d000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001e502100197000000000221004b000005520000c13d000001e602000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040130008a000001e402000041000000200310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d06cf06ac0000040f000000400400043d000300000004001d0000002003400039000400000003001d00000202020000410000000000230435000000000101004b0000000001000019000000010100c0390000002402400039000000000012043500000024010000390000000000140435000000000104001906cf05fb0000040f00000003010000290000000003010433000000000100041400000004020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040130008a000001e402000041000000200310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d000001f001000041000000a00010043f00000004010000390000000101100367000000000101043b000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000202043b000400000002001d000001ea0220009c000005520000213d0000002401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000300000004001d0000004402400039000000400300003900000000003204350000002003400039000200000003001d000001f7020000410000000000230435000000240240003900000004030000290000000000320435000000640240003906cf06b70000040f00000003030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000003010000290000000003010433000000000100041400000002020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000200520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d00000200020000410000000000230435000000240240003900000020030000390000000000320435000000440240003906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d000001ed020000410000000000230435000000240240003900000040030000390000000000320435000000640240003906cf06b70000040f00000024020000390000000102200367000000000202043b0000000404000029000000440340003900000000002304350000000002410049000000200120008a0000000000140435000000000104001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001ea0210009c000005520000213d000001fd02000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000402100370000000000202043b000000000302004b0000000003000019000000010300c039000000000332004b000005520000c13d0000002401100370000000000101043b000001ea0310009c000005520000213d000001f203000041000000a00030043f000000a40020043f000000c40010043f0000004401000039000000800010043f000000800100003906cf05f00000040f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000002401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d000001fc02000041000000000023043500000004020000390000000102200367000000000202043b00000024034000390000000000230435000000440240003900000040030000390000000000320435000000640240003906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000200520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000402043b000001e80240009c000005520000213d0000002302400039000001e405000041000000000632004b00000000060000190000000006058019000001e407300197000001e402200197000000000872004b0000000005008019000000000272013f000001e40220009c00000000020600190000000002056019000000000202004b000005520000c13d0000000402400039000000000121034f000000000201043b000000240140003906cf06190000040f000001e902000041000000400400043d000400000004001d0000002003400039000300000003001d0000000000230435000000200200003900000024034000390000000000230435000000440240003906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040130008a000001e402000041000000400310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d06cf06a10000040f000000400400043d000300000004001d0000002003400039000400000003001d0000020802000041000000000023043500000004020000390000000102200367000000000202043b00000024034000390000000000230435000000000101004b0000000001000019000000010100c0390000004402400039000000000012043500000044010000390000000000140435000000000104001906cf05f00000040f00000003010000290000000003010433000000000100041400000004020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001f402100197000000000221004b000005520000c13d000001f502000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040130008a000001e402000041000000000301004b00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d000001fe01000041000000a00010043f0000000401000039000000800010043f000000c001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000200000001001d06cf06a10000040f000001ec02000041000000400400043d000400000004001d0000002003400039000300000003001d0000000000230435000000400200003900000024034000390000000000230435000100000001001d0000006402400039000000020100002906cf06b70000040f0000000102000029000000000202004b0000000002000019000000010200c0390000000404000029000000440340003900000000002304350000000002410049000000200120008a0000000000140435000000000104001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000002401100370000000000101043b000001ea0210009c000005520000213d000001fa02000041000000a00020043f00000004020000390000000102200367000000000202043b000000a40020043f000000c40010043f0000004401000039000000800010043f0000010001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000200520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000401100370000000000101043b000001e80210009c000005540000a13d0000000001000019000006d1000104300000000401100039000000000203001906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d00000200020000410000000000230435000000240240003900000020030000390000000000320435000000440240003906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e0000002404200039000000400050043f000000800010043f0000000002410019000000000232004b000005520000213d0000001f0210018f00000001034003670000000504100272000005840000613d00000000050000190000000506500210000000000763034f000000000707043b000000a00660003900000000007604350000000105500039000000000645004b0000057c0000413d000000000502004b000005930000613d0000000504400210000000000343034f0000000302200210000000a004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f0000000000240435000000a001100039000000000001043500000024010000390000000101100367000000000101043b000400000001001d000001ea0110009c000005520000213d000000400300043d000300000003001d0000002002300039000200000002001d000002040100004100000000001204350000002401300039000000400200003900000000002104350000006402300039000000800100003906cf06b70000040f00000003030000290000004402300039000000040400002900000000004204350000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000003010000290000000003010433000000000100041400000002020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e0002000000000002000200000005001d000100000004001d000001b504000041000001b50520009c00000000020480190000004002200210000001b50530009c00000000030480190000006003300210000000000223019f000001b50310009c0000000001048019000000c001100210000000000112019f000002090200004106cf06ca0000040f000000010800002900000000030100190000006003300270000001b5033001970000000205000029000000000453004b000000000405001900000000040340190000001f0340018f0000000504400272000005de0000613d000000000500001900000005065002100000000007680019000000000661034f000000000606043b00000000006704350000000105500039000000000645004b000005d60000413d000000010220018f000000000503004b000005ee0000613d0000000504400210000000000141034f00000000044800190000000303300210000000000504043300000000053501cf000000000535022f000000000101043b0000010003300089000000000131022f00000000013101cf000000000151019f00000000001404350000000001020019000000000001042d0000020a0210009c000005f50000813d0000008001100039000000400010043f000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000020b0210009c000006000000813d0000006001100039000000400010043f000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000001f02200039000000200300008a000000000232016f0000000001120019000000000221004b00000000020000190000000102004039000001e80310009c000006130000213d0000000102200190000006130000c13d000000400010043f000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000000004010019000002030120009c0000064c0000813d0000003f01200039000000200500008a000000000551016f000000400100043d0000000005510019000000000615004b00000000060000190000000106004039000001e80750009c0000064c0000213d00000001066001900000064c0000c13d000000400050043f00000000052104360000000006420019000000000336004b000006520000213d0000001f0320018f000000010440036700000005062002720000063a0000613d000000000700001900000005087002100000000009850019000000000884034f000000000808043b00000000008904350000000107700039000000000867004b000006320000413d000000000703004b000006490000613d0000000506600210000000000464034f00000000066500190000000303300210000000000706043300000000073701cf000000000737022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000373019f000000000036043500000000022500190000000000020435000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000000001000019000006d10001043000000000030100190000001f01300039000001e404000041000000000521004b00000000050000190000000005044019000001e406200197000001e401100197000000000761004b000000000400a019000000000161013f000001e40110009c00000000010500190000000001046019000000000101004b0000069f0000613d0000000101300367000000000401043b000002030140009c000006990000813d0000003f01400039000000200500008a000000000551016f000000400100043d0000000005510019000000000615004b00000000060000190000000106004039000001e80750009c000006990000213d0000000106600190000006990000c13d0000002006300039000000400050043f00000000034104360000000005640019000000000225004b0000069f0000213d0000001f0240018f00000001056003670000000506400272000006870000613d000000000700001900000005087002100000000009830019000000000885034f000000000808043b00000000008904350000000107700039000000000867004b0000067f0000413d000000000702004b000006960000613d0000000506600210000000000565034f00000000066300190000000302200210000000000706043300000000072701cf000000000727022f000000000505043b0000010002200089000000000525022f00000000022501cf000000000272019f000000000026043500000000024300190000000000020435000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000000001000019000006d10001043000000024010000390000000101100367000000000101043b000000000201004b0000000002000019000000010200c039000000000221004b000006aa0000c13d000000000001042d0000000001000019000006d10001043000000004010000390000000101100367000000000101043b000000000201004b0000000002000019000000010200c039000000000221004b000006b50000c13d000000000001042d0000000001000019000006d10001043000000000030104330000000002320436000000000403004b000006c30000613d000000000400001900000000054200190000002004400039000000000614001900000000060604330000000000650435000000000534004b000006bc0000413d000000000132001900000000000104350000001f01300039000000200300008a000000000131016f0000000001120019000000000001042d000006cd002104230000000102000039000000000001042d0000000002000019000000000001042d000006cf00000432000006d00001042e000006d1000104300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000759f86ba00000000000000000000000000000000000000000000000000000000b60e72cb00000000000000000000000000000000000000000000000000000000e17bf95500000000000000000000000000000000000000000000000000000000f82c50f000000000000000000000000000000000000000000000000000000000f82c50f100000000000000000000000000000000000000000000000000000000fba3ad3900000000000000000000000000000000000000000000000000000000e17bf95600000000000000000000000000000000000000000000000000000000f666715a00000000000000000000000000000000000000000000000000000000c3b5563400000000000000000000000000000000000000000000000000000000c3b5563500000000000000000000000000000000000000000000000000000000daf0d4aa00000000000000000000000000000000000000000000000000000000b60e72cc00000000000000000000000000000000000000000000000000000000ba7ab84e00000000000000000000000000000000000000000000000000000000853c4848000000000000000000000000000000000000000000000000000000009905b743000000000000000000000000000000000000000000000000000000009905b744000000000000000000000000000000000000000000000000000000009b5e943e00000000000000000000000000000000000000000000000000000000853c4849000000000000000000000000000000000000000000000000000000008feac525000000000000000000000000000000000000000000000000000000007782fa2c000000000000000000000000000000000000000000000000000000007782fa2d000000000000000000000000000000000000000000000000000000008309e8a800000000000000000000000000000000000000000000000000000000759f86bb0000000000000000000000000000000000000000000000000000000075b605d30000000000000000000000000000000000000000000000000000000041304fab00000000000000000000000000000000000000000000000000000000643fd0de0000000000000000000000000000000000000000000000000000000069276c850000000000000000000000000000000000000000000000000000000069276c86000000000000000000000000000000000000000000000000000000006f4171c900000000000000000000000000000000000000000000000000000000643fd0df000000000000000000000000000000000000000000000000000000006525b5f50000000000000000000000000000000000000000000000000000000051973ec80000000000000000000000000000000000000000000000000000000051973ec9000000000000000000000000000000000000000000000000000000005f91b0af0000000000000000000000000000000000000000000000000000000041304fac000000000000000000000000000000000000000000000000000000004b5c4277000000000000000000000000000000000000000000000000000000002c2ecbc10000000000000000000000000000000000000000000000000000000032458eec0000000000000000000000000000000000000000000000000000000032458eed00000000000000000000000000000000000000000000000000000000399174d3000000000000000000000000000000000000000000000000000000002c2ecbc200000000000000000000000000000000000000000000000000000000319af333000000000000000000000000000000000000000000000000000000000bb563d6000000000000000000000000000000000000000000000000000000001c9d7eb3000000000000000000000000000000000000000000000000000000002a110e838000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000000e05f48d100000000000000000000000000000000000000000000000000000000f666715a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff0be77f5600000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffdaf0d4aa00000000000000000000000000000000000000000000000000000000c3b5563500000000000000000000000000000000000000000000000000000000b60e72cc00000000000000000000000000000000000000000000000000000000ffff000000000000000000000000000000000000000000000000000000000000e9b6229600000000000000000000000000000000000000000000000000000000f82c50f1000000000000000000000000000000000000000000000000000000008feac52500000000000000000000000000000000000000000000000000000000853c4849000000000000000000000000000000000000000000000000000000008309e8a800000000000000000000000000000000000000000000000000000000ffffff00000000000000000000000000000000000000000000000000000000002d8349260000000000000000000000000000000000000000000000000000000075b605d300000000000000000000000000000000000000000000000000000000759f86bb00000000000000000000000000000000000000000000000000000000ff000000000000000000000000000000000000000000000000000000000000006e18a1280000000000000000000000000000000000000000000000000000000069276c86000000000000000000000000000000000000000000000000000000002d5b6cb900000000000000000000000000000000000000000000000000000000643fd0df000000000000000000000000000000000000000000000000000000002c2ecbc20000000000000000000000000000000000000000000000000000000051973ec9000000000000000000000000000000000000000000000000000000004b5c42770000000000000000000000000000000000000000000000000000000041304fac00000000000000000000000000000000000000000000000000000000399174d30000000000000000000000000000000000000000000000000000000032458eed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000319af333000000000000000000000000000000000000000000000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000002a110e83000000000000000000000000000000000000000000000000000000001c9d7eb300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000636f6e736f6c652e6c6f67000000000000000000000000000000000000000000000000ffffffffffffff80000000000000000000000000000000000000000000000000ffffffffffffffa08ebdb7905936fe93daa3dc04f3ca7f4165ab23816d5f313f5889aef03b99c32c", - "deployedBytecode": "0x0002000000000002000400000000000200010000000103550000006001100270000001b50010019d0000008001000039000000400010043f0000000101200190000000480000c13d0000000003000031000000040130008c000005520000413d0000000101000367000000000201043b000000e002200270000001b70420009c000000500000a13d000001b80420009c000000d40000213d000001c40420009c000001150000213d000001ca0420009c000001d50000213d000001cd0420009c0000032d0000613d000001ce0220009c000005520000c13d000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000400000001001d000001ea0110009c000005520000213d06cf06a10000040f000000000101004b0000000003000019000000010300c039000000400100043d000200000001001d000000440210003900000000003204350000002002100039000300000002001d000001f60300004100000000003204350000002403100039000000040200002900000000002304350000004402000039000000000021043506cf05f00000040f00000002010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e0000000001000416000000000101004b000005520000c13d000000200100003900000100001004430000012000000443000001b601000041000006d00001042e000001cf0420009c000000dd0000a13d000001d00420009c000001540000213d000001d60420009c000001fd0000213d000001d90420009c000003630000613d000001da0220009c000005520000c13d000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000202043b000001e80420009c000005520000213d0000002304200039000001e405000041000000000634004b00000000060000190000000006058019000001e407300197000001e404400197000000000874004b0000000005008019000000000474013f000001e40440009c00000000040600190000000004056019000000000404004b000005520000c13d0000000404200039000000000141034f000000000101043b000001e80410009c0000010f0000213d000000bf04100039000000200500008a000000000554016f000001e80450009c0000010f0000213d0000002404200039000000400050043f000000800010043f0000000002410019000000000232004b000005520000213d0000001f0210018f00000001034003670000000504100272000000970000613d00000000050000190000000506500210000000000763034f000000000707043b000000a00660003900000000007604350000000105500039000000000645004b0000008f0000413d000000000502004b000000a60000613d0000000504400210000000000343034f0000000302200210000000a004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f0000000000240435000000a001100039000000000001043500000024010000390000000101100367000000000101043b000001e80210009c000005520000213d0000000002000031000000040110003906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d000001ff020000410000000000230435000000240240003900000040030000390000000000320435000200000001001d0000006402400039000000800100003906cf06b70000040f000000000201001900000004030000290000000001320049000000240110008a00000044033000390000000000130435000000020100002906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001b90420009c000001790000213d000001bf0420009c000002210000213d000001c20420009c000003910000613d000001c30120009c000002e80000613d000005520000013d000001db0420009c000001a20000a13d000001dc0420009c0000024a0000213d000001df0420009c000003c40000613d000001e00220009c000005520000c13d000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000202043b000001e80420009c000005520000213d0000002304200039000001e405000041000000000634004b00000000060000190000000006058019000001e407300197000001e404400197000000000874004b0000000005008019000000000474013f000001e40440009c00000000040600190000000004056019000000000404004b000005520000c13d0000000404200039000000000141034f000000000101043b000002030410009c0000010f0000813d000000bf04100039000000200500008a000000000554016f000001e80450009c000005710000a13d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d100010430000001c50420009c000002790000213d000001c80420009c000003e40000613d000001c90220009c000005520000c13d000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000402043b000000000204004b0000000002000019000000010200c039000400000004001d000000000224004b000005520000c13d0000002401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000300000004001d0000004402400039000000400300003900000000003204350000002003400039000200000003001d000001f1020000410000000000230435000000240240003900000004030000290000000000320435000000640240003906cf06b70000040f00000003030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000003010000290000000003010433000000000100041400000002020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001d10420009c0000029e0000213d000001d40420009c0000040c0000613d000001d50120009c000005520000c13d000000040130008a000001e402000041000000200310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d000001fb01000041000000a00010043f00000004010000390000000101100367000000000101043b000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001ba0420009c000002c30000213d000001bd0420009c0000043f0000613d000001be0120009c000005520000c13d000000040130008a000001e402000041000000400310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d000001e701000041000000a00010043f00000004010000390000000101100367000000000101043b000000a40010043f00000024010000390000000101100367000000000101043b000000c40010043f0000004401000039000000800010043f0000010001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001e10420009c000005410000613d000001e20120009c0000047e0000613d000001e30120009c000005520000c13d000000040130008a000001e402000041000000400310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d06cf06ac0000040f000300000001001d06cf06a10000040f000000000101004b0000000003000019000000010300c039000000400100043d000200000001001d000000440210003900000000003204350000002002100039000400000002001d000002070300004100000000003204350000000302000029000000000202004b0000000003000019000000010300c039000000240210003900000000003204350000004402000039000000000021043506cf05f00000040f00000002010000290000000003010433000000000100041400000004020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001cb0420009c000004a90000613d000001cc0220009c000005520000c13d000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001ea0210009c000005520000213d000001f302000041000000a00020043f000000a40010043f00000024010000390000000101100367000000000101043b000000c40010043f0000004401000039000000800010043f0000010001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001d70420009c000004ca0000613d000001d80220009c000005520000c13d000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001ea0210009c000005520000213d000001fd02000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001c00420009c000004e50000613d000001c10220009c000005520000c13d000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000402100370000000000202043b000001ea0320009c000005520000213d0000002401100370000000000101043b000001ea0310009c000005520000213d000001eb03000041000000a00030043f000000a40020043f000000c40010043f0000004401000039000000800010043f0000010001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001dd0120009c000002e80000613d000001de0120009c000005520000c13d000000040130008a000001e402000041000000400310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d06cf06ac0000040f000000400400043d000300000004001d0000002003400039000400000003001d00000201020000410000000000230435000000000101004b0000000001000019000000010100c0390000002402400039000000000012043500000024010000390000000101100367000000000101043b0000004402400039000000000012043500000044010000390000000000140435000000000104001906cf05f00000040f00000003010000290000000003010433000000000100041400000004020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001c60420009c0000030e0000613d000001c70220009c000005520000c13d000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001ee02100197000000000221004b000005520000c13d000001ef02000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001d20420009c0000051d0000613d000001d30220009c000005520000c13d000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001f802100197000000000221004b000005520000c13d000001f902000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000001bb0420009c0000030e0000613d000001bc0220009c000005520000c13d000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001e502100197000000000221004b000005520000c13d000001e602000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040130008a000001e402000041000000200310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d06cf06ac0000040f000000400400043d000300000004001d0000002003400039000400000003001d00000202020000410000000000230435000000000101004b0000000001000019000000010100c0390000002402400039000000000012043500000024010000390000000000140435000000000104001906cf05fb0000040f00000003010000290000000003010433000000000100041400000004020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040130008a000001e402000041000000200310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d000001f001000041000000a00010043f00000004010000390000000101100367000000000101043b000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000202043b000400000002001d000001ea0220009c000005520000213d0000002401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000300000004001d0000004402400039000000400300003900000000003204350000002003400039000200000003001d000001f7020000410000000000230435000000240240003900000004030000290000000000320435000000640240003906cf06b70000040f00000003030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000003010000290000000003010433000000000100041400000002020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000200520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d00000200020000410000000000230435000000240240003900000020030000390000000000320435000000440240003906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d000001ed020000410000000000230435000000240240003900000040030000390000000000320435000000640240003906cf06b70000040f00000024020000390000000102200367000000000202043b0000000404000029000000440340003900000000002304350000000002410049000000200120008a0000000000140435000000000104001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001ea0210009c000005520000213d000001fd02000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000402100370000000000202043b000000000302004b0000000003000019000000010300c039000000000332004b000005520000c13d0000002401100370000000000101043b000001ea0310009c000005520000213d000001f203000041000000a00030043f000000a40020043f000000c40010043f0000004401000039000000800010043f000000800100003906cf05f00000040f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000002401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d000001fc02000041000000000023043500000004020000390000000102200367000000000202043b00000024034000390000000000230435000000440240003900000040030000390000000000320435000000640240003906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000200520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000402100370000000000402043b000001e80240009c000005520000213d0000002302400039000001e405000041000000000632004b00000000060000190000000006058019000001e407300197000001e402200197000000000872004b0000000005008019000000000272013f000001e40220009c00000000020600190000000002056019000000000202004b000005520000c13d0000000402400039000000000121034f000000000201043b000000240140003906cf06190000040f000001e902000041000000400400043d000400000004001d0000002003400039000300000003001d0000000000230435000000200200003900000024034000390000000000230435000000440240003906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040130008a000001e402000041000000400310008c00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d06cf06a10000040f000000400400043d000300000004001d0000002003400039000400000003001d0000020802000041000000000023043500000004020000390000000102200367000000000202043b00000024034000390000000000230435000000000101004b0000000001000019000000010100c0390000004402400039000000000012043500000044010000390000000000140435000000000104001906cf05f00000040f00000003010000290000000003010433000000000100041400000004020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e403000041000000200420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000000401100370000000000101043b000001f402100197000000000221004b000005520000c13d000001f502000041000000a00020043f000000a40010043f0000002401000039000000800010043f000000e001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040130008a000001e402000041000000000301004b00000000030000190000000003024019000001e401100197000000000401004b000000000200a019000001e40110009c00000000010300190000000001026019000000000101004b000005520000c13d000001fe01000041000000a00010043f0000000401000039000000800010043f000000c001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000400520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000401100370000000000101043b000001e80210009c000005520000213d0000000401100039000000000203001906cf06540000040f000200000001001d06cf06a10000040f000001ec02000041000000400400043d000400000004001d0000002003400039000300000003001d0000000000230435000000400200003900000024034000390000000000230435000100000001001d0000006402400039000000020100002906cf06b70000040f0000000102000029000000000202004b0000000002000019000000010200c0390000000404000029000000440340003900000000002304350000000002410049000000200120008a0000000000140435000000000104001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e403000041000000400420008c00000000040000190000000004034019000001e402200197000000000502004b000000000300a019000001e40220009c00000000020400190000000002036019000000000202004b000005520000c13d0000002401100370000000000101043b000001ea0210009c000005520000213d000001fa02000041000000a00020043f00000004020000390000000102200367000000000202043b000000a40020043f000000c40010043f0000004401000039000000800010043f0000010001000039000000400010043f000000800300043d0000000001000414000000a0020000390000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e000000040230008a000001e404000041000000200520008c00000000050000190000000005044019000001e402200197000000000602004b000000000400a019000001e40220009c00000000020500190000000002046019000000000202004b000005520000c13d0000000401100370000000000101043b000001e80210009c000005540000a13d0000000001000019000006d1000104300000000401100039000000000203001906cf06540000040f000000400400043d000400000004001d0000002003400039000300000003001d00000200020000410000000000230435000000240240003900000020030000390000000000320435000000440240003906cf06b70000040f00000004030000290000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000004010000290000000003010433000000000100041400000003020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e0000002404200039000000400050043f000000800010043f0000000002410019000000000232004b000005520000213d0000001f0210018f00000001034003670000000504100272000005840000613d00000000050000190000000506500210000000000763034f000000000707043b000000a00660003900000000007604350000000105500039000000000645004b0000057c0000413d000000000502004b000005930000613d0000000504400210000000000343034f0000000302200210000000a004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f0000000000240435000000a001100039000000000001043500000024010000390000000101100367000000000101043b000400000001001d000001ea0110009c000005520000213d000000400300043d000300000003001d0000002002300039000200000002001d000002040100004100000000001204350000002401300039000000400200003900000000002104350000006402300039000000800100003906cf06b70000040f00000003030000290000004402300039000000040400002900000000004204350000000002310049000000200120008a0000000000130435000000000103001906cf06060000040f00000003010000290000000003010433000000000100041400000002020000290000000004000019000000000500001906cf05b90000040f0000000001000019000006d00001042e0002000000000002000200000005001d000100000004001d000001b504000041000001b50520009c00000000020480190000004002200210000001b50530009c00000000030480190000006003300210000000000223019f000001b50310009c0000000001048019000000c001100210000000000112019f000002090200004106cf06ca0000040f000000010800002900000000030100190000006003300270000001b5033001970000000205000029000000000453004b000000000405001900000000040340190000001f0340018f0000000504400272000005de0000613d000000000500001900000005065002100000000007680019000000000661034f000000000606043b00000000006704350000000105500039000000000645004b000005d60000413d000000010220018f000000000503004b000005ee0000613d0000000504400210000000000141034f00000000044800190000000303300210000000000504043300000000053501cf000000000535022f000000000101043b0000010003300089000000000131022f00000000013101cf000000000151019f00000000001404350000000001020019000000000001042d0000020a0210009c000005f50000813d0000008001100039000000400010043f000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000020b0210009c000006000000813d0000006001100039000000400010043f000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000001f02200039000000200300008a000000000232016f0000000001120019000000000221004b00000000020000190000000102004039000001e80310009c000006130000213d0000000102200190000006130000c13d000000400010043f000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000000004010019000002030120009c0000064c0000813d0000003f01200039000000200500008a000000000551016f000000400100043d0000000005510019000000000615004b00000000060000190000000106004039000001e80750009c0000064c0000213d00000001066001900000064c0000c13d000000400050043f00000000052104360000000006420019000000000336004b000006520000213d0000001f0320018f000000010440036700000005062002720000063a0000613d000000000700001900000005087002100000000009850019000000000884034f000000000808043b00000000008904350000000107700039000000000867004b000006320000413d000000000703004b000006490000613d0000000506600210000000000464034f00000000066500190000000303300210000000000706043300000000073701cf000000000737022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000373019f000000000036043500000000022500190000000000020435000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000000001000019000006d10001043000000000030100190000001f01300039000001e404000041000000000521004b00000000050000190000000005044019000001e406200197000001e401100197000000000761004b000000000400a019000000000161013f000001e40110009c00000000010500190000000001046019000000000101004b0000069f0000613d0000000101300367000000000401043b000002030140009c000006990000813d0000003f01400039000000200500008a000000000551016f000000400100043d0000000005510019000000000615004b00000000060000190000000106004039000001e80750009c000006990000213d0000000106600190000006990000c13d0000002006300039000000400050043f00000000034104360000000005640019000000000225004b0000069f0000213d0000001f0240018f00000001056003670000000506400272000006870000613d000000000700001900000005087002100000000009830019000000000885034f000000000808043b00000000008904350000000107700039000000000867004b0000067f0000413d000000000702004b000006960000613d0000000506600210000000000565034f00000000066300190000000302200210000000000706043300000000072701cf000000000727022f000000000505043b0000010002200089000000000525022f00000000022501cf000000000272019f000000000026043500000000024300190000000000020435000000000001042d000002050100004100000000001004350000004101000039000000040010043f0000020601000041000006d1000104300000000001000019000006d10001043000000024010000390000000101100367000000000101043b000000000201004b0000000002000019000000010200c039000000000221004b000006aa0000c13d000000000001042d0000000001000019000006d10001043000000004010000390000000101100367000000000101043b000000000201004b0000000002000019000000010200c039000000000221004b000006b50000c13d000000000001042d0000000001000019000006d10001043000000000030104330000000002320436000000000403004b000006c30000613d000000000400001900000000054200190000002004400039000000000614001900000000060604330000000000650435000000000534004b000006bc0000413d000000000132001900000000000104350000001f01300039000000200300008a000000000131016f0000000001120019000000000001042d000006cd002104230000000102000039000000000001042d0000000002000019000000000001042d000006cf00000432000006d00001042e000006d1000104300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000759f86ba00000000000000000000000000000000000000000000000000000000b60e72cb00000000000000000000000000000000000000000000000000000000e17bf95500000000000000000000000000000000000000000000000000000000f82c50f000000000000000000000000000000000000000000000000000000000f82c50f100000000000000000000000000000000000000000000000000000000fba3ad3900000000000000000000000000000000000000000000000000000000e17bf95600000000000000000000000000000000000000000000000000000000f666715a00000000000000000000000000000000000000000000000000000000c3b5563400000000000000000000000000000000000000000000000000000000c3b5563500000000000000000000000000000000000000000000000000000000daf0d4aa00000000000000000000000000000000000000000000000000000000b60e72cc00000000000000000000000000000000000000000000000000000000ba7ab84e00000000000000000000000000000000000000000000000000000000853c4848000000000000000000000000000000000000000000000000000000009905b743000000000000000000000000000000000000000000000000000000009905b744000000000000000000000000000000000000000000000000000000009b5e943e00000000000000000000000000000000000000000000000000000000853c4849000000000000000000000000000000000000000000000000000000008feac525000000000000000000000000000000000000000000000000000000007782fa2c000000000000000000000000000000000000000000000000000000007782fa2d000000000000000000000000000000000000000000000000000000008309e8a800000000000000000000000000000000000000000000000000000000759f86bb0000000000000000000000000000000000000000000000000000000075b605d30000000000000000000000000000000000000000000000000000000041304fab00000000000000000000000000000000000000000000000000000000643fd0de0000000000000000000000000000000000000000000000000000000069276c850000000000000000000000000000000000000000000000000000000069276c86000000000000000000000000000000000000000000000000000000006f4171c900000000000000000000000000000000000000000000000000000000643fd0df000000000000000000000000000000000000000000000000000000006525b5f50000000000000000000000000000000000000000000000000000000051973ec80000000000000000000000000000000000000000000000000000000051973ec9000000000000000000000000000000000000000000000000000000005f91b0af0000000000000000000000000000000000000000000000000000000041304fac000000000000000000000000000000000000000000000000000000004b5c4277000000000000000000000000000000000000000000000000000000002c2ecbc10000000000000000000000000000000000000000000000000000000032458eec0000000000000000000000000000000000000000000000000000000032458eed00000000000000000000000000000000000000000000000000000000399174d3000000000000000000000000000000000000000000000000000000002c2ecbc200000000000000000000000000000000000000000000000000000000319af333000000000000000000000000000000000000000000000000000000000bb563d6000000000000000000000000000000000000000000000000000000001c9d7eb3000000000000000000000000000000000000000000000000000000002a110e838000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000000e05f48d100000000000000000000000000000000000000000000000000000000f666715a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff0be77f5600000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffdaf0d4aa00000000000000000000000000000000000000000000000000000000c3b5563500000000000000000000000000000000000000000000000000000000b60e72cc00000000000000000000000000000000000000000000000000000000ffff000000000000000000000000000000000000000000000000000000000000e9b6229600000000000000000000000000000000000000000000000000000000f82c50f1000000000000000000000000000000000000000000000000000000008feac52500000000000000000000000000000000000000000000000000000000853c4849000000000000000000000000000000000000000000000000000000008309e8a800000000000000000000000000000000000000000000000000000000ffffff00000000000000000000000000000000000000000000000000000000002d8349260000000000000000000000000000000000000000000000000000000075b605d300000000000000000000000000000000000000000000000000000000759f86bb00000000000000000000000000000000000000000000000000000000ff000000000000000000000000000000000000000000000000000000000000006e18a1280000000000000000000000000000000000000000000000000000000069276c86000000000000000000000000000000000000000000000000000000002d5b6cb900000000000000000000000000000000000000000000000000000000643fd0df000000000000000000000000000000000000000000000000000000002c2ecbc20000000000000000000000000000000000000000000000000000000051973ec9000000000000000000000000000000000000000000000000000000004b5c42770000000000000000000000000000000000000000000000000000000041304fac00000000000000000000000000000000000000000000000000000000399174d30000000000000000000000000000000000000000000000000000000032458eed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000319af333000000000000000000000000000000000000000000000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000002a110e83000000000000000000000000000000000000000000000000000000001c9d7eb300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000636f6e736f6c652e6c6f67000000000000000000000000000000000000000000000000ffffffffffffff80000000000000000000000000000000000000000000000000ffffffffffffffa08ebdb7905936fe93daa3dc04f3ca7f4165ab23816d5f313f5889aef03b99c32c", - "linkReferences": {}, - "deployedLinkReferences": {}, - "factoryDeps": {} -} diff --git a/src/deps/mod.rs b/src/deps/mod.rs index ab051e03..f6c721bc 100644 --- a/src/deps/mod.rs +++ b/src/deps/mod.rs @@ -8,7 +8,7 @@ use zksync_types::{ use std::fmt; /// In-memory storage. -#[derive(Debug, Default, Clone)] +#[derive(Debug, Default, Clone, PartialEq)] pub struct InMemoryStorage { pub(crate) state: HashMap, pub(crate) factory_deps: HashMap>, diff --git a/src/deps/test-contracts/Primary.json b/src/deps/test-contracts/Primary.json new file mode 100644 index 00000000..d9c096e8 --- /dev/null +++ b/src/deps/test-contracts/Primary.json @@ -0,0 +1,68 @@ +{ + "_format": "hh-zksolc-artifact-1", + "contractName": "Primary", + "sourceName": "cache-zk/solpp-generated-contracts/tracing/Primary.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_secondary", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "calculate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "shouldRevert", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x00030000000000020001000000000002000200000001035500000060011002700000006d0010019d000100000000001f00000001012001900000004b0000c13d0000008001000039000000400010043f0000000001000031000000040110008c000000c30000413d0000000201000367000000000101043b000000e001100270000000730210009c000000b20000613d000000740210009c0000008f0000613d000000750110009c000000c30000c13d0000000001000416000000000101004b000000c30000c13d000000040100008a00000000011000310000006f02000041000000000301004b000000000300001900000000030240190000006f01100197000000000401004b000000000200a0190000006f0110009c00000000010300190000000001026019000000000101004b000000c30000c13d000000c001000039000000400010043f0000000701000039000000800010043f0000007d01000041000000a00010043f0000002002000039000000400100043d0000000003210436000000800200043d00000000002304350000004003100039000000000402004b0000003d0000613d00000000040000190000000005340019000000a006400039000000000606043300000000006504350000002004400039000000000524004b000000360000413d000000000332001900000000000304350000005f02200039000000200300008a000000000232016f0000006d030000410000006d0420009c00000000020380190000006d0410009c000000000103801900000040011002100000006002200210000000000112019f000001ae0001042e0000000001000416000000000101004b000000c30000c13d00000000010000310000009f02100039000000200300008a000000000232016f0000006e0320009c0000005a0000413d0000007c0100004100000000001004350000004101000039000000040010043f0000007b01000041000001af00010430000000400020043f0000001f0210018f00000002030003670000000504100272000000680000613d00000000050000190000000506500210000000000763034f000000000707043b000000800660003900000000007604350000000105500039000000000645004b000000600000413d000000000502004b000000770000613d0000000504400210000000000343034f00000003022002100000008004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f00000000002404350000006f02000041000000200310008c000000000300001900000000030240190000006f01100197000000000401004b000000000200a0190000006f0110009c00000000010300190000000001026019000000000101004b000000c30000c13d000000800100043d000000700210009c000000c30000213d000000000200041a0000007102200197000000000112019f000000000010041b0000002001000039000001000010044300000120000004430000007201000041000001ae0001042e0000000001000416000000000101004b000000c30000c13d000000040100008a00000000011000310000006f02000041000000200310008c000000000300001900000000030240190000006f01100197000000000401004b000000000200a0190000006f0110009c00000000010300190000000001026019000000000101004b000000c30000c13d000000000200041a000000400a00043d0000007a0100004100000000001a043500000004010000390000000201100367000000000101043b0000000403a00039000000000013043500000000010004140000007002200197000000040320008c000000d20000c13d0000000103000031000000200130008c00000020040000390000000004034019000001020000013d0000000001000416000000000101004b000000c30000c13d000000040100008a00000000011000310000006f02000041000000000301004b000000000300001900000000030240190000006f01100197000000000401004b000000000200a0190000006f0110009c00000000010300190000000001026019000000000101004b000000c50000613d0000000001000019000001af00010430000000000200041a000000400a00043d000000760100004100000000001a043500000000010004140000007002200197000000040320008c000001170000c13d0000000103000031000000200130008c00000020040000390000000004034019000001470000013d0000006d030000410000006d0410009c00000000010380190000006d04a0009c00000000030a40190000004003300210000000c001100210000000000131019f0000007b011001c700010000000a001d01ad01a80000040f000000010a000029000000000301001900000060033002700000006d03300197000000200430008c000000200400003900000000040340190000001f0540018f0000000506400272000000f00000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b000000e80000413d000000000705004b000000ff0000613d0000000506600210000000000761034f00000000066a00190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f0000000000560435000100000003001f00000001022001900000015c0000613d0000001f01400039000000600210018f0000000001a20019000000000221004b00000000020000190000000102004039000000780410009c000000540000213d0000000102200190000000540000c13d000000400010043f000000200230008c000000c30000413d00000000020a043300000000002104350000006d020000410000006d0310009c0000000001028019000000400110021000000079011001c7000001ae0001042e0000006d030000410000006d0410009c00000000010380190000006d04a0009c00000000030a40190000004003300210000000c001100210000000000131019f00000077011001c700010000000a001d01ad01a80000040f000000010a000029000000000301001900000060033002700000006d03300197000000200430008c000000200400003900000000040340190000001f0540018f0000000506400272000001350000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b0000012d0000413d000000000705004b000001440000613d0000000506600210000000000761034f00000000066a00190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f0000000000560435000100000003001f0000000102200190000001820000613d0000001f01400039000000600210018f0000000001a20019000000000221004b00000000020000190000000102004039000000780410009c000000540000213d0000000102200190000000540000c13d000000400010043f000000200230008c000000c30000413d00000000020a043300000000002104350000006d020000410000006d0310009c0000000001028019000000400110021000000079011001c7000001ae0001042e000000400200043d0000001f0430018f0000000503300272000001690000613d000000000500001900000005065002100000000007620019000000000661034f000000000606043b00000000006704350000000105500039000000000635004b000001610000413d000000000504004b000001780000613d0000000503300210000000000131034f00000000033200190000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000006d0100004100000001030000310000006d0430009c00000000030180190000006d0420009c000000000102401900000040011002100000006002300210000000000112019f000001af00010430000000400200043d0000001f0430018f00000005033002720000018f0000613d000000000500001900000005065002100000000007620019000000000661034f000000000606043b00000000006704350000000105500039000000000635004b000001870000413d000000000504004b0000019e0000613d0000000503300210000000000131034f00000000033200190000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000006d0100004100000001030000310000006d0430009c00000000030180190000006d0420009c000000000102401900000040011002100000006002300210000000000112019f000001af00010430000001ab002104230000000102000039000000000001042d0000000002000019000000000001042d000001ad00000432000001ae0001042e000001af00010430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000100000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000d3072d8200000000000000000000000000000000000000000000000000000000b9d92de80000000000000000000000000000000000000000000000000000000006fdde03d3072d82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff0000000000000000000000000000000000000020000000000000000000000000c6888fa10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000004e487b71000000000000000000000000000000000000000000000000000000005072696d617279000000000000000000000000000000000000000000000000009c917ca34a24c60aac10aab9022e5996487bc34dbb282973dfb468de4a087199", + "deployedBytecode": "0x00030000000000020001000000000002000200000001035500000060011002700000006d0010019d000100000000001f00000001012001900000004b0000c13d0000008001000039000000400010043f0000000001000031000000040110008c000000c30000413d0000000201000367000000000101043b000000e001100270000000730210009c000000b20000613d000000740210009c0000008f0000613d000000750110009c000000c30000c13d0000000001000416000000000101004b000000c30000c13d000000040100008a00000000011000310000006f02000041000000000301004b000000000300001900000000030240190000006f01100197000000000401004b000000000200a0190000006f0110009c00000000010300190000000001026019000000000101004b000000c30000c13d000000c001000039000000400010043f0000000701000039000000800010043f0000007d01000041000000a00010043f0000002002000039000000400100043d0000000003210436000000800200043d00000000002304350000004003100039000000000402004b0000003d0000613d00000000040000190000000005340019000000a006400039000000000606043300000000006504350000002004400039000000000524004b000000360000413d000000000332001900000000000304350000005f02200039000000200300008a000000000232016f0000006d030000410000006d0420009c00000000020380190000006d0410009c000000000103801900000040011002100000006002200210000000000112019f000001ae0001042e0000000001000416000000000101004b000000c30000c13d00000000010000310000009f02100039000000200300008a000000000232016f0000006e0320009c0000005a0000413d0000007c0100004100000000001004350000004101000039000000040010043f0000007b01000041000001af00010430000000400020043f0000001f0210018f00000002030003670000000504100272000000680000613d00000000050000190000000506500210000000000763034f000000000707043b000000800660003900000000007604350000000105500039000000000645004b000000600000413d000000000502004b000000770000613d0000000504400210000000000343034f00000003022002100000008004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f00000000002404350000006f02000041000000200310008c000000000300001900000000030240190000006f01100197000000000401004b000000000200a0190000006f0110009c00000000010300190000000001026019000000000101004b000000c30000c13d000000800100043d000000700210009c000000c30000213d000000000200041a0000007102200197000000000112019f000000000010041b0000002001000039000001000010044300000120000004430000007201000041000001ae0001042e0000000001000416000000000101004b000000c30000c13d000000040100008a00000000011000310000006f02000041000000200310008c000000000300001900000000030240190000006f01100197000000000401004b000000000200a0190000006f0110009c00000000010300190000000001026019000000000101004b000000c30000c13d000000000200041a000000400a00043d0000007a0100004100000000001a043500000004010000390000000201100367000000000101043b0000000403a00039000000000013043500000000010004140000007002200197000000040320008c000000d20000c13d0000000103000031000000200130008c00000020040000390000000004034019000001020000013d0000000001000416000000000101004b000000c30000c13d000000040100008a00000000011000310000006f02000041000000000301004b000000000300001900000000030240190000006f01100197000000000401004b000000000200a0190000006f0110009c00000000010300190000000001026019000000000101004b000000c50000613d0000000001000019000001af00010430000000000200041a000000400a00043d000000760100004100000000001a043500000000010004140000007002200197000000040320008c000001170000c13d0000000103000031000000200130008c00000020040000390000000004034019000001470000013d0000006d030000410000006d0410009c00000000010380190000006d04a0009c00000000030a40190000004003300210000000c001100210000000000131019f0000007b011001c700010000000a001d01ad01a80000040f000000010a000029000000000301001900000060033002700000006d03300197000000200430008c000000200400003900000000040340190000001f0540018f0000000506400272000000f00000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b000000e80000413d000000000705004b000000ff0000613d0000000506600210000000000761034f00000000066a00190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f0000000000560435000100000003001f00000001022001900000015c0000613d0000001f01400039000000600210018f0000000001a20019000000000221004b00000000020000190000000102004039000000780410009c000000540000213d0000000102200190000000540000c13d000000400010043f000000200230008c000000c30000413d00000000020a043300000000002104350000006d020000410000006d0310009c0000000001028019000000400110021000000079011001c7000001ae0001042e0000006d030000410000006d0410009c00000000010380190000006d04a0009c00000000030a40190000004003300210000000c001100210000000000131019f00000077011001c700010000000a001d01ad01a80000040f000000010a000029000000000301001900000060033002700000006d03300197000000200430008c000000200400003900000000040340190000001f0540018f0000000506400272000001350000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b0000012d0000413d000000000705004b000001440000613d0000000506600210000000000761034f00000000066a00190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f0000000000560435000100000003001f0000000102200190000001820000613d0000001f01400039000000600210018f0000000001a20019000000000221004b00000000020000190000000102004039000000780410009c000000540000213d0000000102200190000000540000c13d000000400010043f000000200230008c000000c30000413d00000000020a043300000000002104350000006d020000410000006d0310009c0000000001028019000000400110021000000079011001c7000001ae0001042e000000400200043d0000001f0430018f0000000503300272000001690000613d000000000500001900000005065002100000000007620019000000000661034f000000000606043b00000000006704350000000105500039000000000635004b000001610000413d000000000504004b000001780000613d0000000503300210000000000131034f00000000033200190000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000006d0100004100000001030000310000006d0430009c00000000030180190000006d0420009c000000000102401900000040011002100000006002300210000000000112019f000001af00010430000000400200043d0000001f0430018f00000005033002720000018f0000613d000000000500001900000005065002100000000007620019000000000661034f000000000606043b00000000006704350000000105500039000000000635004b000001870000413d000000000504004b0000019e0000613d0000000503300210000000000131034f00000000033200190000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000006d0100004100000001030000310000006d0430009c00000000030180190000006d0420009c000000000102401900000040011002100000006002300210000000000112019f000001af00010430000001ab002104230000000102000039000000000001042d0000000002000019000000000001042d000001ad00000432000001ae0001042e000001af00010430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000100000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000d3072d8200000000000000000000000000000000000000000000000000000000b9d92de80000000000000000000000000000000000000000000000000000000006fdde03d3072d82000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff0000000000000000000000000000000000000020000000000000000000000000c6888fa10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000004e487b71000000000000000000000000000000000000000000000000000000005072696d617279000000000000000000000000000000000000000000000000009c917ca34a24c60aac10aab9022e5996487bc34dbb282973dfb468de4a087199", + "linkReferences": {}, + "deployedLinkReferences": {}, + "factoryDeps": {} +} diff --git a/src/deps/test-contracts/Secondary.json b/src/deps/test-contracts/Secondary.json new file mode 100644 index 00000000..e39f0fa7 --- /dev/null +++ b/src/deps/test-contracts/Secondary.json @@ -0,0 +1,68 @@ +{ + "_format": "hh-zksolc-artifact-1", + "contractName": "Secondary", + "sourceName": "cache-zk/solpp-generated-contracts/tracing/Secondary.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_data", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "multiply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "shouldRevert", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "bytecode": "0x000200000000000200010000000103550000006001100270000000370010019d0000000101200190000000490000c13d0000008001000039000000400010043f0000000001000031000000040110008c000000bc0000413d0000000101000367000000000101043b000000e0011002700000003d0210009c000000880000613d0000003e0210009c000000ab0000613d0000003f0110009c000000bc0000c13d0000000001000416000000000101004b000000bc0000c13d000000040100008a00000000011000310000003902000041000000000301004b000000000300001900000000030240190000003901100197000000000401004b000000000200a019000000390110009c00000000010300190000000001026019000000000101004b000000bc0000c13d000000c001000039000000400010043f0000000901000039000000800010043f0000004401000041000000a00010043f0000002002000039000000400100043d0000000003210436000000800200043d00000000002304350000004003100039000000000402004b0000003b0000613d00000000040000190000000005340019000000a006400039000000000606043300000000006504350000002004400039000000000524004b000000340000413d000000000332001900000000000304350000005f02200039000000200300008a000000000232016f0000003703000041000000370420009c0000000002038019000000370410009c000000000103801900000040011002100000006002200210000000000112019f000000d70001042e0000000001000416000000000101004b000000bc0000c13d00000000010000310000009f02100039000000200300008a000000000232016f000000380320009c000000580000413d0000003b0100004100000000001004350000004101000039000000040010043f0000003c01000041000000d800010430000000400020043f0000001f0210018f00000001030003670000000504100272000000660000613d00000000050000190000000506500210000000000763034f000000000707043b000000800660003900000000007604350000000105500039000000000645004b0000005e0000413d000000000502004b000000750000613d0000000504400210000000000343034f00000003022002100000008004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f00000000002404350000003902000041000000200310008c000000000300001900000000030240190000003901100197000000000401004b000000000200a019000000390110009c00000000010300190000000001026019000000000101004b000000bc0000c13d000000800100043d000000000010041b0000002001000039000001000010044300000120000004430000003a01000041000000d70001042e0000000001000416000000000101004b000000bc0000c13d000000040100008a00000000011000310000003902000041000000000301004b000000000300001900000000030240190000003901100197000000000401004b000000000200a019000000390110009c00000000010300190000000001026019000000000101004b000000bc0000c13d000000400100043d000000440210003900000040030000410000000000320435000000240210003900000012030000390000000000320435000000410200004100000000002104350000000402100039000000200300003900000000003204350000003702000041000000370310009c0000000001028019000000400110021000000042011001c7000000d8000104300000000001000416000000000101004b000000bc0000c13d000000040100008a00000000011000310000003902000041000000200310008c000000000300001900000000030240190000003901100197000000000401004b000000000200a019000000390110009c00000000010300190000000001026019000000000101004b000000be0000613d0000000001000019000000d80001043000000004010000390000000101100367000000000201043b000000000300041a00000000412300a9000000000403004b000000c80000613d00000000433100d9000000000232004b000000d00000c13d000000400200043d00000000001204350000003701000041000000370320009c0000000001024019000000400110021000000043011001c7000000d70001042e0000003b0100004100000000001004350000001101000039000000040010043f0000003c01000041000000d800010430000000d600000432000000d70001042e000000d80001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000010000000000000000800000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000400000010000000000000000004e487b7100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000d3072d8200000000000000000000000000000000000000000000000000000000c6888fa10000000000000000000000000000000000000000000000000000000006fdde03546869732073686f756c6420726576657274000000000000000000000000000008c379a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000200000000000000000000000005365636f6e64617279000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ea1fe6554dbdbb43038724153cb8d87eb9015df7df422ef539f7d7c715e3c99", + "deployedBytecode": "0x000200000000000200010000000103550000006001100270000000370010019d0000000101200190000000490000c13d0000008001000039000000400010043f0000000001000031000000040110008c000000bc0000413d0000000101000367000000000101043b000000e0011002700000003d0210009c000000880000613d0000003e0210009c000000ab0000613d0000003f0110009c000000bc0000c13d0000000001000416000000000101004b000000bc0000c13d000000040100008a00000000011000310000003902000041000000000301004b000000000300001900000000030240190000003901100197000000000401004b000000000200a019000000390110009c00000000010300190000000001026019000000000101004b000000bc0000c13d000000c001000039000000400010043f0000000901000039000000800010043f0000004401000041000000a00010043f0000002002000039000000400100043d0000000003210436000000800200043d00000000002304350000004003100039000000000402004b0000003b0000613d00000000040000190000000005340019000000a006400039000000000606043300000000006504350000002004400039000000000524004b000000340000413d000000000332001900000000000304350000005f02200039000000200300008a000000000232016f0000003703000041000000370420009c0000000002038019000000370410009c000000000103801900000040011002100000006002200210000000000112019f000000d70001042e0000000001000416000000000101004b000000bc0000c13d00000000010000310000009f02100039000000200300008a000000000232016f000000380320009c000000580000413d0000003b0100004100000000001004350000004101000039000000040010043f0000003c01000041000000d800010430000000400020043f0000001f0210018f00000001030003670000000504100272000000660000613d00000000050000190000000506500210000000000763034f000000000707043b000000800660003900000000007604350000000105500039000000000645004b0000005e0000413d000000000502004b000000750000613d0000000504400210000000000343034f00000003022002100000008004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f00000000002404350000003902000041000000200310008c000000000300001900000000030240190000003901100197000000000401004b000000000200a019000000390110009c00000000010300190000000001026019000000000101004b000000bc0000c13d000000800100043d000000000010041b0000002001000039000001000010044300000120000004430000003a01000041000000d70001042e0000000001000416000000000101004b000000bc0000c13d000000040100008a00000000011000310000003902000041000000000301004b000000000300001900000000030240190000003901100197000000000401004b000000000200a019000000390110009c00000000010300190000000001026019000000000101004b000000bc0000c13d000000400100043d000000440210003900000040030000410000000000320435000000240210003900000012030000390000000000320435000000410200004100000000002104350000000402100039000000200300003900000000003204350000003702000041000000370310009c0000000001028019000000400110021000000042011001c7000000d8000104300000000001000416000000000101004b000000bc0000c13d000000040100008a00000000011000310000003902000041000000200310008c000000000300001900000000030240190000003901100197000000000401004b000000000200a019000000390110009c00000000010300190000000001026019000000000101004b000000be0000613d0000000001000019000000d80001043000000004010000390000000101100367000000000201043b000000000300041a00000000412300a9000000000403004b000000c80000613d00000000433100d9000000000232004b000000d00000c13d000000400200043d00000000001204350000003701000041000000370320009c0000000001024019000000400110021000000043011001c7000000d70001042e0000003b0100004100000000001004350000001101000039000000040010043f0000003c01000041000000d800010430000000d600000432000000d70001042e000000d80001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000010000000000000000800000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000400000010000000000000000004e487b7100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000d3072d8200000000000000000000000000000000000000000000000000000000c6888fa10000000000000000000000000000000000000000000000000000000006fdde03546869732073686f756c6420726576657274000000000000000000000000000008c379a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000200000000000000000000000005365636f6e64617279000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ea1fe6554dbdbb43038724153cb8d87eb9015df7df422ef539f7d7c715e3c99", + "linkReferences": {}, + "deployedLinkReferences": {}, + "factoryDeps": {} +} diff --git a/src/evm.rs b/src/evm.rs index 6938071f..ed3efc78 100644 --- a/src/evm.rs +++ b/src/evm.rs @@ -1,20 +1,34 @@ use std::sync::{Arc, RwLock}; -use crate::{fork::ForkSource, node::InMemoryNodeInner, utils::mine_empty_blocks}; +use crate::{ + fork::ForkSource, + node::{InMemoryNodeInner, Snapshot}, + utils::mine_empty_blocks, +}; use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_derive::rpc; +use zksync_basic_types::U64; use zksync_core::api_server::web3::backend_jsonrpc::error::into_jsrpc_error; use zksync_web3_decl::error::Web3Error; +/// The maximum number of [Snapshot]s to store. Each snapshot represents the node state +/// and can be used to revert the node to an earlier point in time. +const MAX_SNAPSHOTS: u8 = 100; + /// Implementation of EvmNamespace pub struct EvmNamespaceImpl { node: Arc>>, + /// List of snapshots of the [InMemoryNodeInner]. This is bounded at runtime by [MAX_SNAPSHOTS]. + snapshots: Arc>>, } impl EvmNamespaceImpl { /// Creates a new `Evm` instance with the given `node`. pub fn new(node: Arc>>) -> Self { - Self { node } + Self { + node, + snapshots: Default::default(), + } } } @@ -60,6 +74,28 @@ pub trait EvmNamespaceT { /// The difference between the `current_timestamp` and the new timestamp for the InMemoryNodeInner. #[rpc(name = "evm_setTime")] fn set_time(&self, time: u64) -> BoxFuture>; + + /// Snapshot the state of the blockchain at the current block. Takes no parameters. Returns the id of the snapshot + /// that was created. A snapshot can only be reverted once. After a successful evm_revert, the same snapshot id cannot + /// be used again. Consider creating a new snapshot after each evm_revert if you need to revert to the same + /// point multiple times. + /// + /// # Returns + /// The `U64` identifier for this snapshot. + #[rpc(name = "evm_snapshot")] + fn snapshot(&self) -> BoxFuture>; + + /// Revert the state of the blockchain to a previous snapshot. Takes a single parameter, + /// which is the snapshot id to revert to. This deletes the given snapshot, as well as any snapshots + /// taken after (e.g.: reverting to id 0x1 will delete snapshots with ids 0x1, 0x2, etc.) + /// + /// # Parameters + /// - `snapshot_id`: The snapshot id to revert. + /// + /// # Returns + /// `true` if a snapshot was reverted, otherwise `false`. + #[rpc(name = "evm_revert")] + fn revert_snapshot(&self, snapshot_id: U64) -> BoxFuture>; } impl EvmNamespaceT @@ -125,13 +161,99 @@ impl EvmNamespaceT match inner.write() { Ok(mut inner) => { mine_empty_blocks(&mut inner, 1, 1000); - log::info!("👷 Mined block #{}", inner.current_miniblock); + tracing::info!("👷 Mined block #{}", inner.current_miniblock); Ok("0x0".to_string()) } Err(_) => Err(into_jsrpc_error(Web3Error::InternalError)), } }) } + + fn snapshot(&self) -> BoxFuture> { + let inner = Arc::clone(&self.node); + let snapshots = Arc::clone(&self.snapshots); + + Box::pin(async move { + // validate max snapshots + snapshots + .read() + .map_err(|err| { + tracing::error!("failed acquiring read lock for snapshot: {:?}", err); + into_jsrpc_error(Web3Error::InternalError) + }) + .and_then(|snapshots| { + if snapshots.len() >= MAX_SNAPSHOTS as usize { + tracing::error!("maximum number of '{}' snapshots exceeded", MAX_SNAPSHOTS); + Err(into_jsrpc_error(Web3Error::InternalError)) + } else { + Ok(()) + } + })?; + + // snapshot the node + let snapshot = inner + .read() + .map_err(|err| { + format!("failed acquiring read lock to node for snapshot: {:?}", err) + }) + .and_then(|reader| reader.snapshot()) + .map_err(|err| { + tracing::error!("failed creating snapshot: {:?}", err); + into_jsrpc_error(Web3Error::InternalError) + })?; + snapshots + .write() + .map(|mut snapshots| { + snapshots.push(snapshot); + tracing::info!("Created snapshot '{}'", snapshots.len()); + snapshots.len() + }) + .map_err(|err| { + tracing::error!("failed storing snapshot: {:?}", err); + into_jsrpc_error(Web3Error::InternalError) + }) + .map(U64::from) + }) + } + + fn revert_snapshot(&self, snapshot_id: U64) -> BoxFuture> { + let inner = Arc::clone(&self.node); + let snapshots = Arc::clone(&self.snapshots); + + Box::pin(async move { + let mut snapshots = snapshots.write().map_err(|err| { + tracing::error!("failed acquiring read lock for snapshots: {:?}", err); + into_jsrpc_error(Web3Error::InternalError) + })?; + let snapshot_id_index = snapshot_id.as_usize().saturating_sub(1); + if snapshot_id_index >= snapshots.len() { + tracing::error!("no snapshot exists for the id '{}'", snapshot_id); + return Err(into_jsrpc_error(Web3Error::InternalError)); + } + + // remove all snapshots following the index and use the first snapshot for restore + let selected_snapshot = snapshots + .drain(snapshot_id_index..) + .next() + .expect("unexpected failure, value must exist"); + + inner + .write() + .map_err(|err| format!("failed acquiring read lock for snapshots: {:?}", err)) + .and_then(|mut writer| { + tracing::info!("Reverting node to snapshot '{snapshot_id:?}'"); + writer.restore_snapshot(selected_snapshot).map(|_| true) + }) + .or_else(|err| { + tracing::error!( + "failed restoring snapshot for id '{}': {}", + snapshot_id, + err + ); + Ok(false) + }) + }) + } } #[cfg(test)] @@ -480,4 +602,74 @@ mod tests { assert_eq!(start_block.number + 2, current_block.number); assert_eq!(start_block.timestamp + 2, current_block.timestamp); } + + #[tokio::test] + async fn test_evm_snapshot_creates_incrementing_ids() { + let node = InMemoryNode::::default(); + let evm = EvmNamespaceImpl::new(node.get_inner()); + + let snapshot_id_1 = evm.snapshot().await.expect("failed creating snapshot 1"); + let snapshot_id_2 = evm.snapshot().await.expect("failed creating snapshot 2"); + + assert_eq!(snapshot_id_1, U64::from(1)); + assert_eq!(snapshot_id_2, U64::from(2)); + } + + #[tokio::test] + async fn test_evm_revert_snapshot_restores_state() { + let node = InMemoryNode::::default(); + let evm = EvmNamespaceImpl::new(node.get_inner()); + + let initial_block = node + .get_block_number() + .await + .expect("failed fetching block number"); + let snapshot_id = evm.snapshot().await.expect("failed creating snapshot"); + evm.evm_mine().await.expect("evm_mine"); + let current_block = node + .get_block_number() + .await + .expect("failed fetching block number"); + assert_eq!(current_block, initial_block + 1); + + let reverted = evm + .revert_snapshot(snapshot_id) + .await + .expect("failed reverting snapshot"); + assert!(reverted); + + let restored_block = node + .get_block_number() + .await + .expect("failed fetching block number"); + assert_eq!(restored_block, initial_block); + } + + #[tokio::test] + async fn test_evm_revert_snapshot_removes_all_snapshots_following_the_reverted_one() { + let node = InMemoryNode::::default(); + let evm = EvmNamespaceImpl::new(node.get_inner()); + + let _snapshot_id_1 = evm.snapshot().await.expect("failed creating snapshot"); + let snapshot_id_2 = evm.snapshot().await.expect("failed creating snapshot"); + let _snapshot_id_3 = evm.snapshot().await.expect("failed creating snapshot"); + assert_eq!(3, evm.snapshots.read().unwrap().len()); + + let reverted = evm + .revert_snapshot(snapshot_id_2) + .await + .expect("failed reverting snapshot"); + assert!(reverted); + + assert_eq!(1, evm.snapshots.read().unwrap().len()); + } + + #[tokio::test] + async fn test_evm_revert_snapshot_fails_for_invalid_snapshot_id() { + let node = InMemoryNode::::default(); + let evm = EvmNamespaceImpl::new(node.get_inner()); + + let result = evm.revert_snapshot(U64::from(100)).await; + assert!(result.is_err()); + } } diff --git a/src/filters.rs b/src/filters.rs index b490eab9..8d4214dd 100644 --- a/src/filters.rs +++ b/src/filters.rs @@ -87,7 +87,7 @@ pub struct PendingTransactionFilter { type Result = std::result::Result; /// Keeps track of installed filters and their respective updates. -#[derive(Debug, Default, Clone)] +#[derive(Debug, Default, Clone, PartialEq)] pub struct EthFilters { id_counter: U256, filters: HashMap, @@ -107,7 +107,7 @@ impl EthFilters { }), ); - log::info!("created block filter '{:#x}'", self.id_counter); + tracing::info!("created block filter '{:#x}'", self.id_counter); Ok(self.id_counter) } @@ -134,7 +134,7 @@ impl EthFilters { })), ); - log::info!("created log filter '{:#x}'", self.id_counter); + tracing::info!("created log filter '{:#x}'", self.id_counter); Ok(self.id_counter) } @@ -151,7 +151,7 @@ impl EthFilters { }), ); - log::info!( + tracing::info!( "created pending transaction filter '{:#x}'", self.id_counter ); @@ -160,7 +160,7 @@ impl EthFilters { /// Removes the filter with the given id. Returns true if the filter existed, false otherwise. pub fn remove_filter(&mut self, id: U256) -> bool { - log::info!("removing filter '{id:#x}'"); + tracing::info!("removing filter '{id:#x}'"); self.filters.remove(&id).is_some() } diff --git a/src/fork.rs b/src/fork.rs index 177e4356..ab191419 100644 --- a/src/fork.rs +++ b/src/fork.rs @@ -5,7 +5,7 @@ use std::{ collections::HashMap, - convert::TryInto, + convert::{TryFrom, TryInto}, future::Future, sync::{Arc, RwLock}, }; @@ -14,7 +14,10 @@ use tokio::runtime::Builder; use zksync_basic_types::{Address, L1BatchNumber, L2ChainId, MiniblockNumber, H256, U256, U64}; use zksync_types::{ - api::{Block, BlockIdVariant, BlockNumber, Transaction, TransactionVariant}, + api::{ + Block, BlockDetails, BlockIdVariant, BlockNumber, BridgeAddresses, Transaction, + TransactionDetails, TransactionVariant, + }, l2::L2Tx, ProtocolVersionId, StorageKey, }; @@ -22,7 +25,9 @@ use zksync_types::{ use zksync_state::ReadStorage; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; -use zksync_web3_decl::{jsonrpsee::http_client::HttpClient, namespaces::EthNamespaceClient}; +use zksync_web3_decl::{ + jsonrpsee::http_client::HttpClient, namespaces::EthNamespaceClient, types::Index, +}; use zksync_web3_decl::{jsonrpsee::http_client::HttpClientBuilder, namespaces::ZksNamespaceClient}; use crate::{cache::CacheConfig, node::TEST_NODE_NETWORK_ID}; @@ -47,7 +52,7 @@ where /// In memory storage, that allows 'forking' from other network. /// If forking is enabled, it reads missing data from remote location. /// S - is a struct that is used for source of the fork. -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct ForkStorage { pub inner: Arc>>, pub chain_id: L2ChainId, @@ -74,8 +79,8 @@ impl ForkStorage { let chain_id = fork .as_ref() .and_then(|d| d.overwrite_chain_id) - .unwrap_or(L2ChainId(TEST_NODE_NETWORK_ID)); - log::info!("Starting network with chain id: {:?}", chain_id); + .unwrap_or(L2ChainId::from(TEST_NODE_NETWORK_ID)); + tracing::info!("Starting network with chain id: {:?}", chain_id); ForkStorage { inner: Arc::new(RwLock::new(ForkStorageInner { @@ -125,7 +130,7 @@ impl ForkStorage { } } - pub fn load_factory_dep_internal(&self, hash: H256) -> Option> { + fn load_factory_dep_internal(&self, hash: H256) -> Option> { let mut mutator = self.inner.write().unwrap(); let local_storage = mutator.raw_storage.load_factory_dep(hash); if let Some(fork) = &mutator.fork { @@ -210,9 +215,13 @@ pub trait ForkSource { /// Returns the bytecode stored under this hash (if available). fn get_bytecode_by_hash(&self, hash: H256) -> eyre::Result>>; + /// Returns the transaction for a given hash. fn get_transaction_by_hash(&self, hash: H256) -> eyre::Result>; + /// Returns the transaction details for a given hash. + fn get_transaction_details(&self, hash: H256) -> eyre::Result>; + /// Gets all transactions that belong to a given miniblock. fn get_raw_block_transactions( &self, @@ -233,6 +242,9 @@ pub trait ForkSource { full_transactions: bool, ) -> eyre::Result>>; + /// Returns the block details for a given miniblock number. + fn get_block_details(&self, miniblock: MiniblockNumber) -> eyre::Result>; + /// Returns the transaction count for a given block hash. fn get_block_transaction_count_by_hash(&self, block_hash: H256) -> eyre::Result>; @@ -241,6 +253,23 @@ pub trait ForkSource { &self, block_number: zksync_types::api::BlockNumber, ) -> eyre::Result>; + + /// Returns information about a transaction by block hash and transaction index position. + fn get_transaction_by_block_hash_and_index( + &self, + block_hash: H256, + index: Index, + ) -> eyre::Result>; + + /// Returns information about a transaction by block number and transaction index position. + fn get_transaction_by_block_number_and_index( + &self, + block_number: BlockNumber, + index: Index, + ) -> eyre::Result>; + + /// Returns addresses of the default bridge contracts. + fn get_bridge_contracts(&self) -> eyre::Result; } /// Holds the information about the original chain. @@ -264,6 +293,7 @@ const SUPPORTED_VERSIONS: &[ProtocolVersionId] = &[ ProtocolVersionId::Version13, ProtocolVersionId::Version14, ProtocolVersionId::Version15, + ProtocolVersionId::Version16, ]; pub fn supported_protocol_versions(version: ProtocolVersionId) -> bool { @@ -299,8 +329,7 @@ impl ForkDetails { let block = client .get_block_by_hash(root_hash, true) .await - .ok() - .flatten() + .expect("failed retrieving block") .unwrap_or_else(|| { panic!( "Could not find block #{:?} ({:#x}) in {:?}", @@ -309,7 +338,7 @@ impl ForkDetails { }); let l1_batch_number = block_details.l1_batch_number; - log::info!( + tracing::info!( "Creating fork from {:?} L1 block: {:?} L2 block: {:?} with timestamp {:?}, L1 gas price {:?} and protocol version: {:?}" , url, l1_batch_number, miniblock, block_details.base.timestamp, block_details.base.l1_gas_price, block_details.protocol_version ); @@ -353,7 +382,9 @@ impl ForkDetails { pub async fn from_network_tx(fork: &str, tx: H256, cache_config: CacheConfig) -> Self { let (url, client) = Self::fork_to_url_and_client(fork); let tx_details = client.get_transaction_by_hash(tx).await.unwrap().unwrap(); - let overwrite_chain_id = Some(L2ChainId(tx_details.chain_id.as_u32() as u16)); + let overwrite_chain_id = Some(L2ChainId::try_from(tx_details.chain_id).unwrap_or_else( + |err| panic!("erroneous chain id {}: {:?}", tx_details.chain_id, err,), + )); let miniblock_number = MiniblockNumber(tx_details.block_number.unwrap().as_u32()); // We have to sync to the one-miniblock before the one where transaction is. let l2_miniblock = miniblock_number.saturating_sub(1) as u64; diff --git a/src/formatter.rs b/src/formatter.rs index 57cfeacd..080046eb 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -73,7 +73,7 @@ pub fn print_event(event: &VmEvent, resolve_hashes: bool) { } } - log::info!( + tracing::info!( "{} {}", address_to_human_readable(event.address) .map(|x| format!("{:42}", x.blue())) @@ -151,9 +151,9 @@ pub fn print_call(call: &Call, padding: usize, show_calls: &ShowCalls, resolve_h ); if call.revert_reason.as_ref().is_some() || call.error.as_ref().is_some() { - log::info!("{}", pretty_print.on_red()); + tracing::info!("{}", pretty_print.on_red()); } else { - log::info!("{}", pretty_print); + tracing::info!("{}", pretty_print); } } for subcall in &call.calls { @@ -163,48 +163,48 @@ pub fn print_call(call: &Call, padding: usize, show_calls: &ShowCalls, resolve_h pub fn print_logs(log_query: &StorageLogQuery) { let separator = "─".repeat(82); - log::info!("{:<15} {:?}", "Type:", log_query.log_type); - log::info!( + tracing::info!("{:<15} {:?}", "Type:", log_query.log_type); + tracing::info!( "{:<15} {}", "Address:", address_to_human_readable(log_query.log_query.address) .unwrap_or(format!("{}", log_query.log_query.address)) ); - log::info!("{:<15} {:#066x}", "Key:", log_query.log_query.key); + tracing::info!("{:<15} {:#066x}", "Key:", log_query.log_query.key); - log::info!( + tracing::info!( "{:<15} {:#066x}", "Read Value:", log_query.log_query.read_value ); if log_query.log_type != StorageLogQueryType::Read { - log::info!( + tracing::info!( "{:<15} {:#066x}", "Written Value:", log_query.log_query.written_value ); } - log::info!("{}", separator); + tracing::info!("{}", separator); } pub fn print_vm_details(result: &VmExecutionResultAndLogs) { - log::info!(""); - log::info!("┌──────────────────────────┐"); - log::info!("│ VM EXECUTION RESULTS │"); - log::info!("└──────────────────────────┘"); + tracing::info!(""); + tracing::info!("┌──────────────────────────┐"); + tracing::info!("│ VM EXECUTION RESULTS │"); + tracing::info!("└──────────────────────────┘"); - log::info!("Cycles Used: {}", result.statistics.cycles_used); - log::info!( + tracing::info!("Cycles Used: {}", result.statistics.cycles_used); + tracing::info!( "Computation Gas Used: {}", result.statistics.computational_gas_used ); - log::info!("Contracts Used: {}", result.statistics.contracts_used); + tracing::info!("Contracts Used: {}", result.statistics.contracts_used); match &result.result { vm::ExecutionResult::Success { .. } => {} vm::ExecutionResult::Revert { output } => { - log::info!(""); - log::info!( + tracing::info!(""); + tracing::info!( "{}", format!( "\n[!] Revert Reason: {}", @@ -214,10 +214,10 @@ pub fn print_vm_details(result: &VmExecutionResultAndLogs) { ); } vm::ExecutionResult::Halt { reason } => { - log::info!(""); - log::info!("{}", format!("\n[!] Halt Reason: {}", reason).on_red()); + tracing::info!(""); + tracing::info!("{}", format!("\n[!] Halt Reason: {}", reason).on_red()); } } - log::info!("════════════════════════════"); + tracing::info!("════════════════════════════"); } diff --git a/src/hardhat.rs b/src/hardhat.rs index 95425aa8..dc99774e 100644 --- a/src/hardhat.rs +++ b/src/hardhat.rs @@ -1,13 +1,17 @@ use std::sync::{Arc, RwLock}; -use crate::{fork::ForkSource, node::InMemoryNodeInner, utils::mine_empty_blocks}; +use crate::{ + fork::ForkSource, + node::InMemoryNodeInner, + utils::{bytecode_to_factory_dep, mine_empty_blocks, IntoBoxedFuture}, +}; use jsonrpc_core::{BoxFuture, Result}; use jsonrpc_derive::rpc; use zksync_basic_types::{Address, U256, U64}; use zksync_core::api_server::web3::backend_jsonrpc::error::into_jsrpc_error; use zksync_state::ReadStorage; use zksync_types::{ - get_nonce_key, + get_code_key, get_nonce_key, utils::{decompose_full_nonce, nonces_to_full_nonce, storage_key_for_eth_balance}, }; use zksync_utils::{h256_to_u256, u256_to_h256}; @@ -99,6 +103,19 @@ pub trait HardhatNamespaceT { /// A `BoxFuture` containing a `Result` with a `bool` representing the success of the operation. #[rpc(name = "hardhat_stopImpersonatingAccount")] fn stop_impersonating_account(&self, address: Address) -> BoxFuture>; + + /// Modifies the bytecode stored at an account's address. + /// + /// # Arguments + /// + /// * `address` - The address where the given code should be stored. + /// * `code` - The code to be stored. + /// + /// # Returns + /// + /// A `BoxFuture` containing a `Result` with a `bool` representing the success of the operation. + #[rpc(name = "hardhat_setCode")] + fn set_code(&self, address: Address, code: Vec) -> BoxFuture>; } impl HardhatNamespaceT @@ -118,7 +135,7 @@ impl HardhatNamespaceT inner_guard .fork_storage .set_value(balance_key, u256_to_h256(balance)); - log::info!( + tracing::info!( "👷 Balance for address {:?} has been manually set to {} Wei", address, balance @@ -161,7 +178,7 @@ impl HardhatNamespaceT } deployment_nonce = nonce; let enforced_full_nonce = nonces_to_full_nonce(account_nonce, deployment_nonce); - log::info!( + tracing::info!( "👷 Nonces for address {:?} have been set to {}", address, nonce @@ -195,7 +212,7 @@ impl HardhatNamespaceT )); } mine_empty_blocks(&mut inner, num_blocks.as_u64(), interval_ms.as_u64()); - log::info!("👷 Mined {} blocks", num_blocks); + tracing::info!("👷 Mined {} blocks", num_blocks); Ok(true) } Err(_) => Err(into_jsrpc_error(Web3Error::InternalError)), @@ -209,10 +226,10 @@ impl HardhatNamespaceT match inner.write() { Ok(mut inner) => { if inner.set_impersonated_account(address) { - log::info!("🕵️ Account {:?} has been impersonated", address); + tracing::info!("🕵️ Account {:?} has been impersonated", address); Ok(true) } else { - log::info!("🕵️ Account {:?} was already impersonated", address); + tracing::info!("🕵️ Account {:?} was already impersonated", address); Ok(false) } } @@ -227,10 +244,10 @@ impl HardhatNamespaceT match inner.write() { Ok(mut inner) => { if inner.stop_impersonating_account(address) { - log::info!("🕵️ Stopped impersonating account {:?}", address); + tracing::info!("🕵️ Stopped impersonating account {:?}", address); Ok(true) } else { - log::info!( + tracing::info!( "🕵️ Account {:?} was not impersonated, nothing to stop", address ); @@ -241,6 +258,31 @@ impl HardhatNamespaceT } }) } + + fn set_code(&self, address: Address, code: Vec) -> BoxFuture> { + let inner = Arc::clone(&self.node); + inner + .write() + .map(|mut writer| { + let code_key = get_code_key(&address); + tracing::info!("set code for address {address:#x}"); + let (hash, code) = bytecode_to_factory_dep(code); + let hash = u256_to_h256(hash); + writer.fork_storage.store_factory_dep( + hash, + code.iter() + .flat_map(|entry| { + let mut bytes = vec![0u8; 32]; + entry.to_big_endian(&mut bytes); + bytes.to_vec() + }) + .collect(), + ); + writer.fork_storage.set_value(code_key, hash); + }) + .map_err(|_| into_jsrpc_error(Web3Error::InternalError)) + .into_boxed_future() + } } #[cfg(test)] @@ -446,4 +488,31 @@ mod tests { // execution should now fail again assert!(node.apply_txs(vec![tx]).is_err()); } + + #[tokio::test] + async fn test_set_code() { + let address = Address::repeat_byte(0x1); + let node = InMemoryNode::::default(); + let hardhat = HardhatNamespaceImpl::new(node.get_inner()); + let new_code = vec![0x1u8; 32]; + + let code_before = node + .get_code(address, None) + .await + .expect("failed getting code") + .0; + assert_eq!(Vec::::default(), code_before); + + hardhat + .set_code(address, new_code.clone()) + .await + .expect("failed setting code"); + + let code_after = node + .get_code(address, None) + .await + .expect("failed getting code") + .0; + assert_eq!(new_code, code_after); + } } diff --git a/src/http_fork_source.rs b/src/http_fork_source.rs index fa0221ce..c375bd16 100644 --- a/src/http_fork_source.rs +++ b/src/http_fork_source.rs @@ -2,9 +2,11 @@ use std::sync::RwLock; use eyre::Context; use zksync_basic_types::{H256, U256}; +use zksync_types::api::{BridgeAddresses, Transaction}; use zksync_web3_decl::{ jsonrpsee::http_client::{HttpClient, HttpClientBuilder}, namespaces::{EthNamespaceClient, ZksNamespaceClient}, + types::Index, }; use crate::{ @@ -66,7 +68,7 @@ impl ForkSource for HttpForkSource { .read() .map(|guard| guard.get_transaction(&hash).cloned()) { - log::debug!("using cached transaction for {hash}"); + tracing::debug!("using cached transaction for {hash}"); return Ok(Some(transaction)); } @@ -78,7 +80,7 @@ impl ForkSource for HttpForkSource { .write() .map(|mut guard| guard.insert_transaction(hash, transaction.clone())) .unwrap_or_else(|err| { - log::warn!( + tracing::warn!( "failed writing to cache for 'get_transaction_by_hash': {:?}", err ) @@ -89,6 +91,18 @@ impl ForkSource for HttpForkSource { .wrap_err("fork http client failed") } + fn get_transaction_details( + &self, + hash: H256, + ) -> eyre::Result> { + let client = self.create_client(); + // n.b- We don't cache these responses as they will change through the lifecycle of the transaction + // and caching could be error-prone. in theory we could cache responses once the txn status + // is `final` or `failed` but currently this does not warrant the additional complexity. + block_on(async move { client.get_transaction_details(hash).await }) + .wrap_err("fork http client failed") + } + fn get_raw_block_transactions( &self, block_number: zksync_basic_types::MiniblockNumber, @@ -99,7 +113,7 @@ impl ForkSource for HttpForkSource { .read() .map(|guard| guard.get_block_raw_transactions(&number).cloned()) { - log::debug!("using cached raw transactions for block {block_number}"); + tracing::debug!("using cached raw transactions for block {block_number}"); return Ok(transaction); } @@ -114,7 +128,7 @@ impl ForkSource for HttpForkSource { guard.insert_block_raw_transactions(number, transactions.clone()) }) .unwrap_or_else(|err| { - log::warn!( + tracing::warn!( "failed writing to cache for 'get_raw_block_transactions': {:?}", err ) @@ -134,7 +148,7 @@ impl ForkSource for HttpForkSource { .read() .map(|guard| guard.get_block(&hash, full_transactions).cloned()) { - log::debug!("using cached block for {hash}"); + tracing::debug!("using cached block for {hash}"); return Ok(Some(block)); } @@ -146,7 +160,10 @@ impl ForkSource for HttpForkSource { .write() .map(|mut guard| guard.insert_block(hash, full_transactions, block.clone())) .unwrap_or_else(|err| { - log::warn!("failed writing to cache for 'get_block_by_hash': {:?}", err) + tracing::warn!( + "failed writing to cache for 'get_block_by_hash': {:?}", + err + ) }); } block @@ -171,7 +188,7 @@ impl ForkSource for HttpForkSource { .and_then(|hash| guard.get_block(hash, full_transactions).cloned()) }) }) { - log::debug!("using cached block for {block_number}"); + tracing::debug!("using cached block for {block_number}"); return Ok(Some(block)); } @@ -189,7 +206,7 @@ impl ForkSource for HttpForkSource { guard.insert_block(block.hash, full_transactions, block.clone()) }) .unwrap_or_else(|err| { - log::warn!( + tracing::warn!( "failed writing to cache for 'get_block_by_number': {:?}", err ) @@ -220,11 +237,82 @@ impl ForkSource for HttpForkSource { }) .wrap_err("fork http client failed") } + + /// Returns information about a transaction by block hash and transaction index position. + fn get_transaction_by_block_hash_and_index( + &self, + block_hash: H256, + index: Index, + ) -> eyre::Result> { + let client = self.create_client(); + block_on(async move { + client + .get_transaction_by_block_hash_and_index(block_hash, index) + .await + }) + .wrap_err("fork http client failed") + } + + /// Returns information about a transaction by block number and transaction index position. + fn get_transaction_by_block_number_and_index( + &self, + block_number: zksync_types::api::BlockNumber, + index: Index, + ) -> eyre::Result> { + let client = self.create_client(); + block_on(async move { + client + .get_transaction_by_block_number_and_index(block_number, index) + .await + }) + .wrap_err("fork http client failed") + } + + /// Returns details of a block, given miniblock number + fn get_block_details( + &self, + miniblock: zksync_basic_types::MiniblockNumber, + ) -> eyre::Result> { + let client = self.create_client(); + block_on(async move { client.get_block_details(miniblock).await }) + .wrap_err("fork http client failed") + } + + /// Returns addresses of the default bridge contracts. + fn get_bridge_contracts(&self) -> eyre::Result { + if let Some(bridge_addresses) = self + .cache + .read() + .ok() + .and_then(|guard| guard.get_bridge_addresses().cloned()) + { + tracing::debug!("using cached bridge contracts"); + return Ok(bridge_addresses); + }; + + let client = self.create_client(); + block_on(async move { client.get_bridge_contracts().await }) + .map(|bridge_addresses| { + self.cache + .write() + .map(|mut guard| guard.set_bridge_addresses(bridge_addresses.clone())) + .unwrap_or_else(|err| { + tracing::warn!( + "failed writing to cache for 'get_bridge_contracts': {:?}", + err + ) + }); + bridge_addresses + }) + .wrap_err("fork http client failed") + } } #[cfg(test)] mod tests { - use zksync_basic_types::{MiniblockNumber, H256, U64}; + use std::str::FromStr; + + use zksync_basic_types::{Address, MiniblockNumber, H160, H256, U64}; use zksync_types::api::BlockNumber; use crate::testing; @@ -466,4 +554,138 @@ mod tests { .expect("no transaction"); assert_eq!(input_tx_hash, actual_transaction.hash); } + + #[test] + fn test_get_transaction_details() { + let input_tx_hash = H256::repeat_byte(0x01); + let mock_server = testing::MockServer::run(); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "zks_getTransactionDetails", + "params": [ + input_tx_hash, + ], + }), + serde_json::json!({ + "jsonrpc": "2.0", + "result": { + "isL1Originated": false, + "status": "included", + "fee": "0x74293f087500", + "gasPerPubdata": "0x4e20", + "initiatorAddress": "0x63ab285cd87a189f345fed7dd4e33780393e01f0", + "receivedAt": "2023-10-12T15:45:53.094Z", + "ethCommitTxHash": null, + "ethProveTxHash": null, + "ethExecuteTxHash": null + }, + "id": 0 + }), + ); + + let fork_source = HttpForkSource::new(mock_server.url(), CacheConfig::Memory); + let transaction_details = fork_source + .get_transaction_details(input_tx_hash) + .expect("failed fetching transaction") + .expect("no transaction"); + assert_eq!( + transaction_details.initiator_address, + Address::from_str("0x63ab285cd87a189f345fed7dd4e33780393e01f0").unwrap() + ); + } + + #[test] + fn test_get_block_details() { + let miniblock = MiniblockNumber::from(16474138); + let mock_server = testing::MockServer::run(); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "zks_getBlockDetails", + "params": [ + miniblock.0, + ], + }), + serde_json::json!({ + "jsonrpc": "2.0", + "result": { + "number": 16474138, + "l1BatchNumber": 270435, + "timestamp": 1697405098, + "l1TxCount": 0, + "l2TxCount": 1, + "rootHash": "0xd9e60f9a684fd7fc16e87ae923341a6e4af24f286e76612efdfc2d55f3f4d064", + "status": "sealed", + "commitTxHash": null, + "committedAt": null, + "proveTxHash": null, + "provenAt": null, + "executeTxHash": null, + "executedAt": null, + "l1GasPrice": 6156252068u64, + "l2FairGasPrice": 250000000u64, + "baseSystemContractsHashes": { + "bootloader": "0x0100089b8a2f2e6a20ba28f02c9e0ed0c13d702932364561a0ea61621f65f0a8", + "default_aa": "0x0100067d16a5485875b4249040bf421f53e869337fe118ec747cf40a4c777e5f" + }, + "operatorAddress": "0xa9232040bf0e0aea2578a5b2243f2916dbfc0a69", + "protocolVersion": "Version15" + }, + "id": 0 + }), + ); + + let fork_source = HttpForkSource::new(mock_server.url(), CacheConfig::Memory); + let block_details = fork_source + .get_block_details(miniblock) + .expect("failed fetching transaction") + .expect("no transaction"); + assert_eq!( + block_details.operator_address, + Address::from_str("0xa9232040bf0e0aea2578a5b2243f2916dbfc0a69").unwrap() + ); + } + + #[test] + fn test_get_bridge_contracts_is_cached() { + let input_bridge_addresses = BridgeAddresses { + l1_erc20_default_bridge: H160::repeat_byte(0x1), + l2_erc20_default_bridge: H160::repeat_byte(0x2), + l1_weth_bridge: Some(H160::repeat_byte(0x3)), + l2_weth_bridge: Some(H160::repeat_byte(0x4)), + }; + let mock_server = testing::MockServer::run(); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "zks_getBridgeContracts", + }), + serde_json::json!({ + "jsonrpc": "2.0", + "result": { + "l1Erc20DefaultBridge": format!("{:#x}", input_bridge_addresses.l1_erc20_default_bridge), + "l2Erc20DefaultBridge": format!("{:#x}", input_bridge_addresses.l2_erc20_default_bridge), + "l1WethBridge": format!("{:#x}", input_bridge_addresses.l1_weth_bridge.clone().unwrap()), + "l2WethBridge": format!("{:#x}", input_bridge_addresses.l2_weth_bridge.clone().unwrap()) + }, + "id": 0 + }), + ); + + let fork_source = HttpForkSource::new(mock_server.url(), CacheConfig::Memory); + + let actual_bridge_addresses = fork_source + .get_bridge_contracts() + .expect("failed fetching bridge addresses"); + testing::assert_bridge_addresses_eq(&input_bridge_addresses, &actual_bridge_addresses); + + let actual_bridge_addresses = fork_source + .get_bridge_contracts() + .expect("failed fetching bridge addresses"); + testing::assert_bridge_addresses_eq(&input_bridge_addresses, &actual_bridge_addresses); + } } diff --git a/src/lib.rs b/src/lib.rs index 9f46bde9..36d7e081 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,6 +51,7 @@ pub mod fork; pub mod formatter; pub mod http_fork_source; pub mod node; +pub mod observability; pub mod resolver; pub mod system_contracts; pub mod utils; diff --git a/src/logging_middleware.rs b/src/logging_middleware.rs index 41255a25..1efde748 100644 --- a/src/logging_middleware.rs +++ b/src/logging_middleware.rs @@ -5,7 +5,7 @@ use itertools::Itertools; use jsonrpc_core::{ middleware, Call, FutureResponse, Metadata, Middleware, Params, Request, Response, }; -use log::LevelFilter; +use tracing_subscriber::filter::LevelFilter; #[derive(Clone, Debug, Default)] pub struct Meta(); @@ -35,7 +35,7 @@ impl Middleware for LoggingMiddleware { { if let Request::Single(Call::MethodCall(method_call)) = &request { match self.log_level_filter { - LevelFilter::Trace => { + LevelFilter::TRACE => { let full_params = match &method_call.params { Params::Array(values) => { if values.is_empty() { @@ -47,7 +47,7 @@ impl Middleware for LoggingMiddleware { _ => String::default(), }; - log::trace!("{} was called {}", method_call.method.cyan(), full_params); + tracing::trace!("{} was called {}", method_call.method.cyan(), full_params); } _ => { // Generate truncated params for requests with massive payloads @@ -76,7 +76,7 @@ impl Middleware for LoggingMiddleware { _ => String::default(), }; - log::debug!( + tracing::debug!( "{} was called {}", method_call.method.cyan(), truncated_params @@ -86,7 +86,7 @@ impl Middleware for LoggingMiddleware { }; Either::Left(Box::pin(next(request, meta).map(move |res| { - log::trace!("API response => {:?}", res); + tracing::trace!("API response => {:?}", res); res }))) } diff --git a/src/main.rs b/src/main.rs index 98418579..0bd0b914 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,21 +1,23 @@ use crate::cache::CacheConfig; use crate::hardhat::{HardhatNamespaceImpl, HardhatNamespaceT}; -use crate::node::{ShowGasDetails, ShowStorageLogs, ShowVMDetails}; +use crate::node::{InMemoryNodeConfig, ShowGasDetails, ShowStorageLogs, ShowVMDetails}; +use crate::observability::Observability; use clap::{Parser, Subcommand, ValueEnum}; use configuration_api::ConfigurationApiNamespaceT; +use debug::DebugNamespaceImpl; use evm::{EvmNamespaceImpl, EvmNamespaceT}; use fork::{ForkDetails, ForkSource}; use logging_middleware::LoggingMiddleware; use node::ShowCalls; -use simplelog::{ - ColorChoice, CombinedLogger, ConfigBuilder, LevelFilter, TermLogger, TerminalMode, WriteLogger, -}; +use observability::LogLevel; +use tracing_subscriber::filter::LevelFilter; use zks::ZkMockNamespaceImpl; mod bootloader_debug; mod cache; mod configuration_api; mod console_log; +mod debug; mod deps; mod eth_test; mod evm; @@ -26,6 +28,7 @@ mod hardhat; mod http_fork_source; mod logging_middleware; mod node; +pub mod observability; mod resolver; mod system_contracts; mod testing; @@ -35,16 +38,13 @@ mod zks; use node::InMemoryNode; use zksync_core::api_server::web3::namespaces::NetNamespace; +use std::fs::File; use std::{ env, - fs::File, net::{IpAddr, Ipv4Addr, SocketAddr}, str::FromStr, }; -use tracing::Level; -use tracing_subscriber::{EnvFilter, FmtSubscriber}; - use futures::{ channel::oneshot, future::{self}, @@ -56,7 +56,7 @@ use zksync_basic_types::{L2ChainId, H160, H256}; use crate::eth_test::EthTestNodeNamespaceT; use crate::{configuration_api::ConfigurationApiNamespace, node::TEST_NODE_NETWORK_ID}; use zksync_core::api_server::web3::backend_jsonrpc::namespaces::{ - eth::EthNamespaceT, net::NetNamespaceT, zks::ZksNamespaceT, + debug::DebugNamespaceT, eth::EthNamespaceT, net::NetNamespaceT, zks::ZksNamespaceT, }; /// List of wallets (address, private key) that we seed with tokens at start. @@ -115,6 +115,7 @@ async fn build_json_http< evm: EvmNamespaceImpl, zks: ZkMockNamespaceImpl, hardhat: HardhatNamespaceImpl, + debug: DebugNamespaceImpl, ) -> tokio::task::JoinHandle<()> { let (sender, recv) = oneshot::channel::<()>(); @@ -127,6 +128,7 @@ async fn build_json_http< io.extend_with(evm.to_delegate()); io.extend_with(zks.to_delegate()); io.extend_with(hardhat.to_delegate()); + io.extend_with(debug.to_delegate()); io }; @@ -150,28 +152,6 @@ async fn build_json_http< tokio::spawn(recv.map(drop)) } -/// Log filter level for the node. -#[derive(Debug, Clone, ValueEnum)] -enum LogLevel { - Trace, - Debug, - Info, - Warn, - Error, -} - -impl From for LevelFilter { - fn from(value: LogLevel) -> Self { - match value { - LogLevel::Trace => LevelFilter::Trace, - LogLevel::Debug => LevelFilter::Debug, - LogLevel::Info => LevelFilter::Info, - LogLevel::Warn => LevelFilter::Warn, - LogLevel::Error => LevelFilter::Error, - } - } -} - /// Cache type config for the node. #[derive(ValueEnum, Debug, Clone)] enum CacheType { @@ -180,6 +160,14 @@ enum CacheType { Disk, } +/// System contract options. +#[derive(ValueEnum, Debug, Clone)] +enum DevSystemContracts { + BuiltIn, + BuiltInNoVerify, + Local, +} + #[derive(Debug, Parser)] #[command(author = "Matter Labs", version, about = "Test Node", long_about = None)] struct Cli { @@ -207,9 +195,10 @@ struct Cli { /// It will make debug log more readable, but will decrease the performance. resolve_hashes: bool, - #[arg(long)] - /// If true, will load the locally compiled system contracts (useful when doing changes to system contracts or bootloader) - dev_use_local_contracts: bool, + /// Specifies the option for the system contracts (use compiled built-in with or without signature verification, or load locally). + /// Default: built-in + #[arg(long, default_value = "built-in")] + dev_system_contracts: DevSystemContracts, /// Log filter level - default: info #[arg(long, default_value = "info")] @@ -275,29 +264,16 @@ struct ReplayArgs { #[tokio::main] async fn main() -> anyhow::Result<()> { let opt = Cli::parse(); - let log_level_filter = LevelFilter::from(opt.log); - let log_config = ConfigBuilder::new() - .add_filter_allow_str("era_test_node") - .build(); - CombinedLogger::init(vec![ - TermLogger::new( - log_level_filter, - log_config.clone(), - TerminalMode::Mixed, - ColorChoice::Auto, - ), - WriteLogger::new( - log_level_filter, - log_config, - File::create(opt.log_file_path).unwrap(), - ), - ]) - .expect("failed instantiating logger"); - - if opt.dev_use_local_contracts { + let log_file = File::create(opt.log_file_path)?; + + // Initialize the tracing subscriber + let observability = + Observability::init(String::from("era_test_node"), log_level_filter, log_file)?; + + if matches!(opt.dev_system_contracts, DevSystemContracts::Local) { if let Some(path) = env::var_os("ZKSYNC_HOME") { - log::info!("+++++ Reading local contracts from {:?} +++++", path); + tracing::info!("+++++ Reading local contracts from {:?} +++++", path); } } let cache_config = match opt.cache { @@ -309,15 +285,6 @@ async fn main() -> anyhow::Result<()> { }, }; - let filter = EnvFilter::from_default_env(); - let subscriber = FmtSubscriber::builder() - .with_max_level(Level::TRACE) - .with_env_filter(filter) - .finish(); - - // Initialize the subscriber - tracing::subscriber::set_global_default(subscriber).expect("failed to set tracing subscriber"); - let fork_details = match &opt.command { Command::Run => None, Command::Fork(fork) => { @@ -339,42 +306,46 @@ async fn main() -> anyhow::Result<()> { } else { vec![] }; - let system_contracts_options = if opt.dev_use_local_contracts { - system_contracts::Options::Local - } else { - system_contracts::Options::BuiltIn + let system_contracts_options = match opt.dev_system_contracts { + DevSystemContracts::BuiltIn => system_contracts::Options::BuiltIn, + DevSystemContracts::BuiltInNoVerify => system_contracts::Options::BuiltInWithoutSecurity, + DevSystemContracts::Local => system_contracts::Options::Local, }; let node = InMemoryNode::new( fork_details, - opt.show_calls, - opt.show_storage_logs, - opt.show_vm_details, - opt.show_gas_details, - opt.resolve_hashes, - &system_contracts_options, + Some(observability), + InMemoryNodeConfig { + show_calls: opt.show_calls, + show_storage_logs: opt.show_storage_logs, + show_vm_details: opt.show_vm_details, + show_gas_details: opt.show_gas_details, + resolve_hashes: opt.resolve_hashes, + system_contracts_options, + }, ); if !transactions_to_replay.is_empty() { let _ = node.apply_txs(transactions_to_replay); } - log::info!("Rich Accounts"); - log::info!("============="); + tracing::info!("Rich Accounts"); + tracing::info!("============="); for (index, wallet) in RICH_WALLETS.iter().enumerate() { let address = wallet.0; let private_key = wallet.1; node.set_rich_account(H160::from_str(address).unwrap()); - log::info!("Account #{}: {} (1_000_000_000_000 ETH)", index, address); - log::info!("Private Key: {}", private_key); - log::info!(""); + tracing::info!("Account #{}: {} (1_000_000_000_000 ETH)", index, address); + tracing::info!("Private Key: {}", private_key); + tracing::info!(""); } - let net = NetNamespace::new(L2ChainId(TEST_NODE_NETWORK_ID)); + let net = NetNamespace::new(L2ChainId::from(TEST_NODE_NETWORK_ID)); let config_api = ConfigurationApiNamespace::new(node.get_inner()); let evm = EvmNamespaceImpl::new(node.get_inner()); let zks = ZkMockNamespaceImpl::new(node.get_inner()); let hardhat = HardhatNamespaceImpl::new(node.get_inner()); + let debug = DebugNamespaceImpl::new(node.get_inner()); let threads = build_json_http( SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), opt.port), @@ -385,12 +356,13 @@ async fn main() -> anyhow::Result<()> { evm, zks, hardhat, + debug, ) .await; - log::info!("========================================"); - log::info!(" Node is ready at 127.0.0.1:{}", opt.port); - log::info!("========================================"); + tracing::info!("========================================"); + tracing::info!(" Node is ready at 127.0.0.1:{}", opt.port); + tracing::info!("========================================"); future::select_all(vec![threads]).await.0.unwrap(); diff --git a/src/node.rs b/src/node.rs index edbb78aa..fd1bb449 100644 --- a/src/node.rs +++ b/src/node.rs @@ -2,18 +2,22 @@ use crate::{ bootloader_debug::{BootloaderDebug, BootloaderDebugTracer}, console_log::ConsoleLogHandler, + deps::InMemoryStorage, filters::{EthFilters, FilterType, LogFilter}, fork::{ForkDetails, ForkSource, ForkStorage}, formatter, + observability::Observability, system_contracts::{self, SystemContracts}, utils::{ - self, adjust_l1_gas_price_for_tx, bytecode_to_factory_dep, to_human_size, IntoBoxedFuture, + self, adjust_l1_gas_price_for_tx, bytecode_to_factory_dep, create_debug_output, + not_implemented, to_human_size, IntoBoxedFuture, }, }; use clap::Parser; use colored::Colorize; use core::fmt::Display; use futures::FutureExt; +use indexmap::IndexMap; use itertools::Itertools; use jsonrpc_core::BoxFuture; use once_cell::sync::OnceCell; @@ -39,15 +43,17 @@ use vm::{ }; use zksync_basic_types::{ web3::{self, signing::keccak256}, - AccountTreeId, Address, Bytes, L1BatchNumber, H160, H256, U256, U64, + AccountTreeId, Address, Bytes, L1BatchNumber, MiniblockNumber, H160, H256, U256, U64, }; use zksync_contracts::BaseSystemContracts; use zksync_core::api_server::web3::backend_jsonrpc::{ error::into_jsrpc_error, namespaces::eth::EthNamespaceT, }; use zksync_state::{ReadStorage, StoragePtr, StorageView, WriteStorage}; +use zksync_types::vm_trace::Call; use zksync_types::{ - api::{Block, Log, TransactionReceipt, TransactionVariant}, + api::{Block, DebugCall, Log, TransactionReceipt, TransactionVariant}, + block::legacy_miniblock_hash, fee::Fee, get_code_key, get_nonce_key, l2::L2Tx, @@ -56,8 +62,9 @@ use zksync_types::{ decompose_full_nonce, nonces_to_full_nonce, storage_key_for_eth_balance, storage_key_for_standard_token_balance, }, - PackedEthSignature, StorageKey, StorageLogQueryType, Transaction, ACCOUNT_CODE_STORAGE_ADDRESS, - EIP_712_TX_TYPE, L2_ETH_TOKEN_ADDRESS, MAX_GAS_PER_PUBDATA_BYTE, MAX_L2_TX_GAS_LIMIT, + PackedEthSignature, StorageKey, StorageLogQueryType, StorageValue, Transaction, + ACCOUNT_CODE_STORAGE_ADDRESS, EIP_712_TX_TYPE, L2_ETH_TOKEN_ADDRESS, MAX_GAS_PER_PUBDATA_BYTE, + MAX_L2_TX_GAS_LIMIT, }; use zksync_utils::{ bytecode::{compress_bytecode, hash_bytecode}, @@ -73,7 +80,7 @@ pub const MAX_TX_SIZE: usize = 1_000_000; /// Timestamp of the first block (if not running in fork mode). pub const NON_FORK_FIRST_BLOCK_TIMESTAMP: u64 = 1_000; /// Network ID we use for the test node. -pub const TEST_NODE_NETWORK_ID: u16 = 260; +pub const TEST_NODE_NETWORK_ID: u32 = 260; /// L1 Gas Price. pub const L1_GAS_PRICE: u64 = 50_000_000_000; /// L2 Gas Price (0.25 gwei). @@ -86,6 +93,10 @@ pub const ESTIMATE_GAS_PUBLISH_BYTE_OVERHEAD: u32 = 100; pub const ESTIMATE_GAS_ACCEPTABLE_OVERESTIMATION: u32 = 1_000; /// The factor by which to scale the gasLimit. pub const ESTIMATE_GAS_SCALE_FACTOR: f32 = 1.3; +/// The maximum number of previous blocks to store the state for. +pub const MAX_PREVIOUS_STATES: u16 = 128; +/// The zks protocol version. +pub const PROTOCOL_VERSION: &str = "zks/1"; pub fn compute_hash(block_number: u64, tx_hash: H256) -> H256 { let digest = [&block_number.to_be_bytes()[..], tx_hash.as_bytes()].concat(); @@ -107,6 +118,7 @@ pub fn create_empty_block(block_number: u64, timestamp: u64, batch: u32) -> } /// Information about the executed transaction. +#[derive(Debug, Clone)] pub struct TxExecutionInfo { pub tx: L2Tx, // Batch number where transaction was executed. @@ -115,8 +127,9 @@ pub struct TxExecutionInfo { pub result: VmExecutionResultAndLogs, } -#[derive(Debug, clap::Parser, Clone, clap::ValueEnum, PartialEq, Eq)] +#[derive(Debug, Default, clap::Parser, Clone, clap::ValueEnum, PartialEq, Eq)] pub enum ShowCalls { + #[default] None, User, System, @@ -146,8 +159,9 @@ impl Display for ShowCalls { } } -#[derive(Debug, Parser, Clone, clap::ValueEnum, PartialEq, Eq)] +#[derive(Debug, Default, Parser, Clone, clap::ValueEnum, PartialEq, Eq)] pub enum ShowStorageLogs { + #[default] None, Read, Write, @@ -177,8 +191,9 @@ impl Display for ShowStorageLogs { } } -#[derive(Debug, Parser, Clone, clap::ValueEnum, PartialEq, Eq)] +#[derive(Debug, Default, Parser, Clone, clap::ValueEnum, PartialEq, Eq)] pub enum ShowVMDetails { + #[default] None, All, } @@ -204,8 +219,9 @@ impl Display for ShowVMDetails { } } -#[derive(Debug, Parser, Clone, clap::ValueEnum, PartialEq, Eq)] +#[derive(Debug, Default, Parser, Clone, clap::ValueEnum, PartialEq, Eq)] pub enum ShowGasDetails { + #[default] None, All, } @@ -231,13 +247,32 @@ impl Display for ShowGasDetails { } } +#[derive(Debug, Clone)] pub struct TransactionResult { - info: TxExecutionInfo, - receipt: TransactionReceipt, + pub info: TxExecutionInfo, + pub receipt: TransactionReceipt, + pub debug: DebugCall, +} + +impl TransactionResult { + /// Returns the debug information for the transaction. + /// If `only_top` is true - will only return the top level call. + pub fn debug_info(&self, only_top: bool) -> DebugCall { + let calls = if only_top { + vec![] + } else { + self.debug.calls.clone() + }; + DebugCall { + calls, + ..self.debug.clone() + } + } } /// Helper struct for InMemoryNode. /// S - is the Source of the Fork. +#[derive(Clone)] pub struct InMemoryNodeInner { /// The latest timestamp that was already generated. /// Next block will be current_timestamp + 1 @@ -248,6 +283,8 @@ pub struct InMemoryNodeInner { /// The latest miniblock number that was already generated. /// Next transaction will go to the block current_miniblock + 1 pub current_miniblock: u64, + /// The latest miniblock hash. + pub current_miniblock_hash: H256, pub l1_gas_price: u64, // Map from transaction to details about the exeuction pub tx_results: HashMap, @@ -273,11 +310,16 @@ pub struct InMemoryNodeInner { pub system_contracts: SystemContracts, pub impersonated_accounts: HashSet
, pub rich_accounts: HashSet, + /// Keeps track of historical states indexed via block hash. Limited to [MAX_PREVIOUS_STATES]. + pub previous_states: IndexMap>, + /// An optional handle to the observability stack + pub observability: Option, } type L2TxResult = ( HashMap, VmExecutionResultAndLogs, + Vec, Block, HashMap>, BlockContext, @@ -288,12 +330,13 @@ impl InMemoryNodeInner { &self, storage: StoragePtr, ) -> (L1BatchEnv, BlockContext) { - // TODO: is this hack fine? - let last_l2_block = load_last_l2_block(storage).unwrap_or_else(|| vm::L2Block { - number: 0, - timestamp: 0, - hash: zksync_types::block::legacy_miniblock_hash(zksync_types::MiniblockNumber(0)), - }); + let last_l2_block_hash = if let Some(last_l2_block) = load_last_l2_block(storage) { + last_l2_block.hash + } else { + // This is the scenario of either the first L2 block ever or + // the first block after the upgrade for support of L2 blocks. + legacy_miniblock_hash(MiniblockNumber(self.current_miniblock as u32)) + }; let block_ctx = BlockContext::from_current( self.current_batch, self.current_miniblock, @@ -314,7 +357,7 @@ impl InMemoryNodeInner { // So the next one should be one higher. number: block_ctx.miniblock as u32, timestamp: block_ctx.timestamp, - prev_block_hash: last_l2_block.hash, + prev_block_hash: last_l2_block_hash, // This is only used during zksyncEra block timestamp/number transition. // In case of starting a new network, it doesn't matter. // In theory , when forking mainnet, we should match this value @@ -453,9 +496,18 @@ impl InMemoryNodeInner { // We are using binary search to find the minimal values of gas_limit under which the transaction succeeds let mut lower_bound = 0; let mut upper_bound = MAX_L2_TX_GAS_LIMIT as u32; + let mut attempt_count = 1; + tracing::trace!("Starting gas estimation loop"); while lower_bound + ESTIMATE_GAS_ACCEPTABLE_OVERESTIMATION < upper_bound { let mid = (lower_bound + upper_bound) / 2; + tracing::trace!( + "Attempt {} (lower_bound: {}, upper_bound: {}, mid: {})", + attempt_count, + lower_bound, + upper_bound, + mid + ); let try_gas_limit = gas_for_bytecodes_pubdata + mid; let estimate_gas_result = InMemoryNodeInner::estimate_gas_step( @@ -469,12 +521,19 @@ impl InMemoryNodeInner { ); if estimate_gas_result.result.is_failed() { + tracing::trace!("Attempt {} FAILED", attempt_count); lower_bound = mid + 1; } else { + tracing::trace!("Attempt {} SUCCEEDED", attempt_count); upper_bound = mid; } + attempt_count += 1; } + tracing::trace!("Gas Estimation Values:"); + tracing::trace!(" Final upper_bound: {}", upper_bound); + tracing::trace!(" ESTIMATE_GAS_SCALE_FACTOR: {}", ESTIMATE_GAS_SCALE_FACTOR); + tracing::trace!(" MAX_L2_TX_GAS_LIMIT: {}", MAX_L2_TX_GAS_LIMIT); let tx_body_gas_limit = cmp::min( MAX_L2_TX_GAS_LIMIT as u32, (upper_bound as f32 * ESTIMATE_GAS_SCALE_FACTOR) as u32, @@ -486,8 +545,8 @@ impl InMemoryNodeInner { gas_per_pubdata_byte, suggested_gas_limit, l1_gas_price, - batch_env.clone(), - system_env.clone(), + batch_env, + system_env, &self.fork_storage, ); @@ -501,8 +560,8 @@ impl InMemoryNodeInner { match estimate_gas_result.result { ExecutionResult::Revert { output } => { - log::info!("{}", format!("Unable to estimate gas for the request with our suggested gas limit of {}. The transaction is most likely unexecutable. Breakdown of estimation:", suggested_gas_limit + overhead).red()); - log::info!( + tracing::info!("{}", format!("Unable to estimate gas for the request with our suggested gas limit of {}. The transaction is most likely unexecutable. Breakdown of estimation:", suggested_gas_limit + overhead).red()); + tracing::info!( "{}", format!( "\tEstimated transaction body gas cost: {}", @@ -510,11 +569,11 @@ impl InMemoryNodeInner { ) .red() ); - log::info!( + tracing::info!( "{}", format!("\tGas for pubdata: {}", gas_for_bytecodes_pubdata).red() ); - log::info!("{}", format!("\tOverhead: {}", overhead).red()); + tracing::info!("{}", format!("\tOverhead: {}", overhead).red()); let message = output.to_string(); let pretty_message = format!( "execution reverted{}{}", @@ -522,15 +581,15 @@ impl InMemoryNodeInner { message ); let data = output.encoded_data(); - log::info!("{}", pretty_message.on_red()); + tracing::info!("{}", pretty_message.on_red()); Err(into_jsrpc_error(Web3Error::SubmitTransactionError( pretty_message, data, ))) } ExecutionResult::Halt { reason } => { - log::info!("{}", format!("Unable to estimate gas for the request with our suggested gas limit of {}. The transaction is most likely unexecutable. Breakdown of estimation:", suggested_gas_limit + overhead).red()); - log::info!( + tracing::info!("{}", format!("Unable to estimate gas for the request with our suggested gas limit of {}. The transaction is most likely unexecutable. Breakdown of estimation:", suggested_gas_limit + overhead).red()); + tracing::info!( "{}", format!( "\tEstimated transaction body gas cost: {}", @@ -538,11 +597,11 @@ impl InMemoryNodeInner { ) .red() ); - log::info!( + tracing::info!( "{}", format!("\tGas for pubdata: {}", gas_for_bytecodes_pubdata).red() ); - log::info!("{}", format!("\tOverhead: {}", overhead).red()); + tracing::info!("{}", format!("\tOverhead: {}", overhead).red()); let message = reason.to_string(); let pretty_message = format!( "execution reverted{}{}", @@ -550,7 +609,7 @@ impl InMemoryNodeInner { message ); - log::info!("{}", pretty_message.on_red()); + tracing::info!("{}", pretty_message.on_red()); Err(into_jsrpc_error(Web3Error::SubmitTransactionError( pretty_message, vec![], @@ -562,8 +621,8 @@ impl InMemoryNodeInner { { (value, false) => value, (_, true) => { - log::info!("{}", "Overflow when calculating gas estimation. We've exceeded the block gas limit by summing the following values:".red()); - log::info!( + tracing::info!("{}", "Overflow when calculating gas estimation. We've exceeded the block gas limit by summing the following values:".red()); + tracing::info!( "{}", format!( "\tEstimated transaction body gas cost: {}", @@ -571,11 +630,11 @@ impl InMemoryNodeInner { ) .red() ); - log::info!( + tracing::info!( "{}", format!("\tGas for pubdata: {}", gas_for_bytecodes_pubdata).red() ); - log::info!("{}", format!("\tOverhead: {}", overhead).red()); + tracing::info!("{}", format!("\tOverhead: {}", overhead).red()); return Err(into_jsrpc_error(Web3Error::SubmitTransactionError( "exceeds block gas limit".into(), Default::default(), @@ -583,6 +642,11 @@ impl InMemoryNodeInner { } }; + tracing::trace!("Gas Estimation Results"); + tracing::trace!(" tx_body_gas_limit: {}", tx_body_gas_limit); + tracing::trace!(" gas_for_bytecodes_pubdata: {}", gas_for_bytecodes_pubdata); + tracing::trace!(" overhead: {}", overhead); + tracing::trace!(" full_gas_limit: {}", full_gas_limit); let fee = Fee { max_fee_per_gas: base_fee.into(), max_priority_fee_per_gas: 0u32.into(), @@ -662,18 +726,118 @@ impl InMemoryNodeInner { pub fn stop_impersonating_account(&mut self, address: Address) -> bool { self.impersonated_accounts.remove(&address) } + + /// Archives the current state for later queries. + pub fn archive_state(&mut self) -> Result<(), String> { + if self.previous_states.len() > MAX_PREVIOUS_STATES as usize { + if let Some(entry) = self.previous_states.shift_remove_index(0) { + tracing::debug!("removing archived state for previous block {:#x}", entry.0); + } + } + tracing::debug!( + "archiving state for {:#x} #{}", + self.current_miniblock_hash, + self.current_miniblock + ); + self.previous_states.insert( + self.current_miniblock_hash, + self.fork_storage + .inner + .read() + .map_err(|err| err.to_string())? + .raw_storage + .state + .clone(), + ); + + Ok(()) + } + + /// Creates a [Snapshot] of the current state of the node. + pub fn snapshot(&self) -> Result { + let storage = self + .fork_storage + .inner + .read() + .map_err(|err| format!("failed acquiring read lock on storage: {:?}", err))?; + + Ok(Snapshot { + current_timestamp: self.current_timestamp, + current_batch: self.current_batch, + current_miniblock: self.current_miniblock, + current_miniblock_hash: self.current_miniblock_hash, + l1_gas_price: self.l1_gas_price, + tx_results: self.tx_results.clone(), + blocks: self.blocks.clone(), + block_hashes: self.block_hashes.clone(), + filters: self.filters.clone(), + impersonated_accounts: self.impersonated_accounts.clone(), + rich_accounts: self.rich_accounts.clone(), + previous_states: self.previous_states.clone(), + raw_storage: storage.raw_storage.clone(), + value_read_cache: storage.value_read_cache.clone(), + factory_dep_cache: storage.factory_dep_cache.clone(), + }) + } + + /// Restores a previously created [Snapshot] of the node. + pub fn restore_snapshot(&mut self, snapshot: Snapshot) -> Result<(), String> { + let mut storage = self + .fork_storage + .inner + .write() + .map_err(|err| format!("failed acquiring write lock on storage: {:?}", err))?; + + self.current_timestamp = snapshot.current_timestamp; + self.current_batch = snapshot.current_batch; + self.current_miniblock = snapshot.current_miniblock; + self.current_miniblock_hash = snapshot.current_miniblock_hash; + self.l1_gas_price = snapshot.l1_gas_price; + self.tx_results = snapshot.tx_results; + self.blocks = snapshot.blocks; + self.block_hashes = snapshot.block_hashes; + self.filters = snapshot.filters; + self.impersonated_accounts = snapshot.impersonated_accounts; + self.rich_accounts = snapshot.rich_accounts; + self.previous_states = snapshot.previous_states; + storage.raw_storage = snapshot.raw_storage; + storage.value_read_cache = snapshot.value_read_cache; + storage.factory_dep_cache = snapshot.factory_dep_cache; + + Ok(()) + } +} + +/// Creates a restorable snapshot for the [InMemoryNodeInner]. The snapshot contains all the necessary +/// data required to restore the [InMemoryNodeInner] state to a previous point in time. +#[derive(Debug, Clone)] +pub struct Snapshot { + pub(crate) current_timestamp: u64, + pub(crate) current_batch: u32, + pub(crate) current_miniblock: u64, + pub(crate) current_miniblock_hash: H256, + pub(crate) l1_gas_price: u64, + pub(crate) tx_results: HashMap, + pub(crate) blocks: HashMap>, + pub(crate) block_hashes: HashMap, + pub(crate) filters: EthFilters, + pub(crate) impersonated_accounts: HashSet
, + pub(crate) rich_accounts: HashSet, + pub(crate) previous_states: IndexMap>, + pub(crate) raw_storage: InMemoryStorage, + pub(crate) value_read_cache: HashMap, + pub(crate) factory_dep_cache: HashMap>>, } -fn not_implemented( - method_name: &str, -) -> jsonrpc_core::BoxFuture> { - log::warn!("Method {} is not implemented", method_name); - Err(jsonrpc_core::Error { - data: None, - code: jsonrpc_core::ErrorCode::MethodNotFound, - message: format!("Method {} is not implemented", method_name), - }) - .into_boxed_future() +/// Defines the configuration parameters for the [InMemoryNode]. +#[derive(Default, Debug, Clone)] +pub struct InMemoryNodeConfig { + pub show_calls: ShowCalls, + pub show_storage_logs: ShowStorageLogs, + pub show_vm_details: ShowVMDetails, + pub show_gas_details: ShowGasDetails, + pub resolve_hashes: bool, + pub system_contracts_options: system_contracts::Options, } /// In-memory node, that can be used for local & unit testing. @@ -705,27 +869,15 @@ fn contract_address_from_tx_result(execution_result: &VmExecutionResultAndLogs) impl Default for InMemoryNode { fn default() -> Self { - InMemoryNode::new( - None, - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, - ) + InMemoryNode::new(None, None, InMemoryNodeConfig::default()) } } impl InMemoryNode { pub fn new( fork: Option>, - show_calls: ShowCalls, - show_storage_logs: ShowStorageLogs, - show_vm_details: ShowVMDetails, - show_gas_details: ShowGasDetails, - resolve_hashes: bool, - system_contracts_options: &system_contracts::Options, + observability: Option, + config: InMemoryNodeConfig, ) -> Self { let inner = if let Some(f) = &fork { let mut block_hashes = HashMap::::new(); @@ -737,21 +889,24 @@ impl InMemoryNode { current_timestamp: f.block_timestamp, current_batch: f.l1_block.0, current_miniblock: f.l2_miniblock, + current_miniblock_hash: f.l2_miniblock_hash, l1_gas_price: f.l1_gas_price, tx_results: Default::default(), blocks, block_hashes, filters: Default::default(), - fork_storage: ForkStorage::new(fork, system_contracts_options), - show_calls, - show_storage_logs, - show_vm_details, - show_gas_details, - resolve_hashes, + fork_storage: ForkStorage::new(fork, &config.system_contracts_options), + show_calls: config.show_calls, + show_storage_logs: config.show_storage_logs, + show_vm_details: config.show_vm_details, + show_gas_details: config.show_gas_details, + resolve_hashes: config.resolve_hashes, console_log_handler: ConsoleLogHandler::default(), - system_contracts: SystemContracts::from_options(system_contracts_options), + system_contracts: SystemContracts::from_options(&config.system_contracts_options), impersonated_accounts: Default::default(), rich_accounts: HashSet::new(), + previous_states: Default::default(), + observability, } } else { let mut block_hashes = HashMap::::new(); @@ -766,21 +921,24 @@ impl InMemoryNode { current_timestamp: NON_FORK_FIRST_BLOCK_TIMESTAMP, current_batch: 0, current_miniblock: 0, + current_miniblock_hash: H256::zero(), l1_gas_price: L1_GAS_PRICE, tx_results: Default::default(), blocks, block_hashes, filters: Default::default(), - fork_storage: ForkStorage::new(fork, system_contracts_options), - show_calls, - show_storage_logs, - show_vm_details, - show_gas_details, - resolve_hashes, + fork_storage: ForkStorage::new(fork, &config.system_contracts_options), + show_calls: config.show_calls, + show_storage_logs: config.show_storage_logs, + show_vm_details: config.show_vm_details, + show_gas_details: config.show_gas_details, + resolve_hashes: config.resolve_hashes, console_log_handler: ConsoleLogHandler::default(), - system_contracts: SystemContracts::from_options(system_contracts_options), + system_contracts: SystemContracts::from_options(&config.system_contracts_options), impersonated_accounts: Default::default(), rich_accounts: HashSet::new(), + previous_states: Default::default(), + observability, } }; @@ -795,7 +953,7 @@ impl InMemoryNode { /// Applies multiple transactions - but still one per L1 batch. pub fn apply_txs(&self, txs: Vec) -> Result<(), String> { - log::info!("Running {:?} transactions (one per batch)", txs.len()); + tracing::info!("Running {:?} transactions (one per batch)", txs.len()); for tx in txs { self.run_l2_tx(tx, TxExecutionMode::VerifyExecute)?; @@ -811,7 +969,7 @@ impl InMemoryNode { let mut inner = match self.inner.write() { Ok(guard) => guard, Err(e) => { - log::info!("Failed to acquire write lock: {}", e); + tracing::info!("Failed to acquire write lock: {}", e); return; } }; @@ -829,7 +987,7 @@ impl InMemoryNode { } /// Runs L2 'eth call' method - that doesn't commit to a block. - fn run_l2_call(&self, l2_tx: L2Tx) -> Result { + fn run_l2_call(&self, mut l2_tx: L2Tx) -> Result { let execution_mode = TxExecutionMode::EthCall; let inner = self @@ -839,7 +997,7 @@ impl InMemoryNode { let storage = StorageView::new(&inner.fork_storage).to_rc_ptr(); - let bootloader_code = inner.system_contracts.contacts_for_l2_call(); + let bootloader_code = inner.system_contracts.contracts_for_l2_call(); // init vm @@ -848,7 +1006,6 @@ impl InMemoryNode { let mut vm = Vm::new(batch_env, system_env, storage, HistoryDisabled); - let mut l2_tx = l2_tx.clone(); // We must inject *some* signature (otherwise bootloader code fails to generate hash). if l2_tx.common_data.signature.is_empty() { l2_tx.common_data.signature = PackedEthSignature::default().serialize_packed().into(); @@ -874,22 +1031,24 @@ impl InMemoryNode { match &tx_result.result { ExecutionResult::Success { output } => { - log::info!("Call: {}", "SUCCESS".green()); + tracing::info!("Call: {}", "SUCCESS".green()); let output_bytes = zksync_basic_types::Bytes::from(output.clone()); - log::info!("Output: {}", serde_json::to_string(&output_bytes).unwrap()); + tracing::info!("Output: {}", serde_json::to_string(&output_bytes).unwrap()); } ExecutionResult::Revert { output } => { - log::info!("Call: {}: {}", "FAILED".red(), output); + tracing::info!("Call: {}: {}", "FAILED".red(), output); + } + ExecutionResult::Halt { reason } => { + tracing::info!("Call: {} {}", "HALTED".red(), reason) } - ExecutionResult::Halt { reason } => log::info!("Call: {} {}", "HALTED".red(), reason), }; - log::info!("=== Console Logs: "); + tracing::info!("=== Console Logs: "); for call in &call_traces { - inner.console_log_handler.handle_call_recurive(call); + inner.console_log_handler.handle_call_recursive(call); } - log::info!("=== Call traces:"); + tracing::info!("=== Call traces:"); for call in &call_traces { formatter::print_call(call, 0, &inner.show_calls, inner.resolve_hashes); } @@ -903,151 +1062,157 @@ impl InMemoryNode { spent_on_pubdata: u32, ) -> eyre::Result<(), String> { if let Some(bootloader_result) = bootloader_debug_result { - let debug = bootloader_result.clone()?; + let bootloader_debug = bootloader_result.clone()?; - log::info!("┌─────────────────────────┐"); - log::info!("│ GAS DETAILS │"); - log::info!("└─────────────────────────┘"); + tracing::info!("┌─────────────────────────┐"); + tracing::info!("│ GAS DETAILS │"); + tracing::info!("└─────────────────────────┘"); // Total amount of gas (should match tx.gas_limit). - let total_gas_limit = debug + let total_gas_limit = bootloader_debug .total_gas_limit_from_user - .saturating_sub(debug.reserved_gas); + .saturating_sub(bootloader_debug.reserved_gas); - let intrinsic_gas = total_gas_limit - debug.gas_limit_after_intrinsic; - let gas_for_validation = debug.gas_limit_after_intrinsic - debug.gas_after_validation; + let intrinsic_gas = total_gas_limit - bootloader_debug.gas_limit_after_intrinsic; + let gas_for_validation = + bootloader_debug.gas_limit_after_intrinsic - bootloader_debug.gas_after_validation; - let gas_spent_on_compute = - debug.gas_spent_on_execution - debug.gas_spent_on_bytecode_preparation; + let gas_spent_on_compute = bootloader_debug.gas_spent_on_execution + - bootloader_debug.gas_spent_on_bytecode_preparation; let gas_used = intrinsic_gas + gas_for_validation - + debug.gas_spent_on_bytecode_preparation + + bootloader_debug.gas_spent_on_bytecode_preparation + gas_spent_on_compute; - log::info!( + tracing::info!( "Gas - Limit: {} | Used: {} | Refunded: {}", to_human_size(total_gas_limit), to_human_size(gas_used), - to_human_size(debug.refund_by_operator) + to_human_size(bootloader_debug.refund_by_operator) ); - if debug.total_gas_limit_from_user != total_gas_limit { - log::info!( + if bootloader_debug.total_gas_limit_from_user != total_gas_limit { + tracing::info!( "{}", format!( " WARNING: user actually provided more gas {}, but system had a lower max limit.", - to_human_size(debug.total_gas_limit_from_user) + to_human_size(bootloader_debug.total_gas_limit_from_user) ) .yellow() ); } - if debug.refund_computed != debug.refund_by_operator { - log::info!( + if bootloader_debug.refund_computed != bootloader_debug.refund_by_operator { + tracing::info!( "{}", format!( " WARNING: Refund by VM: {}, but operator refunded more: {}", - to_human_size(debug.refund_computed), - to_human_size(debug.refund_by_operator) + to_human_size(bootloader_debug.refund_computed), + to_human_size(bootloader_debug.refund_by_operator) ) .yellow() ); } - if debug.refund_computed + gas_used != total_gas_limit { - log::info!( + if bootloader_debug.refund_computed + gas_used != total_gas_limit { + tracing::info!( "{}", format!( " WARNING: Gas totals don't match. {} != {} , delta: {}", - to_human_size(debug.refund_computed + gas_used), + to_human_size(bootloader_debug.refund_computed + gas_used), to_human_size(total_gas_limit), - to_human_size(total_gas_limit.abs_diff(debug.refund_computed + gas_used)) + to_human_size( + total_gas_limit.abs_diff(bootloader_debug.refund_computed + gas_used) + ) ) .yellow() ); } - let bytes_published = spent_on_pubdata / debug.gas_per_pubdata.as_u32(); + let bytes_published = spent_on_pubdata / bootloader_debug.gas_per_pubdata.as_u32(); - log::info!( + tracing::info!( "During execution published {} bytes to L1, @{} each - in total {} gas", to_human_size(bytes_published.into()), - to_human_size(debug.gas_per_pubdata), + to_human_size(bootloader_debug.gas_per_pubdata), to_human_size(spent_on_pubdata.into()) ); - log::info!("Out of {} gas used, we spent:", to_human_size(gas_used)); - log::info!( + tracing::info!("Out of {} gas used, we spent:", to_human_size(gas_used)); + tracing::info!( " {:>15} gas ({:>2}%) for transaction setup", to_human_size(intrinsic_gas), to_human_size(intrinsic_gas * 100 / gas_used) ); - log::info!( + tracing::info!( " {:>15} gas ({:>2}%) for bytecode preparation (decompression etc)", - to_human_size(debug.gas_spent_on_bytecode_preparation), - to_human_size(debug.gas_spent_on_bytecode_preparation * 100 / gas_used) + to_human_size(bootloader_debug.gas_spent_on_bytecode_preparation), + to_human_size(bootloader_debug.gas_spent_on_bytecode_preparation * 100 / gas_used) ); - log::info!( + tracing::info!( " {:>15} gas ({:>2}%) for account validation", to_human_size(gas_for_validation), to_human_size(gas_for_validation * 100 / gas_used) ); - log::info!( + tracing::info!( " {:>15} gas ({:>2}%) for computations (opcodes)", to_human_size(gas_spent_on_compute), to_human_size(gas_spent_on_compute * 100 / gas_used) ); - log::info!(""); - log::info!(""); - log::info!( + tracing::info!(""); + tracing::info!(""); + tracing::info!( "{}", "=== Transaction setup cost breakdown ===".to_owned().bold(), ); - log::info!("Total cost: {}", to_human_size(intrinsic_gas).bold()); - log::info!( + tracing::info!("Total cost: {}", to_human_size(intrinsic_gas).bold()); + tracing::info!( " {:>15} gas ({:>2}%) fixed cost", - to_human_size(debug.intrinsic_overhead), - to_human_size(debug.intrinsic_overhead * 100 / intrinsic_gas) + to_human_size(bootloader_debug.intrinsic_overhead), + to_human_size(bootloader_debug.intrinsic_overhead * 100 / intrinsic_gas) ); - log::info!( + tracing::info!( " {:>15} gas ({:>2}%) operator cost", - to_human_size(debug.operator_overhead), - to_human_size(debug.operator_overhead * 100 / intrinsic_gas) + to_human_size(bootloader_debug.operator_overhead), + to_human_size(bootloader_debug.operator_overhead * 100 / intrinsic_gas) ); - log::info!(""); - log::info!( + tracing::info!(""); + tracing::info!( " FYI: operator could have charged up to: {}, so you got {}% discount", - to_human_size(debug.required_overhead), + to_human_size(bootloader_debug.required_overhead), to_human_size( - (debug.required_overhead - debug.operator_overhead) * 100 - / debug.required_overhead + (bootloader_debug.required_overhead - bootloader_debug.operator_overhead) * 100 + / bootloader_debug.required_overhead ) ); let publish_block_l1_bytes = BLOCK_OVERHEAD_PUBDATA; - log::info!( + tracing::info!( "Publishing full block costs the operator up to: {}, where {} is due to {} bytes published to L1", - to_human_size(debug.total_overhead_for_block), - to_human_size(debug.gas_per_pubdata * publish_block_l1_bytes), + to_human_size(bootloader_debug.total_overhead_for_block), + to_human_size(bootloader_debug.gas_per_pubdata * publish_block_l1_bytes), to_human_size(publish_block_l1_bytes.into()) ); - log::info!("Your transaction has contributed to filling up the block in the following way (we take the max contribution as the cost):"); - log::info!( + tracing::info!("Your transaction has contributed to filling up the block in the following way (we take the max contribution as the cost):"); + tracing::info!( " Circuits overhead:{:>15} ({}% of the full block: {})", - to_human_size(debug.overhead_for_circuits), - to_human_size(debug.overhead_for_circuits * 100 / debug.total_overhead_for_block), - to_human_size(debug.total_overhead_for_block) + to_human_size(bootloader_debug.overhead_for_circuits), + to_human_size( + bootloader_debug.overhead_for_circuits * 100 + / bootloader_debug.total_overhead_for_block + ), + to_human_size(bootloader_debug.total_overhead_for_block) ); - log::info!( + tracing::info!( " Length overhead: {:>15}", - to_human_size(debug.overhead_for_length) + to_human_size(bootloader_debug.overhead_for_length) ); - log::info!( + tracing::info!( " Slot overhead: {:>15}", - to_human_size(debug.overhead_for_slot) + to_human_size(bootloader_debug.overhead_for_slot) ); Ok(()) } else { @@ -1110,27 +1275,24 @@ impl InMemoryNode { let tx_result = vm.inspect(custom_tracers, vm::VmExecutionMode::OneTx); - let call_traces = Arc::try_unwrap(call_tracer_result) - .unwrap() - .take() - .unwrap_or_default(); + let call_traces = call_tracer_result.get().unwrap(); let spent_on_pubdata = tx_result.statistics.gas_used - tx_result.statistics.computational_gas_used; - log::info!("┌─────────────────────────┐"); - log::info!("│ TRANSACTION SUMMARY │"); - log::info!("└─────────────────────────┘"); + tracing::info!("┌─────────────────────────┐"); + tracing::info!("│ TRANSACTION SUMMARY │"); + tracing::info!("└─────────────────────────┘"); match &tx_result.result { - ExecutionResult::Success { .. } => log::info!("Transaction: {}", "SUCCESS".green()), - ExecutionResult::Revert { .. } => log::info!("Transaction: {}", "FAILED".red()), - ExecutionResult::Halt { .. } => log::info!("Transaction: {}", "HALTED".red()), + ExecutionResult::Success { .. } => tracing::info!("Transaction: {}", "SUCCESS".green()), + ExecutionResult::Revert { .. } => tracing::info!("Transaction: {}", "FAILED".red()), + ExecutionResult::Halt { .. } => tracing::info!("Transaction: {}", "HALTED".red()), } - log::info!("Initiator: {:?}", tx.initiator_account()); - log::info!("Payer: {:?}", tx.payer()); - log::info!( + tracing::info!("Initiator: {:?}", tx.initiator_account()); + tracing::info!("Payer: {:?}", tx.payer()); + tracing::info!( "Gas - Limit: {} | Used: {} | Refunded: {}", to_human_size(tx.gas_limit()), to_human_size(tx.gas_limit() - tx_result.refunds.gas_refunded), @@ -1138,7 +1300,7 @@ impl InMemoryNode { ); match inner.show_gas_details { - ShowGasDetails::None => log::info!( + ShowGasDetails::None => tracing::info!( "Use --show-gas-details flag or call config_setShowGasDetails to display more info" ), ShowGasDetails::All => { @@ -1146,7 +1308,7 @@ impl InMemoryNode { .display_detailed_gas_info(bootloader_debug_result.get(), spent_on_pubdata) .is_err() { - log::info!( + tracing::info!( "{}", "!!! FAILED TO GET DETAILED GAS INFO !!!".to_owned().red() ); @@ -1155,10 +1317,10 @@ impl InMemoryNode { } if inner.show_storage_logs != ShowStorageLogs::None { - log::info!(""); - log::info!("┌──────────────────┐"); - log::info!("│ STORAGE LOGS │"); - log::info!("└──────────────────┘"); + tracing::info!(""); + tracing::info!("┌──────────────────┐"); + tracing::info!("│ STORAGE LOGS │"); + tracing::info!("└──────────────────┘"); } for log_query in &tx_result.logs.storage_logs { @@ -1187,24 +1349,30 @@ impl InMemoryNode { formatter::print_vm_details(&tx_result); } - log::info!(""); - log::info!("==== Console logs: "); - for call in &call_traces { - inner.console_log_handler.handle_call_recurive(call); + tracing::info!(""); + tracing::info!("==== Console logs: "); + for call in call_traces { + inner.console_log_handler.handle_call_recursive(call); } - log::info!(""); - log::info!( + tracing::info!(""); + let call_traces_count = if !call_traces.is_empty() { + // All calls/sub-calls are stored within the first call trace + call_traces[0].calls.len() + } else { + 0 + }; + tracing::info!( "==== {} Use --show-calls flag or call config_setShowCalls to display more info.", - format!("{:?} call traces. ", call_traces.len()).bold() + format!("{:?} call traces. ", call_traces_count).bold() ); if inner.show_calls != ShowCalls::None { - for call in &call_traces { + for call in call_traces { formatter::print_call(call, 0, &inner.show_calls, inner.resolve_hashes); } } - log::info!(""); - log::info!( + tracing::info!(""); + tracing::info!( "==== {}", format!("{} events", tx_result.logs.events.len()).bold() ); @@ -1237,8 +1405,8 @@ impl InMemoryNode { ..Default::default() }; - log::info!(""); - log::info!(""); + tracing::info!(""); + tracing::info!(""); let bytecodes = vm .get_last_tx_compressed_bytecodes() @@ -1249,14 +1417,21 @@ impl InMemoryNode { vm.execute(vm::VmExecutionMode::Bootloader); let modified_keys = storage.borrow().modified_storage_keys().clone(); - Ok((modified_keys, tx_result, block, bytecodes, block_ctx)) + Ok(( + modified_keys, + tx_result, + call_traces.clone(), + block, + bytecodes, + block_ctx, + )) } /// Runs L2 transaction and commits it to a new block. fn run_l2_tx(&self, l2_tx: L2Tx, execution_mode: TxExecutionMode) -> Result<(), String> { let tx_hash = l2_tx.hash(); - log::info!(""); - log::info!("Executing {}", format!("{:?}", tx_hash).bold()); + tracing::info!(""); + tracing::info!("Executing {}", format!("{:?}", tx_hash).bold()); { let mut inner = self @@ -1266,7 +1441,7 @@ impl InMemoryNode { inner.filters.notify_new_pending_transaction(tx_hash); } - let (keys, result, block, bytecodes, block_ctx) = + let (keys, result, call_traces, block, bytecodes, block_ctx) = self.run_l2_tx_inner(l2_tx.clone(), execution_mode)?; if let ExecutionResult::Halt { reason } = result.result { @@ -1358,6 +1533,7 @@ impl InMemoryNode { effective_gas_price: Some(L2_GAS_PRICE.into()), ..Default::default() }; + let debug = create_debug_output(&l2_tx, &result, call_traces).expect("create debug output"); // OK to unwrap here as Halt is handled above inner.tx_results.insert( tx_hash, TransactionResult { @@ -1368,6 +1544,7 @@ impl InMemoryNode { result, }, receipt: tx_receipt, + debug, }, ); @@ -1378,51 +1555,55 @@ impl InMemoryNode { let empty_block_at_end_of_batch = create_empty_block(block_ctx.miniblock, block_ctx.timestamp, block_ctx.batch); - let new_batch = inner.current_batch.saturating_add(1); - let mut current_miniblock = inner.current_miniblock; - let mut current_timestamp = inner.current_timestamp; + inner.current_batch = inner.current_batch.saturating_add(1); for block in vec![block, empty_block_at_end_of_batch] { - current_miniblock = current_miniblock.saturating_add(1); - current_timestamp = current_timestamp.saturating_add(1); + // archive current state before we produce new batch/blocks + if let Err(err) = inner.archive_state() { + tracing::error!( + "failed archiving state for block {}: {}", + inner.current_miniblock, + err + ); + } + + inner.current_miniblock = inner.current_miniblock.saturating_add(1); + inner.current_timestamp = inner.current_timestamp.saturating_add(1); let actual_l1_batch_number = block .l1_batch_number .expect("block must have a l1_batch_number"); - if actual_l1_batch_number.as_u32() != new_batch { + if actual_l1_batch_number.as_u32() != inner.current_batch { panic!( "expected next block to have batch_number {}, got {}", - new_batch, + inner.current_batch, actual_l1_batch_number.as_u32() ); } - if block.number.as_u64() != current_miniblock { + if block.number.as_u64() != inner.current_miniblock { panic!( "expected next block to have miniblock {}, got {}", - current_miniblock, + inner.current_miniblock, block.number.as_u64() ); } - if block.timestamp.as_u64() != current_timestamp { + if block.timestamp.as_u64() != inner.current_timestamp { panic!( "expected next block to have timestamp {}, got {}", - current_timestamp, + inner.current_timestamp, block.timestamp.as_u64() ); } let block_hash = block.hash; + inner.current_miniblock_hash = block_hash; inner.block_hashes.insert(block.number.as_u64(), block.hash); inner.blocks.insert(block.hash, block); inner.filters.notify_new_block(block_hash); } - inner.current_batch = new_batch; - inner.current_miniblock = current_miniblock; - inner.current_timestamp = current_timestamp; - Ok(()) } } @@ -1468,7 +1649,7 @@ impl EthNamespaceT for /// Returns the chain ID of the node. fn chain_id(&self) -> jsonrpc_core::BoxFuture> { match self.inner.read() { - Ok(inner) => Ok(U64::from(inner.fork_storage.chain_id.0 as u64)).into_boxed_future(), + Ok(inner) => Ok(U64::from(inner.fork_storage.chain_id.as_u64())).into_boxed_future(), Err(_) => Err(into_jsrpc_error(Web3Error::InternalError)).into_boxed_future(), } } @@ -1506,7 +1687,7 @@ impl EthNamespaceT for message ); - log::info!("{}", pretty_message.on_red()); + tracing::info!("{}", pretty_message.on_red()); Err(into_jsrpc_error(Web3Error::SubmitTransactionError( pretty_message, output.encoded_data(), @@ -1521,7 +1702,7 @@ impl EthNamespaceT for message ); - log::info!("{}", pretty_message.on_red()); + tracing::info!("{}", pretty_message.on_red()); Err(into_jsrpc_error(Web3Error::SubmitTransactionError( pretty_message, vec![], @@ -1694,7 +1875,7 @@ impl EthNamespaceT for let code = guard .fork_storage - .load_factory_dep_internal(code_hash) + .load_factory_dep(code_hash) .unwrap_or_default(); Ok(Bytes::from(code)) @@ -1783,7 +1964,7 @@ impl EthNamespaceT for } }; - let (tx_req, hash) = match TransactionRequest::from_bytes(&tx_bytes.0, chain_id.0) { + let (tx_req, hash) = match TransactionRequest::from_bytes(&tx_bytes.0, chain_id) { Ok(result) => result, Err(e) => { return futures::future::err(into_jsrpc_error(Web3Error::SerializationError(e))) @@ -1956,7 +2137,7 @@ impl EthNamespaceT for max_priority_fee_per_gas: Some( info.tx.common_data.fee.max_priority_fee_per_gas, ), - chain_id: chain_id.into(), + chain_id, l1_batch_number: Some(U64::from(info.batch_number as u64)), l1_batch_tx_index: None, }) @@ -2044,11 +2225,11 @@ impl EthNamespaceT for /// /// If the from `fromBlock` or `toBlock` option are equal to "latest" the filter continually appends logs for newly mined blocks. /// Topics are order-dependent. A transaction with a log with topics [A, B] will be matched by the following topic filters: - /// * [] "anything" - /// * [A] "A in first position (and anything after)" - /// * [null, B] "anything in first position AND B in second position (and anything after)" - /// * [A, B] "A in first position AND B in second position (and anything after)" - /// * [[A, B], [A, B]] "(A OR B) in first position AND (A OR B) in second position (and anything after)" + /// * \[\] "anything" + /// * \[A\] "A in first position (and anything after)" + /// * \[null, B\] "anything in first position AND B in second position (and anything after)" + /// * \[A, B\] "A in first position AND B in second position (and anything after)" + /// * \[\[A, B\], \[A, B\]\] "(A OR B) in first position AND (A OR B) in second position (and anything after)" /// /// # Returns /// @@ -2379,33 +2560,241 @@ impl EthNamespaceT for }) } + /// Returns the value from a storage position at a given address. + /// + /// # Arguments + /// + /// * `address`: Address of the storage + /// * `idx`: Integer of the position in the storage + /// * `block`: The block storage to target + /// + /// # Returns + /// + /// A `BoxFuture` containing a `jsonrpc_core::Result` that resolves to a [H256] value in the storage. fn get_storage( &self, - _address: zksync_basic_types::Address, - _idx: U256, - _block: Option, + address: zksync_basic_types::Address, + idx: U256, + block: Option, ) -> jsonrpc_core::BoxFuture> { - not_implemented("get_storage") + let inner = Arc::clone(&self.inner); + + Box::pin(async move { + let mut writer = match inner.write() { + Ok(r) => r, + Err(_) => { + return Err(into_jsrpc_error(Web3Error::InternalError)); + } + }; + + let storage_key = StorageKey::new(AccountTreeId::new(address), u256_to_h256(idx)); + + let block_number = block + .map(|block| match block { + zksync_types::api::BlockIdVariant::BlockNumber(block_number) => { + Ok(utils::to_real_block_number( + block_number, + U64::from(writer.current_miniblock), + )) + } + zksync_types::api::BlockIdVariant::BlockNumberObject(o) => { + Ok(utils::to_real_block_number( + o.block_number, + U64::from(writer.current_miniblock), + )) + } + zksync_types::api::BlockIdVariant::BlockHashObject(o) => writer + .blocks + .get(&o.block_hash) + .map(|block| block.number) + .ok_or_else(|| { + tracing::error!( + "unable to map block number to hash #{:#x}", + o.block_hash + ); + into_jsrpc_error(Web3Error::InternalError) + }), + }) + .unwrap_or_else(|| Ok(U64::from(writer.current_miniblock)))?; + + if block_number.as_u64() == writer.current_miniblock { + Ok(H256(writer.fork_storage.read_value(&storage_key).0)) + } else if writer.block_hashes.contains_key(&block_number.as_u64()) { + let value = writer + .block_hashes + .get(&block_number.as_u64()) + .and_then(|block_hash| writer.previous_states.get(block_hash)) + .and_then(|state| state.get(&storage_key)) + .cloned() + .unwrap_or_default(); + + if value.is_zero() { + Ok(H256(writer.fork_storage.read_value(&storage_key).0)) + } else { + Ok(value) + } + } else { + writer + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + .and_then(|fork| fork.fork_source.get_storage_at(address, idx, block).ok()) + .ok_or_else(|| { + tracing::error!( + "unable to get storage at address {:?}, index {:?} for block {:?}", + address, + idx, + block + ); + into_jsrpc_error(Web3Error::InternalError) + }) + } + }) } + /// Returns information about a transaction by block hash and transaction index position. + /// + /// # Arguments + /// + /// * `block_hash`: Hash of a block + /// * `index`: Integer of the transaction index position + /// + /// # Returns + /// + /// A `BoxFuture` containing a `jsonrpc_core::Result` that maybe resolves to a [zksync_types::api::Transaction], if found. fn get_transaction_by_block_hash_and_index( &self, - _block_hash: zksync_basic_types::H256, - _index: zksync_basic_types::web3::types::Index, + block_hash: zksync_basic_types::H256, + index: zksync_basic_types::web3::types::Index, ) -> jsonrpc_core::BoxFuture>> { - not_implemented("get_transaction_by_block_hash_and_index") + let inner = Arc::clone(&self.inner); + + Box::pin(async move { + let reader = match inner.read() { + Ok(r) => r, + Err(_) => { + return Err(into_jsrpc_error(Web3Error::InternalError)); + } + }; + + let maybe_tx = reader + .blocks + .get(&block_hash) + .and_then(|block| block.transactions.get(index.as_usize())) + .and_then(|tx| match tx { + TransactionVariant::Full(tx) => Some(tx.clone()), + TransactionVariant::Hash(tx_hash) => reader + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + .and_then(|fork| { + fork.fork_source + .get_transaction_by_hash(*tx_hash) + .ok() + .flatten() + }), + }) + .or_else(|| { + reader + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + .and_then(|fork| { + fork.fork_source + .get_transaction_by_block_hash_and_index(block_hash, index) + .ok() + }) + .flatten() + }); + + Ok(maybe_tx) + }) } + /// Returns information about a transaction by block number and transaction index position. + /// + /// # Arguments + /// + /// * `block_number`: A block number, or the string "earliest", "latest" or "pending". + /// * `index`: Integer of the transaction index position + /// + /// # Returns + /// + /// A `BoxFuture` containing a `jsonrpc_core::Result` that maybe resolves to a [zksync_types::api::Transaction], if found. fn get_transaction_by_block_number_and_index( &self, - _block_number: zksync_types::api::BlockNumber, - _index: zksync_basic_types::web3::types::Index, + block_number: zksync_types::api::BlockNumber, + index: zksync_basic_types::web3::types::Index, ) -> jsonrpc_core::BoxFuture>> { - not_implemented("get_transaction_by_block_number_and_index") + let inner = Arc::clone(&self.inner); + + Box::pin(async move { + let reader = match inner.read() { + Ok(r) => r, + Err(_) => { + return Err(into_jsrpc_error(Web3Error::InternalError)); + } + }; + + let real_block_number = + utils::to_real_block_number(block_number, U64::from(reader.current_miniblock)); + let maybe_tx = reader + .block_hashes + .get(&real_block_number.as_u64()) + .and_then(|block_hash| reader.blocks.get(block_hash)) + .and_then(|block| block.transactions.get(index.as_usize())) + .and_then(|tx| match tx { + TransactionVariant::Full(tx) => Some(tx.clone()), + TransactionVariant::Hash(tx_hash) => reader + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + .and_then(|fork| { + fork.fork_source + .get_transaction_by_hash(*tx_hash) + .ok() + .flatten() + }), + }) + .or_else(|| { + reader + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + .and_then(|fork| { + fork.fork_source + .get_transaction_by_block_number_and_index(block_number, index) + .ok() + }) + .flatten() + }); + + Ok(maybe_tx) + }) } + /// Returns the protocol version. + /// + /// # Returns + /// + /// A `BoxFuture` containing a `jsonrpc_core::Result` that resolves to a hex `String` of the version number. fn protocol_version(&self) -> jsonrpc_core::BoxFuture> { - not_implemented("protocol_version") + Ok(String::from(PROTOCOL_VERSION)).into_boxed_future() } fn syncing( @@ -2441,33 +2830,33 @@ impl EthNamespaceT for fn coinbase( &self, ) -> jsonrpc_core::BoxFuture> { - not_implemented("coinbase") + not_implemented("eth_coinbase") } fn compilers(&self) -> jsonrpc_core::BoxFuture>> { - not_implemented("compilers") + not_implemented("eth_getCompilers") } fn hashrate(&self) -> jsonrpc_core::BoxFuture> { - not_implemented("hashrate") + not_implemented("eth_hashrate") } fn get_uncle_count_by_block_hash( &self, _hash: zksync_basic_types::H256, ) -> jsonrpc_core::BoxFuture>> { - not_implemented("get_uncle_count_by_block_hash") + not_implemented("eth_getUncleCountByBlockHash") } fn get_uncle_count_by_block_number( &self, _number: zksync_types::api::BlockNumber, ) -> jsonrpc_core::BoxFuture>> { - not_implemented("get_uncle_count_by_block_number") + not_implemented("eth_getUncleCountByBlockNumber") } fn mining(&self) -> jsonrpc_core::BoxFuture> { - not_implemented("mining") + not_implemented("eth_mining") } /// Returns the fee history for a given range of blocks. @@ -2640,9 +3029,17 @@ mod tests { cache::CacheConfig, http_fork_source::HttpForkSource, node::InMemoryNode, - testing::{self, ForkBlockConfig, LogBuilder, MockServer}, + testing::{ + self, default_tx_debug_info, ForkBlockConfig, LogBuilder, MockServer, + TransactionResponseBuilder, + }, + }; + use maplit::hashmap; + use zksync_basic_types::Nonce; + use zksync_types::{ + api::{BlockHashObject, BlockNumber, BlockNumberObject}, + utils::deployed_address_create, }; - use zksync_types::api::BlockNumber; use zksync_web3_decl::types::{SyncState, ValueOrArray}; use super::*; @@ -2754,7 +3151,7 @@ mod tests { #[tokio::test] async fn test_get_block_by_hash_for_produced_block() { let node = InMemoryNode::::default(); - let expected_block_hash = testing::apply_tx(&node, H256::repeat_byte(0x01)); + let (expected_block_hash, _) = testing::apply_tx(&node, H256::repeat_byte(0x01)); let actual_block = node .get_block_by_hash(expected_block_hash, false) @@ -2779,12 +3176,8 @@ mod tests { let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let inner = node.inner.read().unwrap(); @@ -2826,12 +3219,8 @@ mod tests { ); let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_block = node @@ -2898,12 +3287,8 @@ mod tests { ); let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_block = node @@ -2950,12 +3335,8 @@ mod tests { let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_block = node @@ -2990,12 +3371,8 @@ mod tests { ); let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_block = node @@ -3021,12 +3398,8 @@ mod tests { }); let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_block = node @@ -3047,7 +3420,7 @@ mod tests { async fn test_get_block_transaction_count_by_hash_for_produced_block() { let node = InMemoryNode::::default(); - let expected_block_hash = testing::apply_tx(&node, H256::repeat_byte(0x01)); + let (expected_block_hash, _) = testing::apply_tx(&node, H256::repeat_byte(0x01)); let actual_transaction_count = node .get_block_transaction_count_by_hash(expected_block_hash) .await @@ -3083,12 +3456,8 @@ mod tests { ); let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_transaction_count = node @@ -3144,12 +3513,8 @@ mod tests { let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_transaction_count = node @@ -3190,12 +3555,8 @@ mod tests { let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_transaction_count = node @@ -3227,12 +3588,8 @@ mod tests { let node = InMemoryNode::::new( Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), - crate::node::ShowCalls::None, - ShowStorageLogs::None, - ShowVMDetails::None, - ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, + None, + Default::default(), ); let actual_transaction_count = node @@ -3254,7 +3611,7 @@ mod tests { async fn test_get_transaction_receipt_uses_produced_block_hash() { let node = InMemoryNode::::default(); let tx_hash = H256::repeat_byte(0x01); - let expected_block_hash = testing::apply_tx(&node, tx_hash); + let (expected_block_hash, _) = testing::apply_tx(&node, tx_hash); let actual_tx_receipt = node .get_transaction_receipt(tx_hash) @@ -3336,7 +3693,7 @@ mod tests { .new_block_filter() .await .expect("failed creating filter"); - let block_hash = testing::apply_tx(&node, H256::repeat_byte(0x1)); + let (block_hash, _) = testing::apply_tx(&node, H256::repeat_byte(0x1)); match node .get_filter_changes(filter_id) @@ -3424,68 +3781,316 @@ mod tests { } #[tokio::test] - async fn test_get_filter_logs_returns_matching_logs_for_valid_id() { + async fn test_produced_block_archives_previous_blocks() { let node = InMemoryNode::::default(); - // populate tx receipts with 2 tx each having logs - { - let mut writer = node.inner.write().unwrap(); - writer.tx_results.insert( - H256::repeat_byte(0x1), - TransactionResult { - info: testing::default_tx_execution_info(), - receipt: TransactionReceipt { - logs: vec![LogBuilder::new() - .set_address(H160::repeat_byte(0xa1)) - .build()], - ..Default::default() - }, - }, - ); - writer.tx_results.insert( - H256::repeat_byte(0x2), - TransactionResult { - info: testing::default_tx_execution_info(), - receipt: TransactionReceipt { - logs: vec![ - LogBuilder::new() - .set_address(H160::repeat_byte(0xa1)) - .build(), - LogBuilder::new() - .set_address(H160::repeat_byte(0xa2)) - .build(), - ], - ..Default::default() - }, - }, - ); - } + let input_storage_key = StorageKey::new( + AccountTreeId::new(H160::repeat_byte(0x1)), + u256_to_h256(U256::zero()), + ); + let input_storage_value = H256::repeat_byte(0xcd); + node.inner + .write() + .unwrap() + .fork_storage + .set_value(input_storage_key, input_storage_value); + let initial_miniblock = node.inner.read().unwrap().current_miniblock; - let filter_id = node - .new_filter(Filter { - address: Some(ValueOrArray(vec![H160::repeat_byte(0xa1)])), - ..Default::default() - }) - .await - .expect("failed creating filter"); + testing::apply_tx(&node, H256::repeat_byte(0x1)); + let current_miniblock = node.inner.read().unwrap().current_miniblock; + + let reader = node.inner.read().unwrap(); + for miniblock in initial_miniblock..current_miniblock { + let actual_cached_value = reader + .block_hashes + .get(&miniblock) + .map(|hash| { + reader + .previous_states + .get(hash) + .unwrap_or_else(|| panic!("state was not cached for block {}", miniblock)) + }) + .and_then(|state| state.get(&input_storage_key)) + .copied(); - match node - .get_filter_logs(filter_id) - .await - .expect("failed getting filter changes") - { - FilterChanges::Logs(result) => assert_eq!(2, result.len()), - changes => panic!("unexpected filter changes: {:?}", changes), + assert_eq!( + Some(input_storage_value), + actual_cached_value, + "unexpected cached state value for block {}", + miniblock + ); } } #[tokio::test] - async fn test_get_filter_logs_returns_error_for_invalid_id() { + async fn test_get_storage_fetches_zero_value_for_non_existent_key() { let node = InMemoryNode::::default(); - // populate tx receipts with 2 tx each having logs - { - let mut writer = node.inner.write().unwrap(); + let value = node + .get_storage(H160::repeat_byte(0xf1), U256::from(1024), None) + .await + .expect("failed retrieving storage"); + assert_eq!(H256::zero(), value); + } + + #[tokio::test] + async fn test_get_storage_uses_fork_to_get_value_for_historical_block() { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_address = H160::repeat_byte(0x1); + let input_storage_value = H256::repeat_byte(0xcd); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getStorageAt", + "params": [ + format!("{:#x}", input_address), + "0x0", + { "blockNumber": "0x2" }, + ], + }), + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "result": format!("{:#x}", input_storage_value), + }), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + + let actual_value = node + .get_storage( + input_address, + U256::zero(), + Some(zksync_types::api::BlockIdVariant::BlockNumberObject( + BlockNumberObject { + block_number: BlockNumber::Number(U64::from(2)), + }, + )), + ) + .await + .expect("failed retrieving storage"); + assert_eq!(input_storage_value, actual_value); + } + + #[tokio::test] + async fn test_get_storage_uses_archived_storage_to_get_value_for_missing_key() { + let input_address = H160::repeat_byte(0x1); + let input_storage_key = StorageKey::new( + AccountTreeId::new(input_address), + u256_to_h256(U256::zero()), + ); + let input_storage_value = H256::repeat_byte(0xcd); + + let node = InMemoryNode::::default(); + node.inner + .write() + .map(|mut writer| { + let historical_block = Block:: { + hash: H256::repeat_byte(0x2), + number: U64::from(2), + ..Default::default() + }; + writer.block_hashes.insert(2, historical_block.hash); + + writer.previous_states.insert( + historical_block.hash, + hashmap! { + input_storage_key => input_storage_value, + }, + ); + writer + .blocks + .insert(historical_block.hash, historical_block); + }) + .expect("failed setting storage for historical block"); + + let actual_value = node + .get_storage( + input_address, + U256::zero(), + Some(zksync_types::api::BlockIdVariant::BlockNumberObject( + BlockNumberObject { + block_number: BlockNumber::Number(U64::from(2)), + }, + )), + ) + .await + .expect("failed retrieving storage"); + assert_eq!(input_storage_value, actual_value); + } + + #[tokio::test] + async fn test_get_storage_uses_fork_to_get_value_for_latest_block_for_missing_key() { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_address = H160::repeat_byte(0x1); + let input_storage_value = H256::repeat_byte(0xcd); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getStorageAt", + "params": [ + format!("{:#x}", input_address), + "0x0", + "0xa", + ], + }), + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "result": format!("{:#x}", input_storage_value), + }), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + node.inner + .write() + .map(|mut writer| { + let historical_block = Block:: { + hash: H256::repeat_byte(0x2), + number: U64::from(2), + ..Default::default() + }; + writer.block_hashes.insert(2, historical_block.hash); + writer + .previous_states + .insert(historical_block.hash, Default::default()); + writer + .blocks + .insert(historical_block.hash, historical_block); + }) + .expect("failed setting storage for historical block"); + + let actual_value = node + .get_storage( + input_address, + U256::zero(), + Some(zksync_types::api::BlockIdVariant::BlockNumberObject( + BlockNumberObject { + block_number: BlockNumber::Number(U64::from(2)), + }, + )), + ) + .await + .expect("failed retrieving storage"); + assert_eq!(input_storage_value, actual_value); + } + + #[tokio::test] + async fn test_get_storage_fetches_state_for_deployed_smart_contract_in_current_block() { + let node = InMemoryNode::::default(); + + let private_key = H256::repeat_byte(0xef); + let from_account = zksync_types::PackedEthSignature::address_from_private_key(&private_key) + .expect("failed generating address"); + node.set_rich_account(from_account); + + let deployed_address = deployed_address_create(from_account, U256::zero()); + + testing::deploy_contract( + &node, + H256::repeat_byte(0x1), + private_key, + hex::decode(testing::STORAGE_CONTRACT_BYTECODE).unwrap(), + None, + Nonce(0), + ); + + let number1 = node + .get_storage(deployed_address, U256::from(0), None) + .await + .expect("failed retrieving storage at slot 0"); + assert_eq!(U256::from(1024), h256_to_u256(number1)); + + let number2 = node + .get_storage(deployed_address, U256::from(1), None) + .await + .expect("failed retrieving storage at slot 1"); + assert_eq!(U256::MAX, h256_to_u256(number2)); + } + + #[tokio::test] + async fn test_get_storage_fetches_state_for_deployed_smart_contract_in_old_block() { + let node = InMemoryNode::::default(); + + let private_key = H256::repeat_byte(0xef); + let from_account = zksync_types::PackedEthSignature::address_from_private_key(&private_key) + .expect("failed generating address"); + node.set_rich_account(from_account); + + let deployed_address = deployed_address_create(from_account, U256::zero()); + + let initial_block_hash = testing::deploy_contract( + &node, + H256::repeat_byte(0x1), + private_key, + hex::decode(testing::STORAGE_CONTRACT_BYTECODE).unwrap(), + None, + Nonce(0), + ); + + // simulate a tx modifying the storage + testing::apply_tx(&node, H256::repeat_byte(0x2)); + let key = StorageKey::new( + AccountTreeId::new(deployed_address), + u256_to_h256(U256::from(0)), + ); + node.inner + .write() + .unwrap() + .fork_storage + .inner + .write() + .unwrap() + .raw_storage + .state + .insert(key, u256_to_h256(U256::from(512))); + + let number1_current = node + .get_storage(deployed_address, U256::from(0), None) + .await + .expect("failed retrieving storage at slot 0"); + assert_eq!(U256::from(512), h256_to_u256(number1_current)); + + let number1_old = node + .get_storage( + deployed_address, + U256::from(0), + Some(zksync_types::api::BlockIdVariant::BlockHashObject( + BlockHashObject { + block_hash: initial_block_hash, + }, + )), + ) + .await + .expect("failed retrieving storage at slot 0"); + assert_eq!(U256::from(1024), h256_to_u256(number1_old)); + } + + #[tokio::test] + async fn test_get_filter_logs_returns_matching_logs_for_valid_id() { + let node = InMemoryNode::::default(); + + // populate tx receipts with 2 tx each having logs + { + let mut writer = node.inner.write().unwrap(); writer.tx_results.insert( H256::repeat_byte(0x1), TransactionResult { @@ -3496,6 +4101,65 @@ mod tests { .build()], ..Default::default() }, + debug: default_tx_debug_info(), + }, + ); + writer.tx_results.insert( + H256::repeat_byte(0x2), + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: TransactionReceipt { + logs: vec![ + LogBuilder::new() + .set_address(H160::repeat_byte(0xa1)) + .build(), + LogBuilder::new() + .set_address(H160::repeat_byte(0xa2)) + .build(), + ], + ..Default::default() + }, + debug: default_tx_debug_info(), + }, + ); + } + + let filter_id = node + .new_filter(Filter { + address: Some(ValueOrArray(vec![H160::repeat_byte(0xa1)])), + ..Default::default() + }) + .await + .expect("failed creating filter"); + + match node + .get_filter_logs(filter_id) + .await + .expect("failed getting filter changes") + { + FilterChanges::Logs(result) => assert_eq!(2, result.len()), + changes => panic!("unexpected filter changes: {:?}", changes), + } + } + + #[tokio::test] + async fn test_get_filter_logs_returns_error_for_invalid_id() { + let node = InMemoryNode::::default(); + + // populate tx receipts with 2 tx each having logs + { + let mut writer = node.inner.write().unwrap(); + writer.tx_results.insert( + H256::repeat_byte(0x1), + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: TransactionReceipt { + logs: vec![LogBuilder::new() + .set_address(H160::repeat_byte(0xa1)) + .build()], + ..Default::default() + }, + debug: default_tx_debug_info(), }, ); } @@ -3523,6 +4187,7 @@ mod tests { .build()], ..Default::default() }, + debug: testing::default_tx_debug_info(), }, ); writer.tx_results.insert( @@ -3540,6 +4205,7 @@ mod tests { ], ..Default::default() }, + debug: testing::default_tx_debug_info(), }, ); } @@ -3592,4 +4258,542 @@ mod tests { } } } + + #[tokio::test] + async fn test_snapshot() { + let node = InMemoryNode::::default(); + let mut inner = node.inner.write().unwrap(); + + inner + .blocks + .insert(H256::repeat_byte(0x1), Default::default()); + inner.block_hashes.insert(1, H256::repeat_byte(0x1)); + inner.tx_results.insert( + H256::repeat_byte(0x1), + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: Default::default(), + debug: testing::default_tx_debug_info(), + }, + ); + inner.current_batch = 1; + inner.current_miniblock = 1; + inner.current_miniblock_hash = H256::repeat_byte(0x1); + inner.current_timestamp = 1; + inner + .filters + .add_block_filter() + .expect("failed adding block filter"); + inner.impersonated_accounts.insert(H160::repeat_byte(0x1)); + inner.rich_accounts.insert(H160::repeat_byte(0x1)); + inner + .previous_states + .insert(H256::repeat_byte(0x1), Default::default()); + inner.fork_storage.set_value( + StorageKey::new(AccountTreeId::new(H160::repeat_byte(0x1)), H256::zero()), + H256::repeat_byte(0x1), + ); + + let storage = inner.fork_storage.inner.read().unwrap(); + let expected_snapshot = Snapshot { + current_timestamp: inner.current_timestamp.clone(), + current_batch: inner.current_batch.clone(), + current_miniblock: inner.current_miniblock.clone(), + current_miniblock_hash: inner.current_miniblock_hash.clone(), + l1_gas_price: inner.l1_gas_price.clone(), + tx_results: inner.tx_results.clone(), + blocks: inner.blocks.clone(), + block_hashes: inner.block_hashes.clone(), + filters: inner.filters.clone(), + impersonated_accounts: inner.impersonated_accounts.clone(), + rich_accounts: inner.rich_accounts.clone(), + previous_states: inner.previous_states.clone(), + raw_storage: storage.raw_storage.clone(), + value_read_cache: storage.value_read_cache.clone(), + factory_dep_cache: storage.factory_dep_cache.clone(), + }; + let actual_snapshot = inner.snapshot().expect("failed taking snapshot"); + + assert_eq!( + expected_snapshot.current_timestamp, + actual_snapshot.current_timestamp + ); + assert_eq!( + expected_snapshot.current_batch, + actual_snapshot.current_batch + ); + assert_eq!( + expected_snapshot.current_miniblock, + actual_snapshot.current_miniblock + ); + assert_eq!( + expected_snapshot.current_miniblock_hash, + actual_snapshot.current_miniblock_hash + ); + assert_eq!(expected_snapshot.l1_gas_price, actual_snapshot.l1_gas_price); + assert_eq!( + expected_snapshot.tx_results.keys().collect_vec(), + actual_snapshot.tx_results.keys().collect_vec() + ); + assert_eq!(expected_snapshot.blocks, actual_snapshot.blocks); + assert_eq!(expected_snapshot.block_hashes, actual_snapshot.block_hashes); + assert_eq!(expected_snapshot.filters, actual_snapshot.filters); + assert_eq!( + expected_snapshot.impersonated_accounts, + actual_snapshot.impersonated_accounts + ); + assert_eq!( + expected_snapshot.rich_accounts, + actual_snapshot.rich_accounts + ); + assert_eq!( + expected_snapshot.previous_states, + actual_snapshot.previous_states + ); + assert_eq!(expected_snapshot.raw_storage, actual_snapshot.raw_storage); + assert_eq!( + expected_snapshot.value_read_cache, + actual_snapshot.value_read_cache + ); + assert_eq!( + expected_snapshot.factory_dep_cache, + actual_snapshot.factory_dep_cache + ); + } + + #[tokio::test] + async fn test_snapshot_restore() { + let node = InMemoryNode::::default(); + let mut inner = node.inner.write().unwrap(); + + inner + .blocks + .insert(H256::repeat_byte(0x1), Default::default()); + inner.block_hashes.insert(1, H256::repeat_byte(0x1)); + inner.tx_results.insert( + H256::repeat_byte(0x1), + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: Default::default(), + debug: testing::default_tx_debug_info(), + }, + ); + inner.current_batch = 1; + inner.current_miniblock = 1; + inner.current_miniblock_hash = H256::repeat_byte(0x1); + inner.current_timestamp = 1; + inner + .filters + .add_block_filter() + .expect("failed adding block filter"); + inner.impersonated_accounts.insert(H160::repeat_byte(0x1)); + inner.rich_accounts.insert(H160::repeat_byte(0x1)); + inner + .previous_states + .insert(H256::repeat_byte(0x1), Default::default()); + inner.fork_storage.set_value( + StorageKey::new(AccountTreeId::new(H160::repeat_byte(0x1)), H256::zero()), + H256::repeat_byte(0x1), + ); + + let expected_snapshot = { + let storage = inner.fork_storage.inner.read().unwrap(); + Snapshot { + current_timestamp: inner.current_timestamp.clone(), + current_batch: inner.current_batch.clone(), + current_miniblock: inner.current_miniblock.clone(), + current_miniblock_hash: inner.current_miniblock_hash.clone(), + l1_gas_price: inner.l1_gas_price.clone(), + tx_results: inner.tx_results.clone(), + blocks: inner.blocks.clone(), + block_hashes: inner.block_hashes.clone(), + filters: inner.filters.clone(), + impersonated_accounts: inner.impersonated_accounts.clone(), + rich_accounts: inner.rich_accounts.clone(), + previous_states: inner.previous_states.clone(), + raw_storage: storage.raw_storage.clone(), + value_read_cache: storage.value_read_cache.clone(), + factory_dep_cache: storage.factory_dep_cache.clone(), + } + }; + + // snapshot and modify node state + let snapshot = inner.snapshot().expect("failed taking snapshot"); + inner + .blocks + .insert(H256::repeat_byte(0x2), Default::default()); + inner.block_hashes.insert(2, H256::repeat_byte(0x2)); + inner.tx_results.insert( + H256::repeat_byte(0x2), + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: Default::default(), + debug: default_tx_debug_info(), + }, + ); + inner.current_batch = 2; + inner.current_miniblock = 2; + inner.current_miniblock_hash = H256::repeat_byte(0x2); + inner.current_timestamp = 2; + inner + .filters + .add_pending_transaction_filter() + .expect("failed adding pending transaction filter"); + inner.impersonated_accounts.insert(H160::repeat_byte(0x2)); + inner.rich_accounts.insert(H160::repeat_byte(0x2)); + inner + .previous_states + .insert(H256::repeat_byte(0x2), Default::default()); + inner.fork_storage.set_value( + StorageKey::new(AccountTreeId::new(H160::repeat_byte(0x2)), H256::zero()), + H256::repeat_byte(0x2), + ); + + // restore + inner + .restore_snapshot(snapshot) + .expect("failed restoring snapshot"); + + let storage = inner.fork_storage.inner.read().unwrap(); + assert_eq!(expected_snapshot.current_timestamp, inner.current_timestamp); + assert_eq!(expected_snapshot.current_batch, inner.current_batch); + assert_eq!(expected_snapshot.current_miniblock, inner.current_miniblock); + assert_eq!( + expected_snapshot.current_miniblock_hash, + inner.current_miniblock_hash + ); + assert_eq!(expected_snapshot.l1_gas_price, inner.l1_gas_price); + assert_eq!( + expected_snapshot.tx_results.keys().collect_vec(), + inner.tx_results.keys().collect_vec() + ); + assert_eq!(expected_snapshot.blocks, inner.blocks); + assert_eq!(expected_snapshot.block_hashes, inner.block_hashes); + assert_eq!(expected_snapshot.filters, inner.filters); + assert_eq!( + expected_snapshot.impersonated_accounts, + inner.impersonated_accounts + ); + assert_eq!(expected_snapshot.rich_accounts, inner.rich_accounts); + assert_eq!(expected_snapshot.previous_states, inner.previous_states); + assert_eq!(expected_snapshot.raw_storage, storage.raw_storage); + assert_eq!(expected_snapshot.value_read_cache, storage.value_read_cache); + assert_eq!( + expected_snapshot.factory_dep_cache, + storage.factory_dep_cache + ); + } + + #[tokio::test] + async fn test_get_transaction_by_block_hash_and_index_returns_none_for_invalid_block_hash() { + let node = InMemoryNode::::default(); + let input_tx_hash = H256::repeat_byte(0x01); + let (input_block_hash, _) = testing::apply_tx(&node, input_tx_hash); + let invalid_block_hash = H256::repeat_byte(0xab); + assert_ne!(input_block_hash, invalid_block_hash); + + let result = node + .get_transaction_by_block_hash_and_index(invalid_block_hash, U64::from(0)) + .await + .expect("failed fetching transaction"); + + assert!(result.is_none()); + } + + #[tokio::test] + async fn test_get_transaction_by_block_hash_and_index_returns_none_for_invalid_index() { + let node = InMemoryNode::::default(); + let input_tx_hash = H256::repeat_byte(0x01); + let (input_block_hash, _) = testing::apply_tx(&node, input_tx_hash); + + let result = node + .get_transaction_by_block_hash_and_index(input_block_hash, U64::from(10)) + .await + .expect("failed fetching transaction"); + + assert!(result.is_none()); + } + + #[tokio::test] + async fn test_get_transaction_by_block_hash_and_index_returns_transaction_for_valid_input() { + let node = InMemoryNode::::default(); + let input_tx_hash = H256::repeat_byte(0x01); + let (input_block_hash, _) = testing::apply_tx(&node, input_tx_hash); + + let actual_tx = node + .get_transaction_by_block_hash_and_index(input_block_hash, U64::from(0)) + .await + .expect("failed fetching transaction") + .expect("no transaction"); + + assert_eq!(input_tx_hash, actual_tx.hash); + } + + #[tokio::test] + async fn test_get_transaction_by_block_hash_and_index_fetches_full_transaction_for_hash_from_fork( + ) { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_block_hash = H256::repeat_byte(0x01); + let input_tx_hash = H256::repeat_byte(0x02); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getTransactionByHash", + "params": [ + format!("{:#x}", input_tx_hash), + ], + }), + TransactionResponseBuilder::new() + .set_hash(input_tx_hash) + .set_block_hash(input_block_hash) + .set_block_number(U64::from(1)) + .build(), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + + // store the block info with just the tx hash invariant + { + let mut writer = node.inner.write().unwrap(); + writer.blocks.insert( + input_block_hash, + Block { + transactions: vec![TransactionVariant::Hash(input_tx_hash)], + ..Default::default() + }, + ); + } + + let actual_tx = node + .get_transaction_by_block_hash_and_index(input_block_hash, U64::from(0)) + .await + .expect("failed fetching transaction") + .expect("no transaction"); + + assert_eq!(input_tx_hash, actual_tx.hash); + assert_eq!(Some(U64::from(1)), actual_tx.block_number); + } + + #[tokio::test] + async fn test_get_transaction_by_block_hash_and_index_fetches_from_fork_if_block_missing() { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_block_hash = H256::repeat_byte(0x01); + let input_tx_hash = H256::repeat_byte(0x02); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getTransactionByBlockHashAndIndex", + "params": [ + format!("{:#x}", input_block_hash), + "0x1" + ], + }), + TransactionResponseBuilder::new() + .set_hash(input_tx_hash) + .set_block_hash(input_block_hash) + .set_block_number(U64::from(100)) + .build(), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + + let actual_tx = node + .get_transaction_by_block_hash_and_index(input_block_hash, U64::from(1)) + .await + .expect("failed fetching transaction") + .expect("no transaction"); + + assert_eq!(input_tx_hash, actual_tx.hash); + assert_eq!(Some(U64::from(100)), actual_tx.block_number); + } + + #[tokio::test] + async fn test_get_transaction_by_block_number_and_index_returns_none_for_invalid_block_number() + { + let node = InMemoryNode::::default(); + let input_tx_hash = H256::repeat_byte(0x01); + let (input_block_hash, _) = testing::apply_tx(&node, input_tx_hash); + let invalid_block_hash = H256::repeat_byte(0xab); + assert_ne!(input_block_hash, invalid_block_hash); + + let result = node + .get_transaction_by_block_number_and_index( + BlockNumber::Number(U64::from(100)), + U64::from(0), + ) + .await + .expect("failed fetching transaction"); + + assert!(result.is_none()); + } + + #[tokio::test] + async fn test_get_transaction_by_block_number_and_index_returns_none_for_invalid_index() { + let node = InMemoryNode::::default(); + let input_tx_hash = H256::repeat_byte(0x01); + testing::apply_tx(&node, input_tx_hash); + + let result = node + .get_transaction_by_block_number_and_index(BlockNumber::Latest, U64::from(10)) + .await + .expect("failed fetching transaction"); + + assert!(result.is_none()); + } + + #[tokio::test] + async fn test_get_transaction_by_block_number_and_index_returns_transaction_for_valid_input() { + let node = InMemoryNode::::default(); + let input_tx_hash = H256::repeat_byte(0x01); + let (_, input_block_number) = testing::apply_tx(&node, input_tx_hash); + + let actual_tx = node + .get_transaction_by_block_number_and_index( + BlockNumber::Number(input_block_number), + U64::from(0), + ) + .await + .expect("failed fetching transaction") + .expect("no transaction"); + + assert_eq!(input_tx_hash, actual_tx.hash); + } + + #[tokio::test] + async fn test_get_transaction_by_block_number_and_index_fetches_full_transaction_for_hash_from_fork( + ) { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_block_hash = H256::repeat_byte(0x01); + let input_block_number = U64::from(100); + let input_tx_hash = H256::repeat_byte(0x02); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getTransactionByHash", + "params": [ + format!("{:#x}", input_tx_hash), + ], + }), + TransactionResponseBuilder::new() + .set_hash(input_tx_hash) + .set_block_hash(input_block_hash) + .set_block_number(input_block_number) + .build(), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + + // store the block info with just the tx hash invariant + { + let mut writer = node.inner.write().unwrap(); + writer + .block_hashes + .insert(input_block_number.as_u64(), input_block_hash); + writer.blocks.insert( + input_block_hash, + Block { + transactions: vec![TransactionVariant::Hash(input_tx_hash)], + ..Default::default() + }, + ); + } + + let actual_tx = node + .get_transaction_by_block_number_and_index( + BlockNumber::Number(input_block_number), + U64::from(0), + ) + .await + .expect("failed fetching transaction") + .expect("no transaction"); + + assert_eq!(input_tx_hash, actual_tx.hash); + assert_eq!(Some(U64::from(input_block_number)), actual_tx.block_number); + } + + #[tokio::test] + async fn test_get_transaction_by_block_number_and_index_fetches_from_fork_if_block_missing() { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_block_hash = H256::repeat_byte(0x01); + let input_block_number = U64::from(100); + let input_tx_hash = H256::repeat_byte(0x02); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getTransactionByBlockNumberAndIndex", + "params": [ + format!("{:#x}", input_block_number), + "0x1" + ], + }), + TransactionResponseBuilder::new() + .set_hash(input_tx_hash) + .set_block_hash(input_block_hash) + .set_block_number(U64::from(input_block_number)) + .build(), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + + let actual_tx = node + .get_transaction_by_block_number_and_index( + BlockNumber::Number(input_block_number), + U64::from(1), + ) + .await + .expect("failed fetching transaction") + .expect("no transaction"); + + assert_eq!(input_tx_hash, actual_tx.hash); + assert_eq!(Some(input_block_number), actual_tx.block_number); + } + + #[tokio::test] + async fn test_protocol_version_returns_currently_supported_version() { + let node = InMemoryNode::::default(); + + let expected_version = String::from(PROTOCOL_VERSION); + let actual_version = node + .protocol_version() + .await + .expect("failed creating filter"); + + assert_eq!(expected_version, actual_version); + } } diff --git a/src/observability.rs b/src/observability.rs new file mode 100644 index 00000000..1c2bbb1e --- /dev/null +++ b/src/observability.rs @@ -0,0 +1,126 @@ +use core::fmt; +use std::{fs::File, sync::Mutex}; + +use clap::ValueEnum; +use serde::{Deserialize, Serialize}; +use tracing_subscriber::{ + filter::LevelFilter, layer::SubscriberExt, reload, util::SubscriberInitExt, EnvFilter, Layer, + Registry, +}; + +/// Log filter level for the node. +#[derive(Debug, Clone, ValueEnum, Serialize, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum LogLevel { + Trace, + Debug, + Info, + Warn, + Error, +} + +impl fmt::Display for LogLevel { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match *self { + LogLevel::Trace => f.pad("TRACE"), + LogLevel::Debug => f.pad("DEBUG"), + LogLevel::Info => f.pad("INFO"), + LogLevel::Warn => f.pad("WARN"), + LogLevel::Error => f.pad("ERROR"), + } + } +} + +impl From for LevelFilter { + fn from(value: LogLevel) -> Self { + match value { + LogLevel::Trace => LevelFilter::TRACE, + LogLevel::Debug => LevelFilter::DEBUG, + LogLevel::Info => LevelFilter::INFO, + LogLevel::Warn => LevelFilter::WARN, + LogLevel::Error => LevelFilter::ERROR, + } + } +} + +/// A sharable reference to the observability stack. +#[derive(Debug, Default, Clone)] +pub struct Observability { + binary_name: String, + reload_handle: Option>, +} + +impl Observability { + /// Initialize the tracing subscriber. + pub fn init( + binary_name: String, + log_level_filter: LevelFilter, + log_file: File, + ) -> Result { + let filter = Self::parse_filter(&format!( + "{}={}", + binary_name, + format!("{log_level_filter}").to_lowercase() + ))?; + let (filter, reload_handle) = reload::Layer::new(filter); + tracing_subscriber::registry() + .with( + filter.and_then(tracing_subscriber::fmt::layer()).and_then( + tracing_subscriber::fmt::layer() + .with_writer(Mutex::new(log_file)) + .with_ansi(false), + ), + ) + .init(); + + Ok(Self { + binary_name, + reload_handle: Some(reload_handle), + }) + } + + /// Set the log level for the binary. + pub fn set_log_level(&self, level: LogLevel) -> Result<(), anyhow::Error> { + let level = LevelFilter::from(level); + let new_filter = Self::parse_filter(&format!( + "{}={}", + self.binary_name, + format!("{level}").to_lowercase() + ))?; + + if let Some(handle) = &self.reload_handle { + handle.modify(|filter| *filter = new_filter)?; + } + + Ok(()) + } + + /// Sets advanced logging directive. + /// Example: + /// * "my_crate=debug" + /// * "my_crate::module=trace" + /// * "my_crate=debug,other_crate=warn" + pub fn set_logging(&self, directive: &str) -> Result<(), anyhow::Error> { + let new_filter = Self::parse_filter(directive)?; + + if let Some(handle) = &self.reload_handle { + handle.modify(|filter| *filter = new_filter)?; + } + + Ok(()) + } + + /// Parses a directive and builds an [EnvFilter] from it. + /// Example: + /// * "my_crate=debug" + /// * "my_crate::module=trace" + /// * "my_crate=debug,other_crate=warn" + fn parse_filter(directive: &str) -> Result { + let mut filter = EnvFilter::from_default_env(); + for directive in directive.split(',') { + filter = filter.add_directive(directive.parse()?); + } + + Ok(filter) + } +} diff --git a/src/system_contracts.rs b/src/system_contracts.rs index 54056d3f..35823a8f 100644 --- a/src/system_contracts.rs +++ b/src/system_contracts.rs @@ -9,8 +9,10 @@ use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words}; use crate::deps::system_contracts::{bytecode_from_slice, COMPILED_IN_SYSTEM_CONTRACTS}; +#[derive(Default, Debug, Clone)] pub enum Options { // Use the compiled-in contracts + #[default] BuiltIn, // Load the contracts bytecode at runtime from ZKSYNC_HOME Local, @@ -19,6 +21,7 @@ pub enum Options { } /// Holds the system contracts (and bootloader) that are used by the in-memory node. +#[derive(Debug, Clone)] pub struct SystemContracts { pub baseline_contracts: BaseSystemContracts, pub playground_contracts: BaseSystemContracts, @@ -53,7 +56,7 @@ impl SystemContracts { fee_estimate_impersonating_contracts: fee_estimate_impersonating_contracts(options), } } - pub fn contacts_for_l2_call(&self) -> &BaseSystemContracts { + pub fn contracts_for_l2_call(&self) -> &BaseSystemContracts { self.contracts(TxExecutionMode::EthCall, false) } diff --git a/src/testing.rs b/src/testing.rs index a2f9399d..12568d1a 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -8,6 +8,7 @@ use crate::node::{InMemoryNode, TxExecutionInfo}; use crate::{fork::ForkSource, node::compute_hash}; +use ethers::contract; use httptest::{ matchers::{eq, json_decoded, request}, responders::json_encoded, @@ -17,7 +18,7 @@ use itertools::Itertools; use std::str::FromStr; use vm::VmExecutionResultAndLogs; use zksync_basic_types::{H160, U64}; -use zksync_types::api::Log; +use zksync_types::api::{BridgeAddresses, DebugCall, DebugCallType, Log}; use zksync_types::{ fee::Fee, l2::L2Tx, Address, L2ChainId, Nonce, PackedEthSignature, ProtocolVersionId, H256, U256, @@ -94,7 +95,7 @@ impl MockServer { "default_aa": "0x0100038dc66b69be75ec31653c64cb931678299b9b659472772b2550b703f41c" }, "operatorAddress": "0xfeee860e7aae671124e9a4e61139f3a5085dfeee", - "protocolVersion": ProtocolVersionId::latest(), + "protocolVersion": ProtocolVersionId::Version15, }, }))), ); @@ -142,19 +143,6 @@ impl MockServer { } }))), ); - server.expect( - Expectation::matching(request::body(json_decoded(eq(serde_json::json!({ - "jsonrpc": "2.0", - "id": 4, - "method": "eth_getStorageAt", - "params": vec!["0x000000000000000000000000000000000000800a","0xe9472b134a1b5f7b935d5debff2691f95801214eafffdeabbf0e366da383104e","0xa"], - }))))).times(0..) - .respond_with(json_encoded(serde_json::json!({ - "jsonrpc": "2.0", - "id": 4, - "result": "0x0000000000000000000000000000000000000000000000000000000000000000", - }))), - ); MockServer { inner: server } } @@ -242,6 +230,8 @@ impl BlockResponseBuilder { #[derive(Default, Debug, Clone)] pub struct TransactionResponseBuilder { hash: H256, + block_hash: H256, + block_number: U64, } impl TransactionResponseBuilder { @@ -250,19 +240,31 @@ impl TransactionResponseBuilder { Self::default() } - /// Sets the block hash + /// Sets the transaction hash pub fn set_hash(&mut self, hash: H256) -> &mut Self { self.hash = hash; self } + /// Sets the block hash + pub fn set_block_hash(&mut self, hash: H256) -> &mut Self { + self.block_hash = hash; + self + } + + /// Sets the block number + pub fn set_block_number(&mut self, number: U64) -> &mut Self { + self.block_number = number; + self + } + /// Builds the transaction json result pub fn build_result(&mut self) -> serde_json::Value { serde_json::json!({ "hash": format!("{:#x}", self.hash), "nonce": "0x0", - "blockHash": "0x51f81bcdfc324a0dff2b5bec9d92e21cbebc4d5e29d3a3d30de3e03fbeab8d7f", - "blockNumber": "0x1", + "blockHash": format!("{:#x}", self.block_hash), + "blockNumber": format!("{:#x}", self.block_number), "transactionIndex": "0x0", "from": "0x29df43f75149d0552475a6f9b2ac96e28796ed0b", "to": "0x0000000000000000000000000000000000008006", @@ -273,7 +275,8 @@ impl TransactionResponseBuilder { "type": "0xff", "maxFeePerGas": "0x0", "maxPriorityFeePerGas": "0x0", - "chainId": "0x144", + // TODO: can be changed back to "0x104" after zksync-era update + "chainId": 260, "l1BatchNumber": "0x1", "l1BatchTxIndex": "0x0", }) @@ -356,7 +359,10 @@ impl RawTransactionsResponseBuilder { } /// Applies a transaction with a given hash to the node and returns the block hash. -pub fn apply_tx(node: &InMemoryNode, tx_hash: H256) -> H256 { +pub fn apply_tx( + node: &InMemoryNode, + tx_hash: H256, +) -> (H256, U64) { let next_miniblock = node .get_inner() .read() @@ -379,7 +385,7 @@ pub fn apply_tx(node: &InMemoryNode, tx_hash gas_per_pubdata_limit: U256::from(20000), }, U256::from(1), - L2ChainId(260), + L2ChainId::from(260), &private_key, None, Default::default(), @@ -388,6 +394,88 @@ pub fn apply_tx(node: &InMemoryNode, tx_hash tx.set_input(vec![], tx_hash); node.apply_txs(vec![tx]).expect("failed applying tx"); + (produced_block_hash, U64::from(next_miniblock)) +} + +/// Deploys a contract with the given bytecode. +pub fn deploy_contract( + node: &InMemoryNode, + tx_hash: H256, + private_key: H256, + bytecode: Vec, + calldata: Option>, + nonce: Nonce, +) -> H256 { + use ethers::abi::Function; + use ethers::types::Bytes; + use zksync_web3_rs::eip712; + + let next_miniblock = node + .get_inner() + .read() + .map(|reader| reader.current_miniblock.saturating_add(1)) + .expect("failed getting current batch number"); + let produced_block_hash = compute_hash(next_miniblock, tx_hash); + + let salt = [0u8; 32]; + let bytecode_hash = eip712::hash_bytecode(&bytecode).expect("invalid bytecode"); + let call_data: Bytes = calldata.unwrap_or_default().into(); + let create: Function = serde_json::from_str( + r#"{ + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_input", + "type": "bytes" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }"#, + ) + .unwrap(); + + let data = contract::encode_function_data(&create, (salt, bytecode_hash, call_data)) + .expect("failed encoding function data"); + + let mut tx = L2Tx::new_signed( + zksync_types::CONTRACT_DEPLOYER_ADDRESS, + data.to_vec(), + nonce, + Fee { + gas_limit: U256::from(82511299), + max_fee_per_gas: U256::from(250_000_000), + max_priority_fee_per_gas: U256::from(250_000_000), + gas_per_pubdata_limit: U256::from(50000), + }, + U256::from(0), + zksync_basic_types::L2ChainId::from(260), + &private_key, + Some(vec![bytecode]), + Default::default(), + ) + .expect("failed signing tx"); + tx.set_input(vec![], tx_hash); + node.apply_txs(vec![tx]).expect("failed deploying contract"); + produced_block_hash } @@ -442,6 +530,22 @@ impl LogBuilder { } } +/// Simple storage solidity contract that stores and retrieves two numbers +/// +/// contract Storage { +/// uint256 number1 = 1024; +/// uint256 number2 = 115792089237316195423570985008687907853269984665640564039457584007913129639935; // uint256::max +/// +/// function retrieve1() public view returns (uint256) { +/// return number1; +/// } +/// +/// function retrieve2() public view returns (uint256) { +/// return number2; +/// } +/// } +pub const STORAGE_CONTRACT_BYTECODE: &str = "000200000000000200010000000103550000006001100270000000160010019d0000008001000039000000400010043f0000000101200190000000280000c13d0000000001000031000000040110008c000000460000413d0000000101000367000000000101043b000000e001100270000000180210009c000000350000613d000000190110009c000000460000c13d0000000001000416000000000101004b000000460000c13d000000040100008a00000000011000310000001a02000041000000000301004b000000000300001900000000030240190000001a01100197000000000401004b000000000200a0190000001a0110009c00000000010300190000000001026019000000000101004b000000460000c13d0000000101000039000000000101041a000000800010043f0000001c01000041000000520001042e0000000001000416000000000101004b000000460000c13d0000040001000039000000000010041b000000010100008a0000000102000039000000000012041b0000002001000039000001000010044300000120000004430000001701000041000000520001042e0000000001000416000000000101004b000000460000c13d000000040100008a00000000011000310000001a02000041000000000301004b000000000300001900000000030240190000001a01100197000000000401004b000000000200a0190000001a0110009c00000000010300190000000001026019000000000101004b000000480000613d00000000010000190000005300010430000000400100043d000000000200041a00000000002104350000001602000041000000160310009c000000000102801900000040011002100000001b011001c7000000520001042e0000005100000432000000520001042e0000005300010430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000ae2e2cce000000000000000000000000000000000000000000000000000000002711432d80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000dec5bcecb8ee3456d9f70206a2d3c7fe5879354667a3a4b473afaff3d289dc8"; + /// Returns a default instance for a successful [TxExecutionInfo] pub fn default_tx_execution_info() -> TxExecutionInfo { TxExecutionInfo { @@ -467,6 +571,58 @@ pub fn default_tx_execution_info() -> TxExecutionInfo { } } +/// Returns a default instance for a successful [DebugCall] +pub fn default_tx_debug_info() -> DebugCall { + DebugCall { + r#type: DebugCallType::Call, + from: Address::zero(), + to: Address::zero(), + gas: U256::zero(), + gas_used: U256::zero(), + value: U256::zero(), + output: Default::default(), + input: Default::default(), + error: None, + revert_reason: None, + calls: vec![DebugCall { + r#type: DebugCallType::Call, + from: Address::zero(), + to: Address::zero(), + gas: U256::zero(), + gas_used: U256::zero(), + value: U256::zero(), + output: Default::default(), + input: Default::default(), + error: None, + revert_reason: None, + calls: vec![], + }], + } +} + +/// Asserts that two instances of [BridgeAddresses] are equal +pub fn assert_bridge_addresses_eq( + expected_bridge_addresses: &BridgeAddresses, + actual_bridge_addresses: &BridgeAddresses, +) { + assert_eq!( + expected_bridge_addresses.l1_erc20_default_bridge, + actual_bridge_addresses.l1_erc20_default_bridge + ); + assert_eq!( + expected_bridge_addresses.l2_erc20_default_bridge, + actual_bridge_addresses.l2_erc20_default_bridge + ); + assert_eq!( + expected_bridge_addresses.l1_weth_bridge, + actual_bridge_addresses.l1_weth_bridge + ); + assert_eq!( + expected_bridge_addresses.l2_weth_bridge, + actual_bridge_addresses.l2_weth_bridge + ); +} + mod test { use super::*; use crate::http_fork_source::HttpForkSource; @@ -558,13 +714,14 @@ mod test { #[tokio::test] async fn test_apply_tx() { let node = InMemoryNode::::default(); - let actual_block_hash = apply_tx(&node, H256::repeat_byte(0x01)); + let (actual_block_hash, actual_block_number) = apply_tx(&node, H256::repeat_byte(0x01)); assert_eq!( H256::from_str("0xd97ba6a5ab0f2d7fbfc697251321cce20bff3da2b0ddaf12c80f80f0ab270b15") .unwrap(), actual_block_hash, ); + assert_eq!(U64::from(1), actual_block_number); assert!( node.get_inner() diff --git a/src/utils.rs b/src/utils.rs index 9605f152..75f5ae8f 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,13 +1,19 @@ use std::collections::HashMap; use std::pin::Pin; +use chrono::{DateTime, Utc}; use futures::Future; +use vm::{ExecutionResult, VmExecutionResultAndLogs}; use vm::{HistoryDisabled, Vm}; use zksync_basic_types::{U256, U64}; use zksync_state::StorageView; use zksync_state::WriteStorage; -use zksync_types::api::BlockNumber; +use zksync_types::api::{BlockNumber, DebugCall, DebugCallType}; +use zksync_types::l2::L2Tx; +use zksync_types::vm_trace::Call; +use zksync_types::CONTRACT_DEPLOYER_ADDRESS; use zksync_utils::u256_to_h256; +use zksync_web3_decl::error::Web3Error; use crate::node::create_empty_block; use crate::{fork::ForkSource, node::InMemoryNodeInner}; @@ -103,9 +109,9 @@ pub fn mine_empty_blocks( let (keys, bytecodes, block_ctx) = { let storage = StorageView::new(&node.fork_storage).to_rc_ptr(); - // system_contract.contacts_for_l2_call() will give playground contracts + // system_contract.contracts_for_l2_call() will give playground contracts // we need these to use the unsafeOverrideBlock method in SystemContext.sol - let bootloader_code = node.system_contracts.contacts_for_l2_call(); + let bootloader_code = node.system_contracts.contracts_for_l2_call(); let (batch_env, mut block_ctx) = node.create_l1_batch_env(storage.clone()); // override the next block's timestamp to match up with interval for subsequent blocks if i != 0 { @@ -180,6 +186,72 @@ pub fn to_real_block_number(block_number: BlockNumber, latest_block_number: U64) } } +/// Returns a [jsonrpc_core::Error] indicating that the method is not implemented. +pub fn not_implemented( + method_name: &str, +) -> jsonrpc_core::BoxFuture> { + tracing::warn!("Method {} is not implemented", method_name); + Err(jsonrpc_core::Error { + data: None, + code: jsonrpc_core::ErrorCode::MethodNotFound, + message: format!("Method {} is not implemented", method_name), + }) + .into_boxed_future() +} + +/// Creates a [DebugCall] from a [L2Tx], [VmExecutionResultAndLogs] and a list of [Call]s. +pub fn create_debug_output( + l2_tx: &L2Tx, + result: &VmExecutionResultAndLogs, + traces: Vec, +) -> Result { + let calltype = if l2_tx.recipient_account() == CONTRACT_DEPLOYER_ADDRESS { + DebugCallType::Create + } else { + DebugCallType::Call + }; + match &result.result { + ExecutionResult::Success { output } => Ok(DebugCall { + gas_used: result.statistics.gas_used.into(), + output: output.clone().into(), + r#type: calltype, + from: l2_tx.initiator_account(), + to: l2_tx.recipient_account(), + gas: l2_tx.common_data.fee.gas_limit, + value: l2_tx.execute.value, + input: l2_tx.execute.calldata().into(), + error: None, + revert_reason: None, + calls: traces.into_iter().map(Into::into).collect(), + }), + ExecutionResult::Revert { output } => Ok(DebugCall { + gas_used: result.statistics.gas_used.into(), + output: Default::default(), + r#type: calltype, + from: l2_tx.initiator_account(), + to: l2_tx.recipient_account(), + gas: l2_tx.common_data.fee.gas_limit, + value: l2_tx.execute.value, + input: l2_tx.execute.calldata().into(), + error: None, + revert_reason: Some(output.to_string()), + calls: traces.into_iter().map(Into::into).collect(), + }), + ExecutionResult::Halt { reason } => Err(Web3Error::SubmitTransactionError( + reason.to_string(), + vec![], + )), + } +} + +/// Converts a timestamp in milliseconds since epoch to a [DateTime] in UTC. +pub fn utc_datetime_from_epoch_ms(millis: u64) -> DateTime { + let secs = millis / 1000; + let nanos = (millis % 1000) * 1_000_000; + // expect() is ok- nanos can't be >2M + DateTime::::from_timestamp(secs as i64, nanos as u32).expect("valid timestamp") +} + #[cfg(test)] mod tests { use zksync_basic_types::{H256, U256}; @@ -188,6 +260,18 @@ mod tests { use super::*; + #[test] + fn test_utc_datetime_from_epoch_ms() { + let actual = utc_datetime_from_epoch_ms(1623931200000); + assert_eq!( + DateTime::::from_naive_utc_and_offset( + chrono::NaiveDateTime::from_timestamp_opt(1623931200, 0).unwrap(), + Utc + ), + actual + ); + } + #[test] fn test_human_sizes() { assert_eq!("123", to_human_size(U256::from(123u64))); diff --git a/src/zks.rs b/src/zks.rs index 1aee8599..02df314a 100644 --- a/src/zks.rs +++ b/src/zks.rs @@ -2,20 +2,30 @@ use std::sync::{Arc, RwLock}; use bigdecimal::BigDecimal; use futures::FutureExt; -use zksync_basic_types::{MiniblockNumber, U256}; +use zksync_basic_types::{Address, L1BatchNumber, MiniblockNumber, U256}; use zksync_core::api_server::web3::backend_jsonrpc::{ - error::into_jsrpc_error, namespaces::zks::ZksNamespaceT, + error::{internal_error, into_jsrpc_error}, + namespaces::zks::ZksNamespaceT, }; +use zksync_state::ReadStorage; use zksync_types::{ - api::{BridgeAddresses, ProtocolVersion}, + api::{ + BlockDetails, BlockDetailsBase, BlockStatus, BridgeAddresses, ProtocolVersion, + TransactionDetails, TransactionStatus, TransactionVariant, + }, fee::Fee, + ExecuteTransactionCommon, ProtocolVersionId, Transaction, }; use zksync_web3_decl::{ error::Web3Error, types::{Filter, Log}, }; -use crate::{fork::ForkSource, node::InMemoryNodeInner, utils::IntoBoxedFuture}; +use crate::{ + fork::ForkSource, + node::{InMemoryNodeInner, TransactionResult, L2_GAS_PRICE}, + utils::{not_implemented, utc_datetime_from_epoch_ms, IntoBoxedFuture}, +}; use colored::Colorize; /// Mock implementation of ZksNamespace - used only in the test node. @@ -30,11 +40,6 @@ impl ZkMockNamespaceImpl { } } -macro_rules! not_implemented { - () => { - Box::pin(async move { Err(jsonrpc_core::Error::method_not_found()) }) - }; -} impl ZksNamespaceT for ZkMockNamespaceImpl { @@ -65,42 +70,132 @@ impl ZksNamespaceT } } + /// Returns data of transactions in a block. + /// + /// # Arguments + /// + /// * `block` - Block number + /// + /// # Returns + /// + /// A `BoxFuture` containing a `Result` with a `Vec` of `Transaction`s representing the transactions in the block. fn get_raw_block_transactions( &self, - _block_number: MiniblockNumber, + block_number: MiniblockNumber, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + let inner = self.node.clone(); + Box::pin(async move { + let reader = inner + .read() + .map_err(|_err| into_jsrpc_error(Web3Error::InternalError))?; + + let maybe_transactions = reader + .block_hashes + .get(&(block_number.0 as u64)) + .and_then(|hash| reader.blocks.get(hash)) + .map(|block| { + block + .transactions + .iter() + .map(|tx| match tx { + TransactionVariant::Full(tx) => &tx.hash, + TransactionVariant::Hash(hash) => hash, + }) + .flat_map(|tx_hash| { + reader.tx_results.get(tx_hash).map( + |TransactionResult { info, .. }| Transaction { + common_data: ExecuteTransactionCommon::L2( + info.tx.common_data.clone(), + ), + execute: info.tx.execute.clone(), + received_timestamp_ms: info.tx.received_timestamp_ms, + raw_bytes: info.tx.raw_bytes.clone(), + }, + ) + }) + .collect() + }); + + let transactions = match maybe_transactions { + Some(txns) => Ok(txns), + None => { + let fork_storage_read = reader + .fork_storage + .inner + .read() + .expect("failed reading fork storage"); + + match fork_storage_read.fork.as_ref() { + Some(fork) => fork + .fork_source + .get_raw_block_transactions(block_number) + .map_err(|e| internal_error("get_raw_block_transactions", e)), + None => Ok(vec![]), + } + } + } + .map_err(into_jsrpc_error)?; + + Ok(transactions) + }) } fn estimate_gas_l1_to_l2( &self, _req: zksync_types::transaction_request::CallRequest, ) -> jsonrpc_core::BoxFuture> { - not_implemented!() + not_implemented("zks_estimateGasL1ToL2") } fn get_main_contract( &self, ) -> jsonrpc_core::BoxFuture> { - not_implemented!() + not_implemented("zks_getMainContract") } fn get_testnet_paymaster( &self, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + not_implemented("zks_getTestnetPaymaster") } fn get_bridge_contracts( &self, ) -> jsonrpc_core::BoxFuture> { - not_implemented!() + let inner = self.node.clone(); + Box::pin(async move { + let reader = inner + .read() + .map_err(|_| into_jsrpc_error(Web3Error::InternalError))?; + + let result = match reader + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + { + Some(fork) => fork.fork_source.get_bridge_contracts().map_err(|err| { + tracing::error!("failed fetching bridge contracts from the fork: {:?}", err); + into_jsrpc_error(Web3Error::InternalError) + })?, + None => BridgeAddresses { + l1_erc20_default_bridge: Default::default(), + l2_erc20_default_bridge: Default::default(), + l1_weth_bridge: Default::default(), + l2_weth_bridge: Default::default(), + }, + }; + + Ok(result) + }) } fn l1_chain_id( &self, ) -> jsonrpc_core::BoxFuture> { - not_implemented!() + not_implemented("zks_L1ChainId") } fn get_confirmed_tokens( @@ -108,7 +203,7 @@ impl ZksNamespaceT _from: u32, _limit: u8, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + not_implemented("zks_getConfirmedTokens") } fn get_token_price( @@ -137,7 +232,7 @@ impl ZksNamespaceT Ok(1.into()).into_boxed_future() } address => { - log::error!( + tracing::error!( "{}", format!("Token price requested for unknown address {:?}", address).red() ); @@ -152,7 +247,7 @@ impl ZksNamespaceT ) -> jsonrpc_core::BoxFuture< jsonrpc_core::Result>, > { - not_implemented!() + not_implemented("zks_getAllAccountBalances") } fn get_l2_to_l1_msg_proof( @@ -163,7 +258,7 @@ impl ZksNamespaceT _l2_log_position: Option, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + not_implemented("zks_getL2ToL1MsgProof") } fn get_l2_to_l1_log_proof( @@ -172,21 +267,84 @@ impl ZksNamespaceT _index: Option, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + not_implemented("zks_getL2ToL1LogProof") } fn get_l1_batch_number( &self, ) -> jsonrpc_core::BoxFuture> { - not_implemented!() + not_implemented("zks_L1BatchNumber") } + /// Get block details. + /// + /// # Arguments + /// + /// * `blockNumber` - `u32` miniblock number + /// + /// # Returns + /// + /// A `BoxFuture` containing a `Result` with an `Option` representing details of the block (if found). fn get_block_details( &self, - _block_number: zksync_basic_types::MiniblockNumber, + block_number: zksync_basic_types::MiniblockNumber, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + let inner = self.node.clone(); + Box::pin(async move { + let reader = inner + .read() + .map_err(|_err| into_jsrpc_error(Web3Error::InternalError))?; + + let maybe_block = reader + .block_hashes + .get(&(block_number.0 as u64)) + .and_then(|hash| reader.blocks.get(hash)) + .map(|block| BlockDetails { + number: MiniblockNumber(block.number.as_u32()), + l1_batch_number: L1BatchNumber( + block.l1_batch_number.unwrap_or_default().as_u32(), + ), + base: BlockDetailsBase { + timestamp: block.timestamp.as_u64(), + l1_tx_count: 1, + l2_tx_count: block.transactions.len(), + root_hash: Some(block.hash), + status: BlockStatus::Verified, + commit_tx_hash: None, + committed_at: None, + prove_tx_hash: None, + proven_at: None, + execute_tx_hash: None, + executed_at: None, + l1_gas_price: 0, + l2_fair_gas_price: L2_GAS_PRICE, + base_system_contracts_hashes: reader + .system_contracts + .baseline_contracts + .hashes(), + }, + operator_address: Address::zero(), + protocol_version: Some(ProtocolVersionId::latest()), + }) + .or_else(|| { + reader + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + .and_then(|fork| { + fork.fork_source + .get_block_details(block_number) + .ok() + .flatten() + }) + }); + + Ok(maybe_block) + }) } fn get_miniblock_range( @@ -195,50 +353,143 @@ impl ZksNamespaceT ) -> jsonrpc_core::BoxFuture< jsonrpc_core::Result>, > { - not_implemented!() + not_implemented("zks_getL1BatchBlockRange") } + /// Get transaction details. + /// + /// # Arguments + /// + /// * `transactionHash` - `H256` hash of the transaction + /// + /// # Returns + /// + /// A `BoxFuture` containing a `Result` with an `Option` representing details of the transaction (if found). fn get_transaction_details( &self, - _hash: zksync_basic_types::H256, + hash: zksync_basic_types::H256, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + let inner = self.node.clone(); + Box::pin(async move { + let reader = inner + .read() + .map_err(|_err| into_jsrpc_error(Web3Error::InternalError))?; + + let maybe_result = { + reader + .tx_results + .get(&hash) + .map(|TransactionResult { info, receipt, .. }| { + TransactionDetails { + is_l1_originated: false, + status: TransactionStatus::Included, + // if these are not set, fee is effectively 0 + fee: receipt.effective_gas_price.unwrap_or_default() + * receipt.gas_used.unwrap_or_default(), + gas_per_pubdata: info.tx.common_data.fee.gas_per_pubdata_limit, + initiator_address: info.tx.initiator_account(), + received_at: utc_datetime_from_epoch_ms(info.tx.received_timestamp_ms), + eth_commit_tx_hash: None, + eth_prove_tx_hash: None, + eth_execute_tx_hash: None, + } + }) + .or_else(|| { + reader + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + .and_then(|fork| { + fork.fork_source + .get_transaction_details(hash) + .ok() + .flatten() + }) + }) + }; + + Ok(maybe_result) + }) } + /// Retrieves details for a given L1 batch. + /// + /// This method is intended to handle queries related to L1 batch details. However, as of the current implementation, + /// L1 communication is not supported. Instead of an error or no method found, this method intentionally returns + /// `{"jsonrpc":"2.0","result":null,"id":1}` to ensure compatibility with block explorer integration. + /// + /// # Parameters + /// + /// * `_batch`: The batch number of type `zksync_basic_types::L1BatchNumber` for which the details are to be fetched. + /// + /// # Returns + /// + /// A boxed future resolving to a `jsonrpc_core::Result` containing an `Option` of `zksync_types::api::L1BatchDetails`. + /// Given the current implementation, this will always be `None`. fn get_l1_batch_details( &self, _batch: zksync_basic_types::L1BatchNumber, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + Box::pin(async { Ok(None) }) } + /// Returns bytecode of a transaction given by its hash. + /// + /// # Parameters + /// + /// * `hash`: Hash address. + /// + /// # Returns + /// + /// A boxed future resolving to a `jsonrpc_core::Result` containing an `Option` of bytes. fn get_bytecode_by_hash( &self, - _hash: zksync_basic_types::H256, + hash: zksync_basic_types::H256, ) -> jsonrpc_core::BoxFuture>>> { - not_implemented!() + let inner = self.node.clone(); + Box::pin(async move { + let mut writer = inner + .write() + .map_err(|_| into_jsrpc_error(Web3Error::InternalError))?; + + let maybe_bytecode = writer.fork_storage.load_factory_dep(hash).or_else(|| { + writer + .fork_storage + .inner + .read() + .expect("failed reading fork storage") + .fork + .as_ref() + .and_then(|fork| fork.fork_source.get_bytecode_by_hash(hash).ok().flatten()) + }); + + Ok(maybe_bytecode) + }) } fn get_l1_gas_price( &self, ) -> jsonrpc_core::BoxFuture> { - not_implemented!() + not_implemented("zks_getL1GasPrice") } fn get_protocol_version( &self, _version_id: Option, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + not_implemented("zks_getProtocolVersion") } fn get_logs_with_virtual_blocks( &self, _filter: Filter, ) -> jsonrpc_core::BoxFuture>> { - not_implemented!() + not_implemented("zks_getLogs") } } @@ -246,12 +497,15 @@ impl ZksNamespaceT mod tests { use std::str::FromStr; - use crate::node::ShowCalls; - use crate::system_contracts; + use crate::cache::CacheConfig; + use crate::fork::ForkDetails; + use crate::testing; + use crate::testing::{ForkBlockConfig, MockServer}; use crate::{http_fork_source::HttpForkSource, node::InMemoryNode}; use super::*; - use zksync_basic_types::Address; + use zksync_basic_types::{Address, H160, H256}; + use zksync_types::api::{self, Block, TransactionReceipt, TransactionVariant}; use zksync_types::transaction_request::CallRequest; #[tokio::test] @@ -284,7 +538,7 @@ mod tests { let result = namespace.estimate_fee(mock_request).await.unwrap(); - assert_eq!(result.gas_limit, U256::from(1087416)); + assert_eq!(result.gas_limit, U256::from(731457)); assert_eq!(result.max_fee_per_gas, U256::from(250000000)); assert_eq!(result.max_priority_fee_per_gas, U256::from(0)); assert_eq!(result.gas_per_pubdata_limit, U256::from(4080)); @@ -309,15 +563,7 @@ mod tests { #[tokio::test] async fn test_get_token_price_given_capitalized_link_address_should_return_price() { // Arrange - let node = InMemoryNode::::new( - None, - ShowCalls::None, - crate::node::ShowStorageLogs::None, - crate::node::ShowVMDetails::None, - crate::node::ShowGasDetails::None, - false, - &system_contracts::Options::BuiltIn, - ); + let node = InMemoryNode::::default(); let namespace = ZkMockNamespaceImpl::new(node.get_inner()); let mock_address = Address::from_str("0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78") @@ -345,4 +591,438 @@ mod tests { // Assert assert!(result.is_err()); } + + #[tokio::test] + async fn test_get_transaction_details_local() { + // Arrange + let node = InMemoryNode::::default(); + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + let inner = node.get_inner(); + { + let mut writer = inner.write().unwrap(); + writer.tx_results.insert( + H256::repeat_byte(0x1), + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: TransactionReceipt { + logs: vec![], + gas_used: Some(U256::from(10_000)), + effective_gas_price: Some(U256::from(1_000_000_000)), + ..Default::default() + }, + debug: testing::default_tx_debug_info(), + }, + ); + } + // Act + let result = namespace + .get_transaction_details(H256::repeat_byte(0x1)) + .await + .expect("get transaction details") + .expect("transaction details"); + + // Assert + assert!(matches!(result.status, TransactionStatus::Included)); + assert_eq!(result.fee, U256::from(10_000_000_000_000u64)); + } + + #[tokio::test] + async fn test_get_transaction_details_fork() { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_tx_hash = H256::repeat_byte(0x02); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "zks_getTransactionDetails", + "params": [ + format!("{:#x}", input_tx_hash), + ], + }), + serde_json::json!({ + "jsonrpc": "2.0", + "result": { + "isL1Originated": false, + "status": "included", + "fee": "0x74293f087500", + "gasPerPubdata": "0x4e20", + "initiatorAddress": "0x63ab285cd87a189f345fed7dd4e33780393e01f0", + "receivedAt": "2023-10-12T15:45:53.094Z", + "ethCommitTxHash": null, + "ethProveTxHash": null, + "ethExecuteTxHash": null + }, + "id": 0 + }), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + let result = namespace + .get_transaction_details(input_tx_hash) + .await + .expect("get transaction details") + .expect("transaction details"); + + assert!(matches!(result.status, TransactionStatus::Included)); + assert_eq!(result.fee, U256::from(127_720_500_000_000u64)); + } + + #[tokio::test] + async fn test_get_block_details_local() { + // Arrange + let node = InMemoryNode::::default(); + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + let inner = node.get_inner(); + { + let mut writer = inner.write().unwrap(); + let block = Block::::default(); + writer.blocks.insert(H256::repeat_byte(0x1), block); + writer.block_hashes.insert(0, H256::repeat_byte(0x1)); + } + // Act + let result = namespace + .get_block_details(MiniblockNumber(0)) + .await + .expect("get block details") + .expect("block details"); + + // Assert + assert!(matches!(result.number, MiniblockNumber(0))); + assert_eq!(result.l1_batch_number, L1BatchNumber(0)); + assert_eq!(result.base.timestamp, 0); + } + + #[tokio::test] + async fn test_get_block_details_fork() { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let miniblock = MiniblockNumber::from(16474138); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "zks_getBlockDetails", + "params": [ + miniblock.0, + ], + }), + serde_json::json!({ + "jsonrpc": "2.0", + "result": { + "number": 16474138, + "l1BatchNumber": 270435, + "timestamp": 1697405098, + "l1TxCount": 0, + "l2TxCount": 1, + "rootHash": "0xd9e60f9a684fd7fc16e87ae923341a6e4af24f286e76612efdfc2d55f3f4d064", + "status": "sealed", + "commitTxHash": null, + "committedAt": null, + "proveTxHash": null, + "provenAt": null, + "executeTxHash": null, + "executedAt": null, + "l1GasPrice": 6156252068u64, + "l2FairGasPrice": 250000000u64, + "baseSystemContractsHashes": { + "bootloader": "0x0100089b8a2f2e6a20ba28f02c9e0ed0c13d702932364561a0ea61621f65f0a8", + "default_aa": "0x0100067d16a5485875b4249040bf421f53e869337fe118ec747cf40a4c777e5f" + }, + "operatorAddress": "0xa9232040bf0e0aea2578a5b2243f2916dbfc0a69", + "protocolVersion": "Version15" + }, + "id": 0 + }), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + let result = namespace + .get_block_details(miniblock) + .await + .expect("get block details") + .expect("block details"); + + assert!(matches!(result.number, MiniblockNumber(16474138))); + assert_eq!(result.l1_batch_number, L1BatchNumber(270435)); + assert_eq!(result.base.timestamp, 1697405098); + } + + #[tokio::test] + async fn test_get_bridge_contracts_uses_default_values_if_local() { + // Arrange + let node = InMemoryNode::::default(); + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + let expected_bridge_addresses = BridgeAddresses { + l1_erc20_default_bridge: Default::default(), + l2_erc20_default_bridge: Default::default(), + l1_weth_bridge: Default::default(), + l2_weth_bridge: Default::default(), + }; + + // Act + let actual_bridge_addresses = namespace + .get_bridge_contracts() + .await + .expect("get bridge addresses"); + + // Assert + testing::assert_bridge_addresses_eq(&expected_bridge_addresses, &actual_bridge_addresses) + } + + #[tokio::test] + async fn test_get_bridge_contracts_uses_fork() { + // Arrange + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_bridge_addresses = BridgeAddresses { + l1_erc20_default_bridge: H160::repeat_byte(0x1), + l2_erc20_default_bridge: H160::repeat_byte(0x2), + l1_weth_bridge: Some(H160::repeat_byte(0x3)), + l2_weth_bridge: Some(H160::repeat_byte(0x4)), + }; + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "zks_getBridgeContracts", + }), + serde_json::json!({ + "jsonrpc": "2.0", + "result": { + "l1Erc20DefaultBridge": format!("{:#x}", input_bridge_addresses.l1_erc20_default_bridge), + "l2Erc20DefaultBridge": format!("{:#x}", input_bridge_addresses.l2_erc20_default_bridge), + "l1WethBridge": format!("{:#x}", input_bridge_addresses.l1_weth_bridge.clone().unwrap()), + "l2WethBridge": format!("{:#x}", input_bridge_addresses.l2_weth_bridge.clone().unwrap()) + }, + "id": 0 + }), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + + // Act + let actual_bridge_addresses = namespace + .get_bridge_contracts() + .await + .expect("get bridge addresses"); + + // Assert + testing::assert_bridge_addresses_eq(&input_bridge_addresses, &actual_bridge_addresses) + } + + #[tokio::test] + async fn test_get_bytecode_by_hash_returns_local_value_if_available() { + // Arrange + let node = InMemoryNode::::default(); + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + let input_hash = H256::repeat_byte(0x1); + let input_bytecode = vec![0x1]; + node.get_inner() + .write() + .unwrap() + .fork_storage + .store_factory_dep(input_hash, input_bytecode.clone()); + + // Act + let actual = namespace + .get_bytecode_by_hash(input_hash) + .await + .expect("failed fetching bytecode") + .expect("no bytecode was found"); + + // Assert + assert_eq!(input_bytecode, actual); + } + + #[tokio::test] + async fn test_get_bytecode_by_hash_uses_fork_if_value_unavailable() { + // Arrange + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let input_hash = H256::repeat_byte(0x1); + let input_bytecode = vec![0x1]; + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "zks_getBytecodeByHash", + "params": [ + format!("{:#x}", input_hash) + ], + }), + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "result": input_bytecode, + }), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + + // Act + let actual = namespace + .get_bytecode_by_hash(input_hash) + .await + .expect("failed fetching bytecode") + .expect("no bytecode was found"); + + // Assert + assert_eq!(input_bytecode, actual); + } + + #[tokio::test] + async fn test_get_raw_block_transactions_local() { + // Arrange + let node = InMemoryNode::::default(); + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + let inner = node.get_inner(); + { + let mut writer = inner.write().unwrap(); + let mut block = Block::::default(); + let txn = api::Transaction::default(); + writer.tx_results.insert( + txn.hash, + TransactionResult { + info: testing::default_tx_execution_info(), + receipt: TransactionReceipt { + logs: vec![], + gas_used: Some(U256::from(10_000)), + effective_gas_price: Some(U256::from(1_000_000_000)), + ..Default::default() + }, + debug: testing::default_tx_debug_info(), + }, + ); + block.transactions.push(TransactionVariant::Full(txn)); + writer.blocks.insert(H256::repeat_byte(0x1), block); + writer.block_hashes.insert(0, H256::repeat_byte(0x1)); + } + + // Act + let txns = namespace + .get_raw_block_transactions(MiniblockNumber(0)) + .await + .expect("get transaction details"); + + // Assert + assert_eq!(txns.len(), 1); + } + + #[tokio::test] + async fn test_get_raw_block_transactions_fork() { + let mock_server = MockServer::run_with_config(ForkBlockConfig { + number: 10, + transaction_count: 0, + hash: H256::repeat_byte(0xab), + }); + let miniblock = MiniblockNumber::from(16474138); + mock_server.expect( + serde_json::json!({ + "jsonrpc": "2.0", + "id": 0, + "method": "zks_getRawBlockTransactions", + "params": [miniblock.0] + }), + serde_json::json!({ + "jsonrpc": "2.0", + "result": [ + { + "common_data": { + "L2": { + "nonce": 86, + "fee": { + "gas_limit": "0xcc626", + "max_fee_per_gas": "0x141dd760", + "max_priority_fee_per_gas": "0x0", + "gas_per_pubdata_limit": "0x4e20" + }, + "initiatorAddress": "0x840bd73f903ba7dbb501be8326fe521dadcae1a5", + "signature": [ + 135, + 163, + 2, + 78, + 118, + 14, + 209 + ], + "transactionType": "EIP1559Transaction", + "input": { + "hash": "0xc1f625f55d186ad0b439054adfe3317ae703c5f588f4fa1896215e8810a141e0", + "data": [ + 2, + 249, + 1, + 110, + 130 + ] + }, + "paymasterParams": { + "paymaster": "0x0000000000000000000000000000000000000000", + "paymasterInput": [] + } + } + }, + "execute": { + "contractAddress": "0xbe7d1fd1f6748bbdefc4fbacafbb11c6fc506d1d", + "calldata": "0x38ed173900000000000000000000000000000000000000000000000000000000002c34cc00000000000000000000000000000000000000000000000000000000002c9a2500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000840bd73f903ba7dbb501be8326fe521dadcae1a500000000000000000000000000000000000000000000000000000000652c5d1900000000000000000000000000000000000000000000000000000000000000020000000000000000000000008e86e46278518efc1c5ced245cba2c7e3ef115570000000000000000000000003355df6d4c9c3035724fd0e3914de96a5a83aaf4", + "value": "0x0", + "factoryDeps": null + }, + "received_timestamp_ms": 1697405097873u64, + "raw_bytes": "0x02f9016e820144568084141dd760830cc62694be7d1fd1f6748bbdefc4fbacafbb11c6fc506d1d80b9010438ed173900000000000000000000000000000000000000000000000000000000002c34cc00000000000000000000000000000000000000000000000000000000002c9a2500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000840bd73f903ba7dbb501be8326fe521dadcae1a500000000000000000000000000000000000000000000000000000000652c5d1900000000000000000000000000000000000000000000000000000000000000020000000000000000000000008e86e46278518efc1c5ced245cba2c7e3ef115570000000000000000000000003355df6d4c9c3035724fd0e3914de96a5a83aaf4c080a087a3024e760ed14134ef541608bf308e083c899a89dba3c02bf3040f07c8b91b9fc3a7eeb6b3b8b36bb03ea4352415e7815dda4954f4898d255bd7660736285e" + } + ], + "id": 0 + }), + ); + + let node = InMemoryNode::::new( + Some(ForkDetails::from_network(&mock_server.url(), None, CacheConfig::None).await), + None, + Default::default(), + ); + + let namespace = ZkMockNamespaceImpl::new(node.get_inner()); + let txns = namespace + .get_raw_block_transactions(miniblock) + .await + .expect("get transaction details"); + assert_eq!(txns.len(), 1); + } } diff --git a/test_endpoints.http b/test_endpoints.http index 30bd0f20..bc130ba2 100644 --- a/test_endpoints.http +++ b/test_endpoints.http @@ -134,6 +134,58 @@ content-type: application/json POST http://localhost:8011 content-type: application/json +{ + "jsonrpc": "2.0", + "id": "1", + "method": "debug_traceCall", + "params": [{ + "to": "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049", + "data": "0x0000", + "from": "0xa61464658AfeAf65CccaaFD3a512b69A83B77618", + "gas": "0x0000", + "gasPrice": "0x0000", + "value": "0x0000", + "nonce": "0x0000" + }, "latest"] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "debug_traceTransaction", + "params": ["0xd3a94ff697a573cb174ecce05126e952ecea6dee051526a3e389747ff86b0d99", { "tracer": "callTracer", "tracerConfig": { "onlyTopCall": true } }] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "debug_traceBlockByHash", + "params": ["0xd3a94ff697a573cb174ecce05126e952ecea6dee051526a3e389747ff86b0d99", { "tracer": "callTracer", "tracerConfig": { "onlyTopCall": true } }] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "debug_traceBlockByNumber", + "params": ["0xddd", { "tracer": "callTracer", "tracerConfig": { "onlyTopCall": true } }] +} + +### +POST http://localhost:8011 +content-type: application/json + { "jsonrpc": "2.0", "id": "1", @@ -331,6 +383,28 @@ content-type: application/json POST http://localhost:8011 content-type: application/json +{ + "jsonrpc": "2.0", + "id": "1", + "method": "evm_snapshot", + "params": [] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "evm_revert", + "params": ["0x1"] +} + +### +POST http://localhost:8011 +content-type: application/json + { "jsonrpc": "2.0", "id": "2", @@ -476,6 +550,49 @@ content-type: application/json POST http://localhost:8011 content-type: application/json +{ + "jsonrpc": "2.0", + "id": "2", + "method": "eth_getStorageAt", + "params": ["0x123456789abcdef123456789abcdef1234567890", "0x0", "latest"] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "2", + "method": "eth_getTransactionByBlockHashAndIndex", + "params": ["0x123456789abcdef123456789abcdef1234567890", "0x1"] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "2", + "method": "eth_getTransactionByBlockNumberAndIndex", + "params": ["latest", "0x1"] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "2", + "method": "eth_protocolVersion" +} + +### +POST http://localhost:8011 +content-type: application/json + { "jsonrpc": "2.0", "id": "2", @@ -544,6 +661,20 @@ content-type: application/json POST http://localhost:8011 content-type: application/json +{ + "jsonrpc": "2.0", + "id": "2", + "method": "hardhat_setCode", + "params": [ + "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049", + [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] + ] +} + +### +POST http://localhost:8011 +content-type: application/json + { "jsonrpc": "2.0", "id": "1", @@ -555,6 +686,49 @@ content-type: application/json POST http://localhost:8011 content-type: application/json +{ + "jsonrpc": "2.0", + "id": "1", + "method": "zks_getTransactionDetails", + "params": ["0xa5d62a85561295ed58f8daad4e9442691e6da4301a859f364d28a02917d6e04d"] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "zks_getBlockDetails", + "params": [16474138] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "zks_getBridgeContracts", +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "zks_getRawBlockTransactions", + "params": [16474138] +} + +### +POST http://localhost:8011 +content-type: application/json + { "jsonrpc": "2.0", "id": "1", @@ -571,4 +745,26 @@ content-type: application/json "id": "1", "method": "eth_accounts", "params": [] -} \ No newline at end of file +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "config_setLogLevel", + "params": ["trace"] +} + +### +POST http://localhost:8011 +content-type: application/json + +{ + "jsonrpc": "2.0", + "id": "1", + "method": "config_setLogging", + "params": ["era_test_node=info,hyper=debug"] +}