From 904767336378f847ee846df0f82865b99008754d Mon Sep 17 00:00:00 2001 From: Nisheeth Barthwal Date: Tue, 19 Nov 2024 11:21:26 +0100 Subject: [PATCH] remove zksync-web3-rs --- Cargo.lock | 1498 +++++----------------- Cargo.toml | 6 +- crates/cast/Cargo.toml | 4 +- crates/cast/bin/cmd/send.rs | 79 +- crates/cast/src/lib.rs | 69 + crates/cheatcodes/Cargo.toml | 1 - crates/cheatcodes/src/inspector.rs | 2 +- crates/cli/Cargo.toml | 1 - crates/cli/src/opts/build/zksync.rs | 2 +- crates/common/src/provider/mod.rs | 6 + crates/forge/Cargo.toml | 1 - crates/forge/bin/cmd/create.rs | 27 +- crates/script/Cargo.toml | 4 +- crates/script/src/broadcast.rs | 133 +- crates/zksync/core/Cargo.toml | 5 - crates/zksync/core/src/convert.rs | 67 - crates/zksync/core/src/convert/eip712.rs | 242 ---- crates/zksync/core/src/lib.rs | 123 +- crates/zksync/core/src/utils.rs | 2 +- deny.toml | 2 - 20 files changed, 505 insertions(+), 1769 deletions(-) delete mode 100644 crates/zksync/core/src/convert/eip712.rs diff --git a/Cargo.lock b/Cargo.lock index f2e6f7779..717976217 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,27 +96,27 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy" -version = "0.4.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "056f2c01b2aed86e15b43c47d109bfc8b82553dc34e66452875e51247ec31ab2" +checksum = "ea8ebf106e84a1c37f86244df7da0c7587e697b71a0d565cce079449b85ac6f8" dependencies = [ - "alloy-consensus 0.4.2", - "alloy-contract 0.4.2", + "alloy-consensus", + "alloy-contract", "alloy-core", - "alloy-eips 0.4.2", - "alloy-genesis 0.4.2", - "alloy-network 0.4.2", - "alloy-provider 0.4.2", - "alloy-pubsub 0.4.2", - "alloy-rpc-client 0.4.2", - "alloy-rpc-types 0.4.2", - "alloy-serde 0.4.2", - "alloy-signer 0.4.2", - "alloy-signer-local 0.4.2", - "alloy-transport 0.4.2", - "alloy-transport-http 0.4.2", - "alloy-transport-ipc 0.4.2", - "alloy-transport-ws 0.4.2", + "alloy-eips", + "alloy-genesis", + "alloy-network", + "alloy-provider", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-signer-local", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", ] [[package]] @@ -131,58 +131,21 @@ dependencies = [ "strum", ] -[[package]] -name = "alloy-consensus" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705687d5bfd019fee57cf9e206b27b30a9a9617535d5590a02b171e813208f8e" -dependencies = [ - "alloy-eips 0.4.2", - "alloy-primitives", - "alloy-rlp", - "alloy-serde 0.4.2", - "auto_impl", - "c-kzg", - "derive_more 1.0.0", - "serde", -] - [[package]] name = "alloy-consensus" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-eips 0.5.4", + "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.5.4", + "alloy-serde", "auto_impl", "c-kzg", "derive_more 1.0.0", "serde", ] -[[package]] -name = "alloy-contract" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917f7d12cf3971dc8c11c9972f732b35ccb9aaaf5f28f2f87e9e6523bee3a8ad" -dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-network 0.4.2", - "alloy-network-primitives 0.4.2", - "alloy-primitives", - "alloy-provider 0.4.2", - "alloy-pubsub 0.4.2", - "alloy-rpc-types-eth 0.4.2", - "alloy-sol-types", - "alloy-transport 0.4.2", - "futures 0.3.31", - "futures-util", - "thiserror", -] - [[package]] name = "alloy-contract" version = "0.5.4" @@ -190,14 +153,14 @@ source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f14 dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-network 0.5.4", - "alloy-network-primitives 0.5.4", + "alloy-network", + "alloy-network-primitives", "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-pubsub 0.5.4", - "alloy-rpc-types-eth 0.5.4", + "alloy-provider", + "alloy-pubsub", + "alloy-rpc-types-eth", "alloy-sol-types", - "alloy-transport 0.5.4", + "alloy-transport", "futures 0.3.31", "futures-util", "thiserror", @@ -250,18 +213,6 @@ dependencies = [ "serde", ] -[[package]] -name = "alloy-eip7702" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea59dc42102bc9a1905dc57901edc6dd48b9f38115df86c7d252acba70d71d04" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "k256 0.13.4", - "serde", -] - [[package]] name = "alloy-eip7702" version = "0.3.2" @@ -277,34 +228,16 @@ dependencies = [ "serde", ] -[[package]] -name = "alloy-eips" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffb906284a1e1f63c4607da2068c8197458a352d0b3e9796e67353d72a9be85" -dependencies = [ - "alloy-eip2930", - "alloy-eip7702 0.1.1", - "alloy-primitives", - "alloy-rlp", - "alloy-serde 0.4.2", - "c-kzg", - "derive_more 1.0.0", - "once_cell", - "serde", - "sha2 0.10.8", -] - [[package]] name = "alloy-eips" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ "alloy-eip2930", - "alloy-eip7702 0.3.2", + "alloy-eip7702", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.5.4", + "alloy-serde", "c-kzg", "derive_more 1.0.0", "once_cell", @@ -312,24 +245,13 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "alloy-genesis" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8429cf4554eed9b40feec7f4451113e76596086447550275e3def933faf47ce3" -dependencies = [ - "alloy-primitives", - "alloy-serde 0.4.2", - "serde", -] - [[package]] name = "alloy-genesis" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ "alloy-primitives", - "alloy-serde 0.5.4", + "alloy-serde", "serde", ] @@ -345,20 +267,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "alloy-json-rpc" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fa8a1a3c4cbd221f2b8e3693aeb328fca79a757fe556ed08e47bbbc2a70db7" -dependencies = [ - "alloy-primitives", - "alloy-sol-types", - "serde", - "serde_json", - "thiserror", - "tracing", -] - [[package]] name = "alloy-json-rpc" version = "0.5.4" @@ -372,40 +280,19 @@ dependencies = [ "tracing", ] -[[package]] -name = "alloy-network" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85fa23a6a9d612b52e402c995f2d582c25165ec03ac6edf64c861a76bc5b87cd" -dependencies = [ - "alloy-consensus 0.4.2", - "alloy-eips 0.4.2", - "alloy-json-rpc 0.4.2", - "alloy-network-primitives 0.4.2", - "alloy-primitives", - "alloy-rpc-types-eth 0.4.2", - "alloy-serde 0.4.2", - "alloy-signer 0.4.2", - "alloy-sol-types", - "async-trait", - "auto_impl", - "futures-utils-wasm", - "thiserror", -] - [[package]] name = "alloy-network" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-eips 0.5.4", - "alloy-json-rpc 0.5.4", - "alloy-network-primitives 0.5.4", + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network-primitives", "alloy-primitives", - "alloy-rpc-types-eth 0.5.4", - "alloy-serde 0.5.4", - "alloy-signer 0.5.4", + "alloy-rpc-types-eth", + "alloy-serde", + "alloy-signer", "alloy-sol-types", "async-trait", "auto_impl", @@ -413,28 +300,15 @@ dependencies = [ "thiserror", ] -[[package]] -name = "alloy-network-primitives" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801492711d4392b2ccf5fc0bc69e299fa1aab15167d74dcaa9aab96a54f684bd" -dependencies = [ - "alloy-consensus 0.4.2", - "alloy-eips 0.4.2", - "alloy-primitives", - "alloy-serde 0.4.2", - "serde", -] - [[package]] name = "alloy-network-primitives" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-eips 0.5.4", + "alloy-consensus", + "alloy-eips", "alloy-primitives", - "alloy-serde 0.5.4", + "alloy-serde", "serde", ] @@ -470,64 +344,27 @@ dependencies = [ "tiny-keccak 2.0.2", ] -[[package]] -name = "alloy-provider" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcfaa4ffec0af04e3555686b8aacbcdf7d13638133a0672749209069750f78a6" -dependencies = [ - "alloy-chains", - "alloy-consensus 0.4.2", - "alloy-eips 0.4.2", - "alloy-json-rpc 0.4.2", - "alloy-network 0.4.2", - "alloy-network-primitives 0.4.2", - "alloy-primitives", - "alloy-pubsub 0.4.2", - "alloy-rpc-client 0.4.2", - "alloy-rpc-types-eth 0.4.2", - "alloy-transport 0.4.2", - "alloy-transport-http 0.4.2", - "alloy-transport-ipc 0.4.2", - "alloy-transport-ws 0.4.2", - "async-stream", - "async-trait", - "auto_impl", - "dashmap 6.1.0", - "futures 0.3.31", - "futures-utils-wasm", - "lru", - "pin-project 1.1.7", - "reqwest 0.12.9", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "url", -] - [[package]] name = "alloy-provider" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ "alloy-chains", - "alloy-consensus 0.5.4", - "alloy-eips 0.5.4", - "alloy-json-rpc 0.5.4", - "alloy-network 0.5.4", - "alloy-network-primitives 0.5.4", + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network", + "alloy-network-primitives", "alloy-primitives", - "alloy-pubsub 0.5.4", - "alloy-rpc-client 0.5.4", - "alloy-rpc-types-eth 0.5.4", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types-eth", "alloy-rpc-types-trace", "alloy-rpc-types-txpool", - "alloy-transport 0.5.4", - "alloy-transport-http 0.5.4", - "alloy-transport-ipc 0.5.4", - "alloy-transport-ws 0.5.4", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", "async-stream", "async-trait", "auto_impl", @@ -548,33 +385,14 @@ dependencies = [ "wasmtimer", ] -[[package]] -name = "alloy-pubsub" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32cef487122ae75c91eb50154c70801d71fabdb976fec6c49e0af5e6486ab15" -dependencies = [ - "alloy-json-rpc 0.4.2", - "alloy-primitives", - "alloy-transport 0.4.2", - "bimap", - "futures 0.3.31", - "serde", - "serde_json", - "tokio", - "tokio-stream", - "tower 0.5.1", - "tracing", -] - [[package]] name = "alloy-pubsub" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-json-rpc 0.5.4", + "alloy-json-rpc", "alloy-primitives", - "alloy-transport 0.5.4", + "alloy-transport", "bimap", "futures 0.3.31", "serde", @@ -607,43 +425,18 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "alloy-rpc-client" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "370143ed581aace6e663342d21d209c6b2e34ee6142f7d6675adb518deeaf0dc" -dependencies = [ - "alloy-json-rpc 0.4.2", - "alloy-primitives", - "alloy-pubsub 0.4.2", - "alloy-transport 0.4.2", - "alloy-transport-http 0.4.2", - "alloy-transport-ipc 0.4.2", - "alloy-transport-ws 0.4.2", - "futures 0.3.31", - "pin-project 1.1.7", - "reqwest 0.12.9", - "serde", - "serde_json", - "tokio", - "tokio-stream", - "tower 0.5.1", - "tracing", - "url", -] - [[package]] name = "alloy-rpc-client" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-json-rpc 0.5.4", + "alloy-json-rpc", "alloy-primitives", - "alloy-pubsub 0.5.4", - "alloy-transport 0.5.4", - "alloy-transport-http 0.5.4", - "alloy-transport-ipc 0.5.4", - "alloy-transport-ws 0.5.4", + "alloy-pubsub", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", "futures 0.3.31", "pin-project 1.1.7", "reqwest 0.12.9", @@ -657,19 +450,6 @@ dependencies = [ "wasmtimer", ] -[[package]] -name = "alloy-rpc-types" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ffc534b7919e18f35e3aa1f507b6f3d9d92ec298463a9f6beaac112809d8d06" -dependencies = [ - "alloy-primitives", - "alloy-rpc-types-engine 0.4.2", - "alloy-rpc-types-eth 0.4.2", - "alloy-serde 0.4.2", - "serde", -] - [[package]] name = "alloy-rpc-types" version = "0.5.4" @@ -677,11 +457,11 @@ source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f14 dependencies = [ "alloy-primitives", "alloy-rpc-types-anvil", - "alloy-rpc-types-engine 0.5.4", - "alloy-rpc-types-eth 0.5.4", + "alloy-rpc-types-engine", + "alloy-rpc-types-eth", "alloy-rpc-types-trace", "alloy-rpc-types-txpool", - "alloy-serde 0.5.4", + "alloy-serde", "serde", ] @@ -691,71 +471,38 @@ version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ "alloy-primitives", - "alloy-serde 0.5.4", + "alloy-serde", "serde", ] -[[package]] -name = "alloy-rpc-types-engine" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0285c4c09f838ab830048b780d7f4a4f460f309aa1194bb049843309524c64c" -dependencies = [ - "alloy-consensus 0.4.2", - "alloy-eips 0.4.2", - "alloy-primitives", - "alloy-rlp", - "derive_more 1.0.0", - "strum", -] - [[package]] name = "alloy-rpc-types-engine" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-eips 0.5.4", + "alloy-consensus", + "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.5.4", + "alloy-serde", "derive_more 1.0.0", - "jsonwebtoken 9.3.0", + "jsonwebtoken", "rand 0.8.5", "serde", "strum", ] -[[package]] -name = "alloy-rpc-types-eth" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413f4aa3ccf2c3e4234a047c5fa4727916d7daf25a89f9b765df0ba09784fd87" -dependencies = [ - "alloy-consensus 0.4.2", - "alloy-eips 0.4.2", - "alloy-network-primitives 0.4.2", - "alloy-primitives", - "alloy-rlp", - "alloy-serde 0.4.2", - "alloy-sol-types", - "derive_more 1.0.0", - "itertools 0.13.0", - "serde", - "serde_json", -] - [[package]] name = "alloy-rpc-types-eth" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-eips 0.5.4", - "alloy-network-primitives 0.5.4", + "alloy-consensus", + "alloy-eips", + "alloy-network-primitives", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.5.4", + "alloy-serde", "alloy-sol-types", "derive_more 1.0.0", "itertools 0.13.0", @@ -769,8 +516,8 @@ version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ "alloy-primitives", - "alloy-rpc-types-eth 0.5.4", - "alloy-serde 0.5.4", + "alloy-rpc-types-eth", + "alloy-serde", "serde", "serde_json", "thiserror", @@ -782,22 +529,11 @@ version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ "alloy-primitives", - "alloy-rpc-types-eth 0.5.4", - "alloy-serde 0.5.4", + "alloy-rpc-types-eth", + "alloy-serde", "serde", ] -[[package]] -name = "alloy-serde" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dff0ab1cdd43ca001e324dc27ee0e8606bd2161d6623c63e0e0b8c4dfc13600" -dependencies = [ - "alloy-primitives", - "serde", - "serde_json", -] - [[package]] name = "alloy-serde" version = "0.5.4" @@ -808,20 +544,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "alloy-signer" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd4e0ad79c81a27ca659be5d176ca12399141659fef2bcbfdc848da478f4504" -dependencies = [ - "alloy-primitives", - "async-trait", - "auto_impl", - "elliptic-curve 0.13.8", - "k256 0.13.4", - "thiserror", -] - [[package]] name = "alloy-signer" version = "0.5.4" @@ -842,10 +564,10 @@ name = "alloy-signer-aws" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-network 0.5.4", + "alloy-consensus", + "alloy-network", "alloy-primitives", - "alloy-signer 0.5.4", + "alloy-signer", "async-trait", "aws-sdk-kms", "k256 0.13.4", @@ -859,10 +581,10 @@ name = "alloy-signer-gcp" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-network 0.5.4", + "alloy-consensus", + "alloy-network", "alloy-primitives", - "alloy-signer 0.5.4", + "alloy-signer", "async-trait", "gcloud-sdk", "k256 0.13.4", @@ -876,11 +598,11 @@ name = "alloy-signer-ledger" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", + "alloy-consensus", "alloy-dyn-abi", - "alloy-network 0.5.4", + "alloy-network", "alloy-primitives", - "alloy-signer 0.5.4", + "alloy-signer", "alloy-sol-types", "async-trait", "coins-ledger", @@ -890,34 +612,18 @@ dependencies = [ "tracing", ] -[[package]] -name = "alloy-signer-local" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494e0a256f3e99f2426f994bcd1be312c02cb8f88260088dacb33a8b8936475f" -dependencies = [ - "alloy-consensus 0.4.2", - "alloy-network 0.4.2", - "alloy-primitives", - "alloy-signer 0.4.2", - "async-trait", - "k256 0.13.4", - "rand 0.8.5", - "thiserror", -] - [[package]] name = "alloy-signer-local" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-network 0.5.4", + "alloy-consensus", + "alloy-network", "alloy-primitives", - "alloy-signer 0.5.4", + "alloy-signer", "async-trait", - "coins-bip32 0.12.0", - "coins-bip39 0.12.0", + "coins-bip32", + "coins-bip39", "eth-keystore", "k256 0.13.4", "rand 0.8.5", @@ -929,10 +635,10 @@ name = "alloy-signer-trezor" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-network 0.5.4", + "alloy-consensus", + "alloy-network", "alloy-primitives", - "alloy-signer 0.5.4", + "alloy-signer", "async-trait", "semver 1.0.23", "thiserror", @@ -1013,31 +719,12 @@ dependencies = [ "serde", ] -[[package]] -name = "alloy-transport" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac3e97dad3d31770db0fc89bd6a63b789fbae78963086733f960cf32c483904" -dependencies = [ - "alloy-json-rpc 0.4.2", - "base64 0.22.1", - "futures-util", - "futures-utils-wasm", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower 0.5.1", - "tracing", - "url", -] - [[package]] name = "alloy-transport" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#21484592682f146ba8f50de0d90883a10e82d52f" dependencies = [ - "alloy-json-rpc 0.5.4", + "alloy-json-rpc", "base64 0.22.1", "futures-util", "futures-utils-wasm", @@ -1051,52 +738,18 @@ dependencies = [ "wasmtimer", ] -[[package]] -name = "alloy-transport-http" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b367dcccada5b28987c2296717ee04b9a5637aacd78eacb1726ef211678b5212" -dependencies = [ - "alloy-json-rpc 0.4.2", - "alloy-transport 0.4.2", - "reqwest 0.12.9", - "serde_json", - "tower 0.5.1", - "tracing", - "url", -] - [[package]] name = "alloy-transport-http" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#31bccc864525b5ba64fefb8211363807c7a43d2d" dependencies = [ - "alloy-json-rpc 0.5.4", - "alloy-transport 0.5.4", + "alloy-json-rpc", + "alloy-transport", "reqwest 0.12.9", - "serde_json", - "tower 0.5.1", - "tracing", - "url", -] - -[[package]] -name = "alloy-transport-ipc" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b90cf9cde7f2fce617da52768ee28f522264b282d148384a4ca0ea85af04fa3a" -dependencies = [ - "alloy-json-rpc 0.4.2", - "alloy-pubsub 0.4.2", - "alloy-transport 0.4.2", - "bytes", - "futures 0.3.31", - "interprocess", - "pin-project 1.1.7", - "serde_json", - "tokio", - "tokio-util 0.7.12", + "serde_json", + "tower 0.5.1", "tracing", + "url", ] [[package]] @@ -1104,9 +757,9 @@ name = "alloy-transport-ipc" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#31bccc864525b5ba64fefb8211363807c7a43d2d" dependencies = [ - "alloy-json-rpc 0.5.4", - "alloy-pubsub 0.5.4", - "alloy-transport 0.5.4", + "alloy-json-rpc", + "alloy-pubsub", + "alloy-transport", "bytes", "futures 0.3.31", "interprocess", @@ -1119,37 +772,19 @@ dependencies = [ "tracing", ] -[[package]] -name = "alloy-transport-ws" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7153b88690de6a50bba81c11e1d706bc41dbb90126d607404d60b763f6a3947f" -dependencies = [ - "alloy-pubsub 0.4.2", - "alloy-transport 0.4.2", - "futures 0.3.31", - "http 1.1.0", - "rustls 0.23.16", - "serde_json", - "tokio", - "tokio-tungstenite 0.24.0", - "tracing", - "ws_stream_wasm", -] - [[package]] name = "alloy-transport-ws" version = "0.5.4" source = "git+https://github.com/Karrq/alloy?branch=zksync-v0.5.4#31bccc864525b5ba64fefb8211363807c7a43d2d" dependencies = [ - "alloy-pubsub 0.5.4", - "alloy-transport 0.5.4", + "alloy-pubsub", + "alloy-transport", "futures 0.3.31", "http 1.1.0", "rustls 0.23.16", "serde_json", "tokio", - "tokio-tungstenite 0.24.0", + "tokio-tungstenite", "tracing", "ws_stream_wasm", ] @@ -1171,11 +806,11 @@ dependencies = [ [[package]] name = "alloy-zksync" -version = "0.1.0" -source = "git+https://github.com/popzxc/alloy-zksync?branch=main#d454818e7afd3a79d3ab3b5bc2875ba6c855e825" +version = "0.5.0" dependencies = [ "alloy", "async-trait", + "chrono", "futures-utils-wasm", "k256 0.13.4", "rand 0.8.5", @@ -1277,27 +912,27 @@ name = "anvil" version = "0.0.2" dependencies = [ "alloy-chains", - "alloy-consensus 0.5.4", - "alloy-contract 0.5.4", + "alloy-consensus", + "alloy-contract", "alloy-dyn-abi", - "alloy-eips 0.5.4", - "alloy-genesis 0.5.4", + "alloy-eips", + "alloy-genesis", "alloy-json-abi", - "alloy-json-rpc 0.5.4", - "alloy-network 0.5.4", + "alloy-json-rpc", + "alloy-network", "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-pubsub 0.5.4", + "alloy-provider", + "alloy-pubsub", "alloy-rlp", - "alloy-rpc-client 0.5.4", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", - "alloy-signer 0.5.4", - "alloy-signer-local 0.5.4", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-signer-local", "alloy-sol-types", - "alloy-transport 0.5.4", - "alloy-transport-ipc 0.5.4", - "alloy-transport-ws 0.5.4", + "alloy-transport", + "alloy-transport-ipc", + "alloy-transport-ws", "alloy-trie", "anvil-core", "anvil-rpc", @@ -1339,20 +974,20 @@ dependencies = [ "tracing", "tracing-subscriber", "vergen", - "yansi 1.0.1", + "yansi", ] [[package]] name = "anvil-core" version = "0.0.2" dependencies = [ - "alloy-consensus 0.5.4", + "alloy-consensus", "alloy-dyn-abi", - "alloy-eips 0.5.4", + "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", + "alloy-rpc-types", + "alloy-serde", "alloy-trie", "bytes", "foundry-common", @@ -1416,7 +1051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44055e597c674aef7cb903b2b9f6e4cba1277ed0d2d61dae7cd52d7ffa81f8e2" dependencies = [ "unicode-width 0.1.14", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -1756,7 +1391,7 @@ dependencies = [ "fastrand", "hex", "http 0.2.12", - "ring 0.17.8", + "ring", "time", "tokio", "tracing", @@ -2110,7 +1745,7 @@ dependencies = [ "sha1", "sync_wrapper 1.0.1", "tokio", - "tokio-tungstenite 0.24.0", + "tokio-tungstenite", "tower 0.5.1", "tower-layer", "tower-service", @@ -2725,21 +2360,22 @@ name = "cast" version = "0.0.2" dependencies = [ "alloy-chains", - "alloy-consensus 0.5.4", - "alloy-contract 0.5.4", + "alloy-consensus", + "alloy-contract", "alloy-dyn-abi", "alloy-json-abi", - "alloy-json-rpc 0.5.4", - "alloy-network 0.5.4", + "alloy-json-rpc", + "alloy-network", "alloy-primitives", - "alloy-provider 0.5.4", + "alloy-provider", "alloy-rlp", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", - "alloy-signer 0.5.4", - "alloy-signer-local 0.5.4", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-signer-local", "alloy-sol-types", - "alloy-transport 0.5.4", + "alloy-transport", + "alloy-zksync", "anvil", "async-trait", "aws-sdk-kms", @@ -2776,8 +2412,8 @@ dependencies = [ "tokio", "tracing", "vergen", - "yansi 1.0.1", - "zksync-web3-rs", + "yansi", + "zksync_types", ] [[package]] @@ -2846,7 +2482,7 @@ dependencies = [ "alloy-dyn-abi", "alloy-json-abi", "alloy-primitives", - "alloy-rpc-types 0.5.4", + "alloy-rpc-types", "clap", "dirs 5.0.1", "eyre", @@ -2873,7 +2509,7 @@ dependencies = [ "tracing", "tracing-subscriber", "vergen", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -3162,22 +2798,6 @@ dependencies = [ "cc", ] -[[package]] -name = "coins-bip32" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" -dependencies = [ - "bs58", - "coins-core 0.8.7", - "digest 0.10.7", - "hmac", - "k256 0.13.4", - "serde", - "sha2 0.10.8", - "thiserror", -] - [[package]] name = "coins-bip32" version = "0.12.0" @@ -3185,7 +2805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2073678591747aed4000dd468b97b14d7007f7936851d3f2f01846899f5ebf08" dependencies = [ "bs58", - "coins-core 0.12.0", + "coins-core", "digest 0.10.7", "hmac", "k256 0.13.4", @@ -3194,22 +2814,6 @@ dependencies = [ "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 0.8.7", - "hmac", - "once_cell", - "pbkdf2 0.12.2", - "rand 0.8.5", - "sha2 0.10.8", - "thiserror", -] - [[package]] name = "coins-bip39" version = "0.12.0" @@ -3217,7 +2821,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74b169b26623ff17e9db37a539fe4f15342080df39f129ef7631df7683d6d9d4" dependencies = [ "bitvec 1.0.1", - "coins-bip32 0.12.0", + "coins-bip32", "hmac", "once_cell", "pbkdf2 0.12.2", @@ -3226,26 +2830,6 @@ dependencies = [ "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.7", - "bech32", - "bs58", - "digest 0.10.7", - "generic-array", - "hex", - "ripemd", - "serde", - "serde_derive", - "sha2 0.10.8", - "sha3 0.10.8", - "thiserror", -] - [[package]] name = "coins-core" version = "0.12.0" @@ -4301,24 +3885,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "enr" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" -dependencies = [ - "base64 0.21.7", - "bytes", - "hex", - "k256 0.13.4", - "log", - "rand 0.8.5", - "rlp", - "serde", - "sha3 0.10.8", - "zeroize", -] - [[package]] name = "enum_dispatch" version = "0.3.13" @@ -4352,19 +3918,6 @@ dependencies = [ "regex", ] -[[package]] -name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - [[package]] name = "env_logger" version = "0.11.5" @@ -4581,252 +4134,56 @@ dependencies = [ "uint", ] -[[package]] -name = "ethers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" -dependencies = [ - "ethers-addressbook", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-middleware", - "ethers-providers", - "ethers-signers", - "ethers-solc", -] - -[[package]] -name = "ethers-addressbook" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" -dependencies = [ - "ethers-core", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "ethers-contract" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" -dependencies = [ - "const-hex", - "ethers-contract-abigen", - "ethers-contract-derive", - "ethers-core", - "ethers-providers", - "futures-util", - "once_cell", - "pin-project 1.1.7", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "ethers-contract-abigen" version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" dependencies = [ - "Inflector", - "const-hex", - "dunce", - "ethers-core", - "ethers-etherscan", - "eyre", - "prettyplease", - "proc-macro2 1.0.89", - "quote 1.0.37", - "regex", - "reqwest 0.11.27", - "serde", - "serde_json", - "syn 2.0.87", - "toml 0.8.19", - "walkdir", -] - -[[package]] -name = "ethers-contract-derive" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" -dependencies = [ - "Inflector", - "const-hex", - "ethers-contract-abigen", - "ethers-core", - "proc-macro2 1.0.89", - "quote 1.0.37", - "serde_json", - "syn 2.0.87", -] - -[[package]] -name = "ethers-core" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" -dependencies = [ - "arrayvec 0.7.6", - "bytes", - "cargo_metadata 0.18.1", - "chrono", - "const-hex", - "elliptic-curve 0.13.8", - "ethabi 18.0.0", - "generic-array", - "k256 0.13.4", - "num_enum 0.7.3", - "once_cell", - "open-fastrlp", - "rand 0.8.5", - "rlp", - "serde", - "serde_json", - "strum", - "syn 2.0.87", - "tempfile", - "thiserror", - "tiny-keccak 2.0.2", - "unicode-xid 0.2.6", -] - -[[package]] -name = "ethers-etherscan" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" -dependencies = [ - "chrono", - "ethers-core", - "reqwest 0.11.27", - "semver 1.0.23", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "ethers-middleware" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" -dependencies = [ - "async-trait", - "auto_impl", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-providers", - "ethers-signers", - "futures-channel", - "futures-locks", - "futures-util", - "instant", - "reqwest 0.11.27", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "url", -] - -[[package]] -name = "ethers-providers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" -dependencies = [ - "async-trait", - "auto_impl", - "base64 0.21.7", - "bytes", - "const-hex", - "enr", - "ethers-core", - "futures-core", - "futures-timer", - "futures-util", - "hashers", - "http 0.2.12", - "instant", - "jsonwebtoken 8.3.0", - "once_cell", - "pin-project 1.1.7", - "reqwest 0.11.27", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-tungstenite 0.20.1", - "tracing", - "tracing-futures", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "ws_stream_wasm", -] - -[[package]] -name = "ethers-signers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" -dependencies = [ - "async-trait", - "coins-bip32 0.8.7", - "coins-bip39 0.8.7", + "Inflector", "const-hex", - "elliptic-curve 0.13.8", - "eth-keystore", + "dunce", "ethers-core", - "rand 0.8.5", - "sha2 0.10.8", - "thiserror", - "tracing", + "eyre", + "prettyplease", + "proc-macro2 1.0.89", + "quote 1.0.37", + "regex", + "serde", + "serde_json", + "syn 2.0.87", + "toml 0.8.19", + "walkdir", ] [[package]] -name = "ethers-solc" +name = "ethers-core" version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ - "cfg-if 1.0.0", + "arrayvec 0.7.6", + "bytes", + "cargo_metadata 0.18.1", + "chrono", "const-hex", - "dirs 5.0.1", - "dunce", - "ethers-core", - "glob", - "home", - "md-5", - "num_cpus", + "elliptic-curve 0.13.8", + "ethabi 18.0.0", + "generic-array", + "k256 0.13.4", + "num_enum 0.7.3", "once_cell", - "path-slash", - "rayon", - "regex", - "semver 1.0.23", + "open-fastrlp", + "rand 0.8.5", + "rlp", "serde", "serde_json", - "solang-parser", - "svm-rs 0.3.5", + "strum", + "syn 2.0.87", + "tempfile", "thiserror", "tiny-keccak 2.0.2", - "tokio", - "tracing", - "walkdir", - "yansi 0.5.1", + "unicode-xid 0.2.6", ] [[package]] @@ -5045,7 +4402,7 @@ checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ "futures-core", "futures-sink", - "spin 0.9.8", + "spin", ] [[package]] @@ -5080,19 +4437,19 @@ name = "forge" version = "0.0.2" dependencies = [ "alloy-chains", - "alloy-consensus 0.5.4", + "alloy-consensus", "alloy-dyn-abi", "alloy-json-abi", - "alloy-network 0.5.4", + "alloy-network", "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", - "alloy-signer 0.5.4", - "alloy-signer-local 0.5.4", + "alloy-provider", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-signer-local", "alloy-sol-macro-expander", "alloy-sol-macro-input", - "alloy-transport 0.5.4", + "alloy-transport", "alloy-zksync", "anvil", "async-trait", @@ -5153,7 +4510,7 @@ dependencies = [ "solang-parser", "soldeer-commands", "strum", - "svm-rs 0.5.8", + "svm-rs", "tempfile", "thiserror", "tikv-jemallocator", @@ -5167,8 +4524,7 @@ dependencies = [ "watchexec", "watchexec-events", "watchexec-signals", - "yansi 1.0.1", - "zksync-web3-rs", + "yansi", "zksync_types", ] @@ -5215,17 +4571,18 @@ name = "forge-script" version = "0.0.2" dependencies = [ "alloy-chains", - "alloy-consensus 0.5.4", + "alloy-consensus", "alloy-dyn-abi", - "alloy-eips 0.5.4", + "alloy-eips", "alloy-json-abi", - "alloy-network 0.5.4", + "alloy-network", "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", - "alloy-signer 0.5.4", - "alloy-transport 0.5.4", + "alloy-provider", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-transport", + "alloy-zksync", "async-recursion", "clap", "dialoguer", @@ -5255,8 +4612,8 @@ dependencies = [ "tempfile", "tokio", "tracing", - "yansi 1.0.1", - "zksync-web3-rs", + "yansi", + "zksync_types", ] [[package]] @@ -5264,7 +4621,7 @@ name = "forge-script-sequence" version = "0.0.2" dependencies = [ "alloy-primitives", - "alloy-rpc-types 0.5.4", + "alloy-rpc-types", "eyre", "foundry-common", "foundry-compilers", @@ -5300,8 +4657,8 @@ dependencies = [ "alloy-dyn-abi", "alloy-json-abi", "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-rpc-types 0.5.4", + "alloy-provider", + "alloy-rpc-types", "async-trait", "ciborium", "clap", @@ -5325,7 +4682,7 @@ dependencies = [ "tempfile", "tokio", "tracing", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -5358,16 +4715,16 @@ dependencies = [ name = "foundry-cheatcodes" version = "0.0.2" dependencies = [ - "alloy-consensus 0.5.4", + "alloy-consensus", "alloy-dyn-abi", - "alloy-genesis 0.5.4", + "alloy-genesis", "alloy-json-abi", "alloy-primitives", - "alloy-provider 0.5.4", + "alloy-provider", "alloy-rlp", - "alloy-rpc-types 0.5.4", - "alloy-signer 0.5.4", - "alloy-signer-local 0.5.4", + "alloy-rpc-types", + "alloy-signer", + "alloy-signer-local", "alloy-sol-types", "base64 0.22.1", "chrono", @@ -5403,7 +4760,6 @@ dependencies = [ "tracing", "vergen", "walkdir", - "zksync-web3-rs", "zksync_types", ] @@ -5432,12 +4788,12 @@ version = "0.0.2" dependencies = [ "alloy-chains", "alloy-dyn-abi", - "alloy-eips 0.5.4", + "alloy-eips", "alloy-json-abi", "alloy-primitives", - "alloy-provider 0.5.4", + "alloy-provider", "alloy-rlp", - "alloy-transport 0.5.4", + "alloy-transport", "alloy-zksync", "clap", "color-eyre", @@ -5462,30 +4818,29 @@ dependencies = [ "tracing", "tracing-subscriber", "tracing-tracy", - "yansi 1.0.1", - "zksync-web3-rs", + "yansi", ] [[package]] name = "foundry-common" version = "0.0.2" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-contract 0.5.4", + "alloy-consensus", + "alloy-contract", "alloy-dyn-abi", "alloy-json-abi", - "alloy-json-rpc 0.5.4", + "alloy-json-rpc", "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-pubsub 0.5.4", - "alloy-rpc-client 0.5.4", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", + "alloy-provider", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", "alloy-sol-types", - "alloy-transport 0.5.4", - "alloy-transport-http 0.5.4", - "alloy-transport-ipc 0.5.4", - "alloy-transport-ws 0.5.4", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", "alloy-zksync", "anstream", "anstyle", @@ -5512,19 +4867,19 @@ dependencies = [ "tracing", "url", "walkdir", - "yansi 1.0.1", + "yansi", ] [[package]] name = "foundry-common-fmt" version = "0.0.2" dependencies = [ - "alloy-consensus 0.5.4", + "alloy-consensus", "alloy-dyn-abi", - "alloy-network 0.5.4", + "alloy-network", "alloy-primitives", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", + "alloy-rpc-types", + "alloy-serde", "chrono", "comfy-table", "foundry-macros", @@ -5532,7 +4887,7 @@ dependencies = [ "serde", "serde_json", "similar-asserts", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -5564,7 +4919,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "solang-parser", - "svm-rs 0.5.8", + "svm-rs", "svm-rs-builds", "tempfile", "thiserror", @@ -5572,7 +4927,7 @@ dependencies = [ "tracing", "walkdir", "winnow 0.6.20", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -5605,7 +4960,7 @@ dependencies = [ "tokio", "tracing", "walkdir", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -5640,7 +4995,7 @@ dependencies = [ "thiserror", "tracing", "walkdir", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -5658,7 +5013,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "svm-rs 0.5.8", + "svm-rs", "tempfile", "thiserror", "tokio", @@ -5698,7 +5053,7 @@ dependencies = [ "toml_edit 0.22.22", "tracing", "walkdir", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -5766,14 +5121,14 @@ name = "foundry-evm-core" version = "0.0.2" dependencies = [ "alloy-dyn-abi", - "alloy-genesis 0.5.4", + "alloy-genesis", "alloy-json-abi", "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", + "alloy-provider", + "alloy-rpc-types", + "alloy-serde", "alloy-sol-types", - "alloy-transport 0.5.4", + "alloy-transport", "auto_impl", "eyre", "foundry-cheatcodes-spec", @@ -5872,10 +5227,10 @@ version = "0.6.0" source = "git+https://github.com/Moonsong-Labs/foundry-zksync-fork-db?branch=zksync-v0.6.0#f2e915d1c476007ae16be9fb96b25ffe1b8f5113" dependencies = [ "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", - "alloy-transport 0.5.4", + "alloy-provider", + "alloy-rpc-types", + "alloy-serde", + "alloy-transport", "eyre", "futures 0.3.31", "parking_lot 0.12.3", @@ -5913,7 +5268,7 @@ name = "foundry-test-utils" version = "0.0.2" dependencies = [ "alloy-primitives", - "alloy-provider 0.5.4", + "alloy-provider", "era_test_node", "eyre", "fd-lock", @@ -5938,15 +5293,15 @@ dependencies = [ name = "foundry-wallets" version = "0.0.2" dependencies = [ - "alloy-consensus 0.5.4", + "alloy-consensus", "alloy-dyn-abi", - "alloy-network 0.5.4", + "alloy-network", "alloy-primitives", - "alloy-signer 0.5.4", + "alloy-signer", "alloy-signer-aws", "alloy-signer-gcp", "alloy-signer-ledger", - "alloy-signer-local 0.5.4", + "alloy-signer-local", "alloy-signer-trezor", "alloy-sol-types", "async-trait", @@ -5984,16 +5339,13 @@ dependencies = [ name = "foundry-zksync-core" version = "0.0.2" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-dyn-abi", - "alloy-network 0.5.4", + "alloy-network", "alloy-primitives", - "alloy-provider 0.5.4", - "alloy-rpc-types 0.5.4", - "alloy-serde 0.5.4", - "alloy-signer 0.5.4", + "alloy-provider", + "alloy-rpc-types", + "alloy-serde", "alloy-sol-types", - "alloy-transport 0.5.4", + "alloy-transport", "ansiterm", "era_test_node", "eyre", @@ -6003,10 +5355,8 @@ dependencies = [ "itertools 0.13.0", "revm", "serde", - "serde_json", "tracing", "url", - "zksync-web3-rs", "zksync_basic_types", "zksync_contracts", "zksync_multivm", @@ -6065,16 +5415,6 @@ dependencies = [ "zksync_bellman", ] -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "fs4" version = "0.8.4" @@ -6204,16 +5544,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" -[[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.31" @@ -6272,15 +5602,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "gcloud-sdk" version = "0.25.7" @@ -6292,7 +5613,7 @@ dependencies = [ "chrono", "futures 0.3.31", "hyper 1.5.0", - "jsonwebtoken 9.3.0", + "jsonwebtoken", "once_cell", "prost 0.13.3", "prost-types 0.13.3", @@ -6662,7 +5983,7 @@ dependencies = [ "google-cloud-metadata", "google-cloud-token", "home", - "jsonwebtoken 9.3.0", + "jsonwebtoken", "reqwest 0.12.9", "serde", "serde_json", @@ -6706,7 +6027,7 @@ dependencies = [ "regex", "reqwest 0.12.9", "reqwest-middleware", - "ring 0.17.8", + "ring", "serde", "serde_json", "sha2 0.10.8", @@ -6861,15 +6182,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hashers" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" -dependencies = [ - "fxhash", -] - [[package]] name = "hashlink" version = "0.9.1" @@ -7144,7 +6456,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.6", + "webpki-roots", ] [[package]] @@ -7882,20 +7194,6 @@ dependencies = [ "url", ] -[[package]] -name = "jsonwebtoken" -version = "8.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" -dependencies = [ - "base64 0.21.7", - "pem 1.1.1", - "ring 0.16.20", - "serde", - "serde_json", - "simple_asn1", -] - [[package]] name = "jsonwebtoken" version = "9.3.0" @@ -7904,8 +7202,8 @@ checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" dependencies = [ "base64 0.21.7", "js-sys", - "pem 3.0.4", - "ring 0.17.8", + "pem", + "ring", "serde", "serde_json", "simple_asn1", @@ -8012,7 +7310,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.9.8", + "spin", ] [[package]] @@ -8275,7 +7573,7 @@ dependencies = [ "clap", "clap_complete", "elasticlunr-rs", - "env_logger 0.11.5", + "env_logger", "handlebars 5.1.2", "log", "memchr", @@ -8888,14 +8186,14 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26c3b35b7b3e36d15e0563eebffe13c1d9ca16b7aaffcb6a64354633547e16b" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-eips 0.5.4", + "alloy-consensus", + "alloy-eips", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.5.4", + "alloy-serde", "derive_more 1.0.0", "serde", - "spin 0.9.8", + "spin", ] [[package]] @@ -8904,12 +8202,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94bae9bf91b620e1e2c2291562e5998bc1247bd8ada011773e1997b31a95de99" dependencies = [ - "alloy-consensus 0.5.4", - "alloy-eips 0.5.4", - "alloy-network-primitives 0.5.4", + "alloy-consensus", + "alloy-eips", + "alloy-network-primitives", "alloy-primitives", - "alloy-rpc-types-eth 0.5.4", - "alloy-serde 0.5.4", + "alloy-rpc-types-eth", + "alloy-serde", "op-alloy-consensus", "serde", "serde_json", @@ -9272,17 +8570,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[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.15" @@ -9302,9 +8589,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", - "hmac", - "password-hash", - "sha2 0.10.8", ] [[package]] @@ -9325,7 +8609,7 @@ checksum = "bdeeaa00ce488657faba8ebf44ab9361f9365a97bd39ffb8a60663f57ff4b467" dependencies = [ "inlinable_string", "pear_codegen", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -9346,15 +8630,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] - [[package]] name = "pem" version = "3.0.4" @@ -9665,7 +8940,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -9822,7 +9097,7 @@ dependencies = [ "quote 1.0.37", "syn 2.0.87", "version_check", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -10196,7 +9471,7 @@ checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", - "ring 0.17.8", + "ring", "rustc-hash 2.0.0", "rustls 0.23.16", "slab", @@ -10527,7 +9802,6 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.31", - "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -10537,7 +9811,6 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -10546,13 +9819,11 @@ dependencies = [ "system-configuration 0.5.1", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.25.4", "winreg", ] @@ -10607,7 +9878,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.6", + "webpki-roots", "windows-registry", ] @@ -10673,7 +9944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e29c662f7887f3b659d4b0fd234673419a8fcbeaa1ecc29bf7034c0a75cc8ea" dependencies = [ "alloy-primitives", - "alloy-rpc-types-eth 0.5.4", + "alloy-rpc-types-eth", "alloy-rpc-types-trace", "alloy-sol-types", "anstyle", @@ -10721,7 +9992,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d11fa1e195b0bebaf3fb18596f314a13ba3a4cb1fdd16d3465934d812fd921e" dependencies = [ "alloy-eip2930", - "alloy-eip7702 0.3.2", + "alloy-eip7702", "alloy-primitives", "auto_impl", "bitflags 2.6.0", @@ -10764,21 +10035,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -10789,8 +10045,8 @@ dependencies = [ "cfg-if 1.0.0", "getrandom 0.2.15", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] @@ -11033,7 +10289,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-webpki 0.101.7", "sct", ] @@ -11047,7 +10303,7 @@ dependencies = [ "aws-lc-rs", "log", "once_cell", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -11133,7 +10389,7 @@ dependencies = [ "rustls-webpki 0.102.8", "security-framework", "security-framework-sys", - "webpki-roots 0.26.6", + "webpki-roots", "winapi", ] @@ -11149,8 +10405,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -11160,9 +10416,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", - "ring 0.17.8", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -11346,8 +10602,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -12154,16 +11410,10 @@ dependencies = [ "tokio", "toml_edit 0.22.22", "uuid 1.11.0", - "zip 2.2.0", + "zip", "zip-extract", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -12534,26 +11784,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "svm-rs" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" -dependencies = [ - "dirs 5.0.1", - "fs2", - "hex", - "once_cell", - "reqwest 0.11.27", - "semver 1.0.23", - "serde", - "serde_json", - "sha2 0.10.8", - "thiserror", - "url", - "zip 0.6.6", -] - [[package]] name = "svm-rs" version = "0.5.8" @@ -12571,7 +11801,7 @@ dependencies = [ "tempfile", "thiserror", "url", - "zip 2.2.0", + "zip", ] [[package]] @@ -12584,7 +11814,7 @@ dependencies = [ "const-hex", "semver 1.0.23", "serde_json", - "svm-rs 0.5.8", + "svm-rs", ] [[package]] @@ -12748,15 +11978,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "terminal_size" version = "0.4.0" @@ -13006,21 +12227,6 @@ dependencies = [ "tokio-util 0.7.12", ] -[[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 0.21.12", - "tokio", - "tokio-rustls 0.24.1", - "tungstenite 0.20.1", - "webpki-roots 0.25.4", -] - [[package]] name = "tokio-tungstenite" version = "0.24.0" @@ -13033,8 +12239,8 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", - "tungstenite 0.24.0", - "webpki-roots 0.26.6", + "tungstenite", + "webpki-roots", ] [[package]] @@ -13287,16 +12493,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project 1.1.7", - "tracing", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -13415,26 +12611,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 0.2.12", - "httparse", - "log", - "rand 0.8.5", - "rustls 0.21.12", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "tungstenite" version = "0.24.0" @@ -13617,12 +12793,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -14009,12 +13179,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.6" @@ -14086,7 +13250,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -14454,12 +13618,6 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "yansi" version = "1.0.1" @@ -14510,26 +13668,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd", -] - [[package]] name = "zip" version = "2.2.0" @@ -14556,7 +13694,7 @@ checksum = "25a8c9e90f27d1435088a7b540b6cc8ae6ee525d992a695f16012d2f365b3d3c" dependencies = [ "log", "thiserror", - "zip 2.2.0", + "zip", ] [[package]] @@ -14802,27 +13940,6 @@ dependencies = [ "sha3 0.10.8", ] -[[package]] -name = "zksync-web3-rs" -version = "0.2.1" -source = "git+https://github.com/jrigada/zksync-web3-rs.git?rev=bc3e6d3e75b7ff3747ff2dccefa9fb74d770931b#bc3e6d3e75b7ff3747ff2dccefa9fb74d770931b" -dependencies = [ - "anyhow", - "async-trait", - "clap", - "env_logger 0.10.2", - "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" @@ -15500,25 +14617,6 @@ dependencies = [ "simd-adler32", ] -[[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", -] - -[[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]] name = "zstd-sys" version = "2.0.13+zstd.1.5.6" diff --git a/Cargo.toml b/Cargo.toml index 4b2110126..3ac53ffcf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -231,7 +231,9 @@ alloy-chains = "0.1" alloy-rlp = "0.3" alloy-trie = "0.6.0" # alloy-zksync = "0.1.0" -alloy-zksync = { git = "https://github.com/popzxc/alloy-zksync", branch = "main"} +# alloy-zksync = { git = "https://github.com/popzxc/alloy-zksync", branch = "main"} +# alloy-zksync = { git = "https://github.com/nbaztec/alloy-zksync", branch = "v0.5"} +alloy-zksync = { path = "../nbaztec-alloy-zksync" } ## op-alloy op-alloy-rpc-types = "0.5.0" @@ -244,8 +246,6 @@ terminal_size = "0.4" ## zksync era_test_node = { git="https://github.com/matter-labs/era-test-node.git" , rev = "94503847b402f0161c3372d5f357a4cb16a2d66d" } -zksync-web3-rs = {git = "https://github.com/jrigada/zksync-web3-rs.git", rev = "bc3e6d3e75b7ff3747ff2dccefa9fb74d770931b"} -# zksync-web3-rs = {git = "https://github.com/lambdaclass/zksync-web3-rs.git", rev = "56653345d14331e0865a6785c77cdda63c94eeba"} zksync_basic_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec" } zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec" } zksync_state = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec" } diff --git a/crates/cast/Cargo.toml b/crates/cast/Cargo.toml index 5eb1e45b7..3e9c35256 100644 --- a/crates/cast/Cargo.toml +++ b/crates/cast/Cargo.toml @@ -36,7 +36,6 @@ foundry-config.workspace = true foundry-evm.workspace = true foundry-wallets.workspace = true foundry-zksync-core.workspace = true -zksync-web3-rs.workspace = true alloy-chains.workspace = true alloy-consensus = { workspace = true, features = ["serde", "kzg"] } @@ -59,6 +58,9 @@ alloy-signer-local = { workspace = true, features = ["mnemonic", "keystore"] } alloy-signer.workspace = true alloy-sol-types.workspace = true alloy-transport.workspace = true +alloy-zksync.workspace = true + +zksync_types.workspace = true chrono.workspace = true eyre.workspace = true diff --git a/crates/cast/bin/cmd/send.rs b/crates/cast/bin/cmd/send.rs index c05ce513d..e420dc7a8 100644 --- a/crates/cast/bin/cmd/send.rs +++ b/crates/cast/bin/cmd/send.rs @@ -1,12 +1,19 @@ use crate::tx::{self, CastTxBuilder}; -use alloy_network::{AnyNetwork, EthereumWallet}; +use alloy_network::{AnyNetwork, EthereumWallet, TransactionBuilder}; use alloy_primitives::{Address, Bytes, TxHash}; use alloy_provider::{Provider, ProviderBuilder}; use alloy_rpc_types::TransactionRequest; use alloy_serde::WithOtherFields; use alloy_signer::Signer; use alloy_transport::Transport; -use cast::Cast; +use alloy_zksync::{ + network::{ + transaction_request::TransactionRequest as ZkTransactionRequest, + unsigned_tx::eip712::PaymasterParams, Zksync, + }, + wallet::ZksyncWallet, +}; +use cast::{Cast, ZkCast}; use clap::{builder::ArgPredicate, Parser}; use eyre::Result; use foundry_cli::{ @@ -15,10 +22,9 @@ use foundry_cli::{ }; use foundry_common::ens::NameOrAddress; use foundry_config::Config; -use foundry_wallets::WalletSigner; -use foundry_zksync_core::{self, convert::ConvertAddress}; +use foundry_zksync_core::convert::ConvertU256; use std::{path::PathBuf, str::FromStr}; -use zksync_web3_rs::eip712::PaymasterParams; +use zksync_types::fee::Fee; /// ZkSync-specific paymaster parameters for transactions #[derive(Debug, Parser)] @@ -144,6 +150,7 @@ impl SendTxArgs { config.zksync.compile = zksync_params.zksync; let provider = utils::get_provider(&config)?; + let zk_provider = utils::get_provider_zksync(&config)?; let builder = CastTxBuilder::new(&provider, tx, &config) .await? @@ -189,20 +196,33 @@ impl SendTxArgs { } else { // Retrieve the signer, and bail if it can't be constructed. let signer = eth.wallet.signer().await?; + let zk_signer = eth.wallet.signer().await?; let from = signer.address(); tx::validate_from_address(eth.wallet.from, from)?; if zksync_params.zksync { + // Zksync transaction let (tx, _) = builder.build(&signer).await?; + + let wallet = EthereumWallet::from(signer); + let provider = ProviderBuilder::<_, _, AnyNetwork>::default() + .wallet(wallet) + .on_provider(&provider); + + let zk_wallet = ZksyncWallet::from(zk_signer); + let zk_provider = ProviderBuilder::<_, _, Zksync>::default() + .wallet(zk_wallet) + .on_provider(&zk_provider); + cast_send_zk( - &provider, - zksync_params, + provider, + zk_provider, tx, + zksync_params, cast_async, confirmations, timeout, - signer, ) .await } else { @@ -235,40 +255,41 @@ async fn cast_send, T: Transport + Clone>( handle_transaction_result(&cast, tx_hash, cast_async, confs, timeout).await } -#[allow(clippy::too_many_arguments)] -async fn cast_send_zk, T: Transport + Clone>( +async fn cast_send_zk, Z: Provider, T: Transport + Clone>( provider: P, - zksync_params: ZksyncParams, + zk_provider: Z, tx: WithOtherFields, + zksync_params: ZksyncParams, cast_async: bool, confs: u64, timeout: u64, - signer: WalletSigner, ) -> Result<()> { // ZkSync transaction let paymaster_params = zksync_params .paymaster_address .and_then(|addr| zksync_params.paymaster_input.map(|input| (addr, input))) .map(|(addr, input)| PaymasterParams { - paymaster: Address::from_str(&addr).expect("Invalid paymaster address").to_h160(), - paymaster_input: Bytes::from_str(&input).expect("Invalid paymaster input").to_vec(), + paymaster: Address::from_str(&addr).expect("Invalid paymaster address"), + paymaster_input: Bytes::from_str(&input).expect("Invalid paymaster input"), }); - // Build EIP712 transaction for ZKSync - let tx = foundry_zksync_core::new_eip712_transaction( - tx, - Vec::new(), // Empty factory_deps - paymaster_params, - &provider, - signer, - ) - .await - .map_err(|e| eyre::eyre!("Failed to create EIP712 transaction: {}", e))?; - - // Use send_raw_transaction for ZKSync - let tx_hash = provider.send_raw_transaction(&tx).await?.tx_hash().to_owned(); - let cast = Cast::new(provider); - handle_transaction_result(&cast, &tx_hash, cast_async, confs, timeout).await + let mut zk_tx: ZkTransactionRequest = tx.inner.clone().into(); + if let Some(paymaster_params) = paymaster_params { + zk_tx.set_paymaster(paymaster_params); + } + + let fee = provider.raw_request::<_, Fee>("zks_estimateFee".into(), [&zk_tx]).await.unwrap(); + zk_tx.set_gas_limit(fee.gas_limit.as_u64()); + zk_tx.set_max_fee_per_gas(fee.max_fee_per_gas.as_u128()); + zk_tx.set_max_priority_fee_per_gas(fee.max_priority_fee_per_gas.as_u128()); + zk_tx.set_gas_per_pubdata(fee.gas_per_pubdata_limit.to_ru256()); + + let cast = ZkCast::new(zk_provider, Cast::new(provider)); + let pending_tx = cast.send_zk(zk_tx).await?; + + let tx_hash = pending_tx.inner().tx_hash(); + + handle_transaction_result(cast.as_ref(), tx_hash, cast_async, confs, timeout).await } async fn handle_transaction_result, T: Transport + Clone>( diff --git a/crates/cast/src/lib.rs b/crates/cast/src/lib.rs index 75272b3b1..a1577bc18 100644 --- a/crates/cast/src/lib.rs +++ b/crates/cast/src/lib.rs @@ -19,6 +19,9 @@ use alloy_rpc_types::{BlockId, BlockNumberOrTag, Filter, TransactionRequest}; use alloy_serde::WithOtherFields; use alloy_sol_types::sol; use alloy_transport::Transport; +use alloy_zksync::network::{ + transaction_request::TransactionRequest as ZkTransactionRequest, Zksync, +}; use base::{Base, NumberWithBase, ToBase}; use chrono::DateTime; use eyre::{Context, ContextCompat, Result}; @@ -69,6 +72,72 @@ sol! { } } +pub struct ZkCast { + provider: Z, + inner: Cast, +} + +impl AsRef> for ZkCast +where + P: Provider, + T: Transport + Clone, + Z: Provider, +{ + fn as_ref(&self) -> &Cast { + &self.inner + } +} + +impl ZkCast +where + P: Provider, + T: Transport + Clone, + Z: Provider, +{ + /// Creates a new Cast instance from the provided client + /// + /// # Example + /// + /// ``` + /// use alloy_provider::{network::AnyNetwork, ProviderBuilder, RootProvider}; + /// use cast::Cast; + /// + /// # async fn foo() -> eyre::Result<()> { + /// let provider = + /// ProviderBuilder::<_, _, AnyNetwork>::default().on_builtin("http://localhost:8545").await?; + /// let cast = Cast::new(provider); + /// let zk_provider = + /// ProviderBuilder::<_, _, Zksync>::default().on_builtin("http://localhost:8011").await?; + /// let zk_cast = ZkCast::new(provider, cast); + /// # Ok(()) + /// # } + /// ``` + pub fn new(provider: Z, cast: Cast) -> Self { + Self { provider, inner: cast } + } + + pub async fn send_zk( + &self, + tx: ZkTransactionRequest, + ) -> Result> { + let res = self.provider.send_transaction(tx).await?; + + Ok(res) + } +} + +// pub struct Cast { +// provider: P, +// zk_provider: Option, +// transport: PhantomData, +// } + +// impl Cast +// where +// T: Transport + Clone, +// P: Provider, +// Z: Provider, +// { pub struct Cast { provider: P, transport: PhantomData, diff --git a/crates/cheatcodes/Cargo.toml b/crates/cheatcodes/Cargo.toml index 2ddec87d3..e817e1598 100644 --- a/crates/cheatcodes/Cargo.toml +++ b/crates/cheatcodes/Cargo.toml @@ -34,7 +34,6 @@ forge-script-sequence.workspace = true foundry-zksync-core.workspace = true foundry-zksync-compiler.workspace = true foundry-zksync-inspectors.workspace = true -zksync-web3-rs.workspace = true zksync_types.workspace = true diff --git a/crates/cheatcodes/src/inspector.rs b/crates/cheatcodes/src/inspector.rs index aad1f7dfd..e329ea4e2 100644 --- a/crates/cheatcodes/src/inspector.rs +++ b/crates/cheatcodes/src/inspector.rs @@ -76,12 +76,12 @@ use std::{ }; use zksync_types::{ block::{pack_block_info, unpack_block_info}, + transaction_request::PaymasterParams, utils::{decompose_full_nonce, nonces_to_full_nonce}, ACCOUNT_CODE_STORAGE_ADDRESS, CONTRACT_DEPLOYER_ADDRESS, CURRENT_VIRTUAL_BLOCK_INFO_POSITION, H256, KNOWN_CODES_STORAGE_ADDRESS, L2_BASE_TOKEN_ADDRESS, NONCE_HOLDER_ADDRESS, SYSTEM_CONTEXT_ADDRESS, }; -use zksync_web3_rs::eip712::PaymasterParams; mod utils; diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 65e433d08..89af3647f 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -19,7 +19,6 @@ foundry-config.workspace = true foundry-debugger.workspace = true foundry-evm.workspace = true foundry-wallets.workspace = true -zksync-web3-rs.workspace = true foundry-compilers = { workspace = true, features = ["full"] } diff --git a/crates/cli/src/opts/build/zksync.rs b/crates/cli/src/opts/build/zksync.rs index a463975e8..d6a0e1c2b 100644 --- a/crates/cli/src/opts/build/zksync.rs +++ b/crates/cli/src/opts/build/zksync.rs @@ -1,10 +1,10 @@ use std::{collections::HashSet, path::PathBuf}; +use alloy_primitives::{Address, Bytes}; use clap::Parser; use foundry_compilers::zksolc::settings::{ZkSolcError, ZkSolcWarning}; use foundry_config::ZkSyncConfig; use serde::Serialize; -use zksync_web3_rs::types::{Address, Bytes}; #[derive(Clone, Debug, Default, Serialize, Parser)] #[clap(next_help_heading = "ZKSync configuration")] diff --git a/crates/common/src/provider/mod.rs b/crates/common/src/provider/mod.rs index 2d92efcd3..b88d9c00f 100644 --- a/crates/common/src/provider/mod.rs +++ b/crates/common/src/provider/mod.rs @@ -87,6 +87,12 @@ pub fn try_get_http_provider(builder: impl AsRef) -> Result ProviderBuilder::new(builder.as_ref()).build() } +/// Constructs a ZKsync provider with a 100 millisecond interval poll if it's a localhost URL (most +/// likely an anvil or other dev node) and with the default, or 7 second otherwise. +#[inline] +pub fn try_get_zksync_http_provider(builder: impl AsRef) -> Result> { + ProviderBuilder::new(builder.as_ref()).build_zksync() +} /// Helper type to construct a `RetryProvider` #[derive(Debug)] pub struct ProviderBuilder { diff --git a/crates/forge/Cargo.toml b/crates/forge/Cargo.toml index 4c7ded70b..cd30adeb6 100644 --- a/crates/forge/Cargo.toml +++ b/crates/forge/Cargo.toml @@ -116,7 +116,6 @@ soldeer-commands.workspace = true quick-junit = "0.5.0" # zk -zksync-web3-rs.workspace = true zksync_types.workspace = true [target.'cfg(unix)'.dependencies] diff --git a/crates/forge/bin/cmd/create.rs b/crates/forge/bin/cmd/create.rs index a8167bb9b..50957eb6d 100644 --- a/crates/forge/bin/cmd/create.rs +++ b/crates/forge/bin/cmd/create.rs @@ -8,7 +8,11 @@ use alloy_rpc_types::{AnyTransactionReceipt, TransactionRequest}; use alloy_serde::WithOtherFields; use alloy_signer::Signer; use alloy_transport::{Transport, TransportError}; -use alloy_zksync::{network::Zksync, provider::ZksyncProvider, wallet::ZksyncWallet}; +use alloy_zksync::{ + network::{unsigned_tx::eip712::PaymasterParams, Zksync}, + provider::ZksyncProvider, + wallet::ZksyncWallet, +}; use clap::{Parser, ValueHint}; use eyre::{Context, Result}; use forge_verify::{zk_provider::CompilerVerificationContext, RetryArgs}; @@ -44,7 +48,6 @@ use std::{ sync::Arc, }; use zksync_types::H256; -use zksync_web3_rs::eip712::PaymasterParams; merge_impl_figment_convert!(CreateArgs, opts, eth); @@ -136,8 +139,7 @@ impl CreateArgs { .zk .paymaster_input .clone() - .unwrap_or_default() - .to_vec(), + .unwrap_or_default(), }) } else { None @@ -259,7 +261,9 @@ impl CreateArgs { // and potentially other devices that rely on HID too let zk_signer = self.eth.wallet.signer().await?; let deployer = zk_signer.address(); - let provider = ProviderBuilder::<_, _, Zksync>::default().wallet(ZksyncWallet::new(signer)).on_provider(provider); + let provider = ProviderBuilder::<_, _, Zksync>::default() + .wallet(ZksyncWallet::new(zk_signer)) + .on_provider(provider); self.deploy_zk( abi, bin.object, @@ -630,15 +634,14 @@ impl CreateArgs { } let fee = provider - .estimate_fee(&deployer.tx) + .estimate_fee(deployer.tx.clone()) .await - .map_err(|err| eyre::eyre!("failed rpc call for estimating fee: {:?}", err))? - .unwrap_or_default(); + .map_err(|err| eyre::eyre!("failed rpc call for estimating fee: {:?}", err))?; deployer.tx.set_gas_limit(if let Some(gas_limit) = self.tx.gas_limit { gas_limit.to::() } else { - fee.gas_limit.saturating_to::() + fee.gas_limit }); // Before we actually deploy the contract we try check if the verify settings are valid @@ -1079,11 +1082,11 @@ where .into(); // create the tx object. Since we're deploying a contract, `to` is `None` - let tx = alloy_zksync::network::transaction_request::TransactionRequest::default().base( + let tx: alloy_zksync::network::transaction_request::TransactionRequest = TransactionRequest::default() .to(foundry_zksync_core::CONTRACT_DEPLOYER_ADDRESS.to_address()) - .input(data.into()), - ); + .input(data.into()) + .into(); Ok(ZkDeployer { client: self.client.clone(), diff --git a/crates/script/Cargo.toml b/crates/script/Cargo.toml index 2f33e8887..a48ca8dac 100644 --- a/crates/script/Cargo.toml +++ b/crates/script/Cargo.toml @@ -58,9 +58,9 @@ alloy-primitives.workspace = true alloy-eips.workspace = true alloy-transport.workspace = true alloy-consensus.workspace = true +alloy-zksync.workspace = true -# zksync -zksync-web3-rs.workspace = true +zksync_types.workspace = true [dev-dependencies] tempfile.workspace = true diff --git a/crates/script/src/broadcast.rs b/crates/script/src/broadcast.rs index d837abde5..fa7ac9a13 100644 --- a/crates/script/src/broadcast.rs +++ b/crates/script/src/broadcast.rs @@ -3,35 +3,40 @@ use crate::{ verify::BroadcastedState, ScriptArgs, ScriptConfig, }; use alloy_chains::Chain; -use alloy_consensus::{Transaction, TxEnvelope}; +use alloy_consensus::TxEnvelope; use alloy_eips::eip2718::Encodable2718; use alloy_network::{AnyNetwork, EthereumWallet, TransactionBuilder}; use alloy_primitives::{ map::{AddressHashMap, AddressHashSet}, utils::format_units, - Address, TxHash, + Address, Bytes, TxHash, }; use alloy_provider::{utils::Eip1559Estimation, Provider}; use alloy_rpc_types::TransactionRequest; use alloy_serde::WithOtherFields; use alloy_transport::Transport; +use alloy_zksync::network::{ + transaction_request::TransactionRequest as ZkTransactionRequest, Zksync, +}; use eyre::{bail, Context, Result}; use forge_verify::provider::VerificationProviderType; use foundry_cheatcodes::Wallets; use foundry_cli::utils::{has_batch_support, has_different_gas_calc}; use foundry_common::{ - provider::{get_http_provider, try_get_http_provider, RetryProvider}, + provider::{ + get_http_provider, try_get_http_provider, try_get_zksync_http_provider, RetryProvider, + }, TransactionMaybeSigned, }; use foundry_config::Config; use foundry_zksync_core::{ - convert::{ConvertAddress, ConvertBytes, ConvertSignature, ToSignable}, + convert::{ConvertH160, ConvertU256}, ZkTransactionMetadata, }; use futures::{future::join_all, StreamExt}; use itertools::Itertools; use std::{cmp::Ordering, sync::Arc}; -use zksync_web3_rs::eip712::{Eip712Meta, Eip712Transaction, Eip712TransactionRequest}; +use zksync_types::fee::Fee; pub async fn estimate_gas( tx: &mut WithOtherFields, @@ -60,53 +65,10 @@ pub async fn next_nonce(caller: Address, provider_url: &str) -> eyre::Result, - tx: WithOtherFields, - zk: &ZkTransactionMetadata, -) -> Result<(Eip712TransactionRequest, Eip712Transaction)> { - let mut custom_data = Eip712Meta::new().factory_deps(zk.factory_deps.clone()); - - if let Some(paymaster_params) = &zk.paymaster_data { - custom_data = custom_data.paymaster_params(paymaster_params.clone()); - } - - let gas_price = match tx.gas_price() { - Some(price) => price, - None => provider.get_gas_price().await?, - }; - - let mut deploy_request = Eip712TransactionRequest::new() - .r#type(zksync_web3_rs::zks_utils::EIP712_TX_TYPE) - .from(Address(*tx.from().unwrap()).to_h160()) - .to(tx.to().map(|to| to.to_h160()).unwrap()) - .chain_id(tx.chain_id().unwrap()) - .nonce(tx.nonce().unwrap()) - .data(tx.input().cloned().unwrap_or_default().to_ethers()) - .gas_price(gas_price) - .custom_data(custom_data); - - let fee: zksync_web3_rs::zks_provider::types::Fee = - provider.raw_request("zks_estimateFee".into(), [deploy_request.clone()]).await.unwrap(); - deploy_request = deploy_request - .gas_limit(fee.gas_limit) - .max_fee_per_gas(fee.max_fee_per_gas) - .max_priority_fee_per_gas(fee.max_priority_fee_per_gas); - deploy_request.custom_data.gas_per_pubdata = fee.gas_per_pubdata_limit; - - // TODO: This is a work around as try_into is not propagating - // gas_per_pubdata_byte_limit. It always set the default We would need to - // fix that library or add EIP712 to alloy with correct implementation. - let mut signable: Eip712Transaction = - deploy_request.clone().try_into().wrap_err("converting deploy request")?; - signable.gas_per_pubdata_byte_limit = deploy_request.custom_data.gas_per_pubdata; - - Ok((deploy_request, signable)) -} - #[allow(clippy::too_many_arguments)] pub async fn send_transaction( provider: Arc, + zk_provider: Arc>, mut kind: SendTransactionKind<'_>, zk: Option<&ZkTransactionMetadata>, sequential_broadcast: bool, @@ -143,63 +105,64 @@ pub async fn send_transaction( // Chains which use `eth_estimateGas` are being sent sequentially and require their // gas to be re-estimated right before broadcasting. if !is_fixed_gas_limit && estimate_via_rpc { - // manually add factory_deps to estimate_gas - if let Some(zk) = zk { - tx.other.insert( - "eip712Meta".into(), - serde_json::to_value(&Eip712Meta { - factory_deps: zk.factory_deps.clone(), - ..Default::default() - }) - .expect("failed serializing json"), - ); + // We skip estimating gas for zk transactions as the fee is estimated manually later. + if zk.is_none() { + estimate_gas(tx, &provider, estimate_multiplier).await?; } - estimate_gas(tx, &provider, estimate_multiplier).await?; } } - let pending = match kind { + let pending_tx_hash = match kind { SendTransactionKind::Unlocked(tx) => { debug!("sending transaction from unlocked account {:?}", tx); // Submit the transaction - provider.send_transaction(tx).await? + *provider.send_transaction(tx).await?.tx_hash() } SendTransactionKind::Raw(tx, signer) => { debug!("sending transaction: {:?}", tx); - let signed = if let Some(zk) = zk { - let signer = signer - .signer_by_address(tx.from.expect("no sender")) - .ok_or(eyre::eyre!("Signer not found"))?; - - let (deploy_request, signable) = convert_to_zksync(&provider, tx, zk).await?; - let mut signable = signable.to_signable_tx(); - - let signature = signer - .sign_transaction(&mut signable) + if let Some(zk) = zk { + let mut zk_tx: ZkTransactionRequest = tx.inner.clone().into(); + if !zk.factory_deps.is_empty() { + zk_tx.set_factory_deps( + zk.factory_deps.iter().map(|bytes| Bytes::from_iter(bytes)).collect(), + ); + } + if let Some(paymaster_data) = &zk.paymaster_data { + zk_tx.set_paymaster( + alloy_zksync::network::unsigned_tx::eip712::PaymasterParams { + paymaster: paymaster_data.paymaster.to_address(), + paymaster_input: paymaster_data.paymaster_input.clone().into(), + }, + ); + } + let fee = provider + .raw_request::<_, Fee>("zks_estimateFee".into(), [&zk_tx]) .await - .wrap_err("Failed to sign typed data")?; + .unwrap(); + zk_tx.set_gas_limit(fee.gas_limit.as_u64()); + zk_tx.set_max_fee_per_gas(fee.max_fee_per_gas.as_u128()); + zk_tx.set_max_priority_fee_per_gas(fee.max_priority_fee_per_gas.as_u128()); + zk_tx.set_gas_per_pubdata(fee.gas_per_pubdata_limit.to_ru256()); - let encoded = &*deploy_request - .rlp_signed(signature.to_ethers()) - .wrap_err("able to rlp encode deploy request")?; + let zk_signer = alloy_zksync::wallet::ZksyncWallet::new(signer.default_signer()); + let signed = zk_tx.build(&zk_signer).await?.encoded_2718(); - [&[signable.ty()], encoded].concat() + *zk_provider.send_raw_transaction(signed.as_ref()).await?.tx_hash() } else { - tx.build(signer).await?.encoded_2718() - }; - - // Submit the raw transaction - provider.send_raw_transaction(signed.as_ref()).await? + let signed = tx.build(signer).await?.encoded_2718(); + // Submit the raw transaction + *provider.send_raw_transaction(signed.as_ref()).await?.tx_hash() + } } SendTransactionKind::Signed(tx) => { debug!("sending transaction: {:?}", tx); - provider.send_raw_transaction(tx.encoded_2718().as_ref()).await? + *provider.send_raw_transaction(tx.encoded_2718().as_ref()).await?.tx_hash() } }; - Ok(*pending.tx_hash()) + Ok(pending_tx_hash) } /// How to send a single transaction @@ -339,6 +302,7 @@ impl BundledState { let mut sequence = self.sequence.sequences_mut().get_mut(i).unwrap(); let provider = Arc::new(try_get_http_provider(sequence.rpc_url())?); + let zk_provider = Arc::new(try_get_zksync_http_provider(sequence.rpc_url())?); let already_broadcasted = sequence.receipts.len(); let seq_progress = progress.get_sequence_progress(i, sequence); @@ -446,6 +410,7 @@ impl BundledState { for (kind, zk, is_fixed_gas_limit) in batch { let fut = send_transaction( provider.clone(), + zk_provider.clone(), kind.clone(), zk.as_ref(), sequential_broadcast, diff --git a/crates/zksync/core/Cargo.toml b/crates/zksync/core/Cargo.toml index e3532b466..97a03ca66 100644 --- a/crates/zksync/core/Cargo.toml +++ b/crates/zksync/core/Cargo.toml @@ -16,15 +16,12 @@ foundry-common.workspace = true foundry-evm-abi.workspace = true foundry-cheatcodes-common.workspace = true alloy-primitives.workspace = true -alloy-signer.workspace = true alloy-network.workspace = true alloy-sol-types.workspace = true -alloy-dyn-abi.workspace = true alloy-serde.workspace = true alloy-provider.workspace = true alloy-transport.workspace = true alloy-rpc-types.workspace = true -alloy-consensus.workspace = true itertools.workspace = true revm = { workspace = true, default-features = false, features = [ "std", @@ -38,13 +35,11 @@ revm = { workspace = true, default-features = false, features = [ ] } tracing.workspace = true serde.workspace = true -serde_json.workspace = true # zk zksync_multivm.workspace = true zksync_basic_types.workspace = true zksync_types.workspace = true -zksync-web3-rs.workspace = true era_test_node.workspace = true zksync_utils.workspace = true zksync_contracts.workspace = true diff --git a/crates/zksync/core/src/convert.rs b/crates/zksync/core/src/convert.rs index c6f84a6f9..0702b332f 100644 --- a/crates/zksync/core/src/convert.rs +++ b/crates/zksync/core/src/convert.rs @@ -5,12 +5,6 @@ use revm::primitives::{Address, B256}; use zksync_basic_types::{H160, H256, U256}; use zksync_utils::{address_to_h256, h256_to_u256, u256_to_h256}; -use alloy_primitives::{Bytes as AlloyBytes, Signature as AlloySignature}; -use zksync_web3_rs::types::{Bytes as ZkBytes, Signature as ZkSignature}; - -mod eip712; -pub use eip712::*; - /// Conversions from [U256] pub trait ConvertU256 { /// Convert to [rU256] @@ -136,67 +130,6 @@ impl ConvertAddress for Address { } } -/// Conversions to/from [`ZkSignature`] & [`AlloySignature`] -pub trait ConvertSignature { - /// Cast to [`ZkSignature`] - fn to_ethers(self) -> ZkSignature; - /// Cast to [`AlloySignature`] - fn to_alloy(self) -> AlloySignature; -} - -impl ConvertSignature for ZkSignature { - fn to_ethers(self) -> ZkSignature { - self - } - - fn to_alloy(self) -> AlloySignature { - AlloySignature::from_rs_and_parity(self.r.to_ru256(), self.s.to_ru256(), self.v).unwrap() - } -} - -impl ConvertSignature for AlloySignature { - fn to_ethers(self) -> ZkSignature { - let v = self.v(); - ZkSignature { - r: self.r().to_u256(), - s: self.s().to_u256(), - v: v.y_parity_byte_non_eip155().unwrap_or(v.y_parity_byte()) as u64, - } - } - - fn to_alloy(self) -> AlloySignature { - self - } -} - -/// Convert to/from [`AlloyBytes`] & [`ZkBytes`] -pub trait ConvertBytes { - /// Convert to [`AlloyBytes`] - fn to_alloy(self) -> AlloyBytes; - /// Convert to [`ZkBytes`] - fn to_ethers(self) -> ZkBytes; -} - -impl ConvertBytes for AlloyBytes { - fn to_alloy(self) -> AlloyBytes { - self - } - - fn to_ethers(self) -> ZkBytes { - ZkBytes(self.0) - } -} - -impl ConvertBytes for ZkBytes { - fn to_alloy(self) -> AlloyBytes { - AlloyBytes(self.0) - } - - fn to_ethers(self) -> ZkBytes { - self - } -} - #[cfg(test)] mod test { use std::str::FromStr; diff --git a/crates/zksync/core/src/convert/eip712.rs b/crates/zksync/core/src/convert/eip712.rs deleted file mode 100644 index 228d598fd..000000000 --- a/crates/zksync/core/src/convert/eip712.rs +++ /dev/null @@ -1,242 +0,0 @@ -use alloy_consensus::{SignableTransaction, Transaction}; -use alloy_dyn_abi::TypedData; -use alloy_primitives::{bytes::BufMut, Signature, B256}; -/// Conversion between ethers and alloy for EIP712 items -use alloy_sol_types::Eip712Domain as AlloyEip712Domain; -use zksync_web3_rs::{ - eip712::Eip712Transaction, - types::transaction::eip712::{ - encode_type, EIP712Domain as EthersEip712Domain, Eip712 as EthersEip712, Eip712DomainType, - Types, - }, - zks_utils::EIP712_TX_TYPE, -}; - -use super::{ConvertAddress, ConvertH160, ConvertRU256, ConvertU256}; - -/// Convert between Eip712Domain types -pub trait ConvertEIP712Domain { - /// Cast to ethers-rs's Eip712Domain - fn to_ethers(self) -> EthersEip712Domain; - - /// Cast to alloy-rs's Eip712Domain - fn to_alloy(self) -> AlloyEip712Domain; -} - -impl ConvertEIP712Domain for AlloyEip712Domain { - fn to_ethers(self) -> EthersEip712Domain { - EthersEip712Domain { - name: self.name.map(Into::into), - version: self.version.map(Into::into), - chain_id: self.chain_id.map(ConvertRU256::to_u256), - verifying_contract: self.verifying_contract.map(ConvertAddress::to_h160), - salt: self.salt.map(Into::into), - } - } - - fn to_alloy(self) -> AlloyEip712Domain { - self - } -} - -impl ConvertEIP712Domain for EthersEip712Domain { - fn to_ethers(self) -> EthersEip712Domain { - self - } - - fn to_alloy(self) -> AlloyEip712Domain { - AlloyEip712Domain::new( - self.name.map(Into::into), - self.version.map(Into::into), - self.chain_id.map(ConvertU256::to_ru256), - self.verifying_contract.map(ConvertH160::to_address), - self.salt.map(Into::into), - ) - } -} - -/// Wrapper around [`Eip712Transaction`] implementing [`SignableTransaction`] -#[derive(Debug)] -pub struct Eip712SignableTransaction { - inner: Eip712Transaction, - input: alloy_primitives::Bytes, -} - -impl Eip712SignableTransaction { - /// Creates a new `Eip712SignableTransaction` from an existing `Eip712Transaction`. - pub fn new(inner: Eip712Transaction) -> Self { - Self { input: alloy_primitives::Bytes::from_iter(inner.data.iter()), inner } - } -} - -impl Transaction for Eip712SignableTransaction { - fn chain_id(&self) -> Option { - Some(self.inner.chain_id.as_u64()) - } - - fn nonce(&self) -> u64 { - self.inner.nonce.as_u64() - } - - fn gas_limit(&self) -> u64 { - self.inner.gas_limit.as_u64() - } - - fn gas_price(&self) -> Option { - None - } - - fn to(&self) -> Option { - Some(self.inner.to.to_address()) - } - - fn value(&self) -> alloy_primitives::U256 { - self.inner.value.to_ru256() - } - - fn input(&self) -> &alloy_primitives::Bytes { - &self.input - } - - fn max_fee_per_gas(&self) -> u128 { - self.inner.max_fee_per_gas.low_u128() - } - - fn max_priority_fee_per_gas(&self) -> Option { - Some(self.priority_fee_or_price()) - } - - fn max_fee_per_blob_gas(&self) -> Option { - None - } - - fn priority_fee_or_price(&self) -> u128 { - self.inner.max_priority_fee_per_gas.low_u128() - } - - fn ty(&self) -> u8 { - EIP712_TX_TYPE - } - - fn access_list(&self) -> Option<&alloy_rpc_types::AccessList> { - None - } - - fn blob_versioned_hashes(&self) -> Option<&[B256]> { - None - } - - fn authorization_list(&self) -> Option<&[revm::primitives::SignedAuthorization]> { - None - } - - fn kind(&self) -> alloy_primitives::TxKind { - alloy_primitives::TxKind::Call(self.inner.to.to_address()) - } -} - -impl SignableTransaction for Eip712SignableTransaction { - fn set_chain_id(&mut self, chain_id: alloy_primitives::ChainId) { - self.inner.chain_id = chain_id.into(); - } - - fn encode_for_signing(&self, out: &mut dyn BufMut) { - out.put_u8(0x19); - out.put_u8(0x01); - - let domain_separator = self.inner.domain_separator().expect("able to get domain separator"); - out.put_slice(&domain_separator); - - let struct_hash = self.inner.struct_hash().expect("able to get struct hash"); - out.put_slice(&struct_hash); - } - - fn payload_len_for_signature(&self) -> usize { - 2 + 32 + 32 - } - - fn into_signed(self, signature: Signature) -> alloy_consensus::Signed - where - Self: Sized, - { - let hash = self.inner.encode_eip712().map(B256::from).expect("able to encode EIP712 hash"); - alloy_consensus::Signed::new_unchecked(self, signature, hash) - } -} - -/// Convert to [`SignableTransaction`] -pub trait ToSignable { - /// Type to convert to - type Signable: SignableTransaction; - - /// Perform conversion - fn to_signable_tx(self) -> Self::Signable; -} - -impl ToSignable for Eip712Transaction { - type Signable = Eip712SignableTransaction; - - fn to_signable_tx(self) -> Self::Signable { - Eip712SignableTransaction::new(self) - } -} - -/// Convert to [`TypedData`] -pub trait ToTypedData { - /// Convert item to [`TypedData`] - fn to_typed_data(self) -> TypedData; -} - -impl ToTypedData for Eip712Transaction { - fn to_typed_data(self) -> TypedData { - use alloy_dyn_abi::*; - - let types = eip712_transaction_types(); - let primary_type = types.first_key_value().unwrap().0.clone(); - - let domain = EthersEip712::domain(&self).expect("Eip712Transaction has domain").to_alloy(); - - let message = serde_json::to_value(&self).expect("able to serialize as json"); - - let encode_type = encode_type(&primary_type, &types).expect("able to encodeType"); - - let resolver = { - let mut resolver = Resolver::default(); - resolver.ingest_string(&encode_type).expect("able to ingest encodeType"); - resolver - }; - - TypedData { domain, resolver, primary_type, message } - } -} - -//zksync_web3_rs::eip712::transaction -fn eip712_transaction_types() -> Types { - let mut types = Types::new(); - - types.insert( - "Transaction".to_owned(), - vec![ - Eip712DomainType { name: "txType".to_owned(), r#type: "uint256".to_owned() }, - Eip712DomainType { name: "from".to_owned(), r#type: "uint256".to_owned() }, - Eip712DomainType { name: "to".to_owned(), r#type: "uint256".to_owned() }, - Eip712DomainType { name: "gasLimit".to_owned(), r#type: "uint256".to_owned() }, - Eip712DomainType { - name: "gasPerPubdataByteLimit".to_owned(), - r#type: "uint256".to_owned(), - }, - Eip712DomainType { name: "maxFeePerGas".to_owned(), r#type: "uint256".to_owned() }, - Eip712DomainType { - name: "maxPriorityFeePerGas".to_owned(), - r#type: "uint256".to_owned(), - }, - Eip712DomainType { name: "paymaster".to_owned(), r#type: "uint256".to_owned() }, - Eip712DomainType { name: "nonce".to_owned(), r#type: "uint256".to_owned() }, - Eip712DomainType { name: "value".to_owned(), r#type: "uint256".to_owned() }, - Eip712DomainType { name: "data".to_owned(), r#type: "bytes".to_owned() }, - Eip712DomainType { name: "factoryDeps".to_owned(), r#type: "bytes32[]".to_owned() }, - Eip712DomainType { name: "paymasterInput".to_owned(), r#type: "bytes".to_owned() }, - ], - ); - types -} diff --git a/crates/zksync/core/src/lib.rs b/crates/zksync/core/src/lib.rs index 80af94fcd..3553b54e1 100644 --- a/crates/zksync/core/src/lib.rs +++ b/crates/zksync/core/src/lib.rs @@ -18,18 +18,14 @@ pub mod vm; /// ZKSync Era State implementation. pub mod state; -use alloy_network::{AnyNetwork, TxSigner}; +use alloy_network::AnyNetwork; use alloy_primitives::{address, hex, keccak256, Address, Bytes, U256 as rU256}; use alloy_provider::Provider; use alloy_rpc_types::TransactionRequest; use alloy_serde::WithOtherFields; -use alloy_signer::Signature; use alloy_transport::Transport; -use convert::{ - ConvertAddress, ConvertBytes, ConvertH160, ConvertH256, ConvertRU256, ConvertSignature, - ToSignable, -}; -use eyre::{eyre, OptionExt}; +use convert::{ConvertAddress, ConvertH160, ConvertH256, ConvertRU256}; +use eyre::eyre; use serde::{Deserialize, Serialize}; pub use utils::{fix_l2_gas_limit, fix_l2_gas_price}; @@ -42,13 +38,10 @@ pub use zksync_types::{ IMMUTABLE_SIMULATOR_STORAGE_ADDRESS, KNOWN_CODES_STORAGE_ADDRESS, L2_BASE_TOKEN_ADDRESS, NONCE_HOLDER_ADDRESS, }; -use zksync_types::{utils::storage_key_for_eth_balance, U256}; -pub use zksync_utils::bytecode::hash_bytecode; -use zksync_web3_rs::{ - eip712::{Eip712Meta, Eip712Transaction, Eip712TransactionRequest, PaymasterParams}, - zks_provider::types::Fee, - zks_utils::EIP712_TX_TYPE, +use zksync_types::{ + fee::Fee, transaction_request::PaymasterParams, utils::storage_key_for_eth_balance, U256, }; +pub use zksync_utils::bytecode::hash_bytecode; type Result = std::result::Result; @@ -102,78 +95,6 @@ impl ZkTransactionMetadata { Self { factory_deps, paymaster_data } } } - -/// Creates a new signed EIP-712 transaction with the provided factory deps. -pub async fn new_eip712_transaction< - P: Provider, - S: TxSigner + Sync, - T: Transport + Clone, ->( - tx: WithOtherFields, - factory_deps: Vec>, - paymaster_data: Option, - provider: P, - signer: S, -) -> Result { - let from = tx.from.ok_or_eyre("`from` cannot be empty")?; - let to = tx - .to - .and_then(|to| match to { - alloy_primitives::TxKind::Create => None, - alloy_primitives::TxKind::Call(to) => Some(to), - }) - .ok_or_eyre("`to` cannot be empty")?; - let chain_id = tx.chain_id.ok_or_eyre("`chain_id` cannot be empty")?; - let nonce = tx.nonce.ok_or_eyre("`nonce` cannot be empty")?; - let gas_price = tx.gas_price.ok_or_eyre("`gas_price` cannot be empty")?; - - let data = tx.input.clone().into_input().unwrap_or_default(); - let mut custom_data = Eip712Meta::new().factory_deps(factory_deps); - if let Some(params) = paymaster_data { - custom_data = custom_data.paymaster_params(params); - } - - let mut deploy_request = Eip712TransactionRequest::new() - .r#type(EIP712_TX_TYPE) - .from(from.to_h160()) - .to(to.to_h160()) - .chain_id(chain_id) - .nonce(nonce) - .gas_price(gas_price) - .data(data.to_ethers()) - .custom_data(custom_data); - - let gas_price = provider - .get_gas_price() - .await - .map_err(|err| eyre!("failed retrieving gas_price {:?}", err))?; - let fee: Fee = provider - .raw_request("zks_estimateFee".into(), [deploy_request.clone()]) - .await - .map_err(|err| eyre!("failed estimating fee {:?}", err))?; - deploy_request = deploy_request - .gas_limit(fee.gas_limit) - .max_fee_per_gas(fee.max_fee_per_gas) - .max_priority_fee_per_gas(fee.max_priority_fee_per_gas) - .gas_price(gas_price); - - let signable: Eip712Transaction = deploy_request - .clone() - .try_into() - .map_err(|err| eyre!("failed converting deploy request to eip-712 tx {:?}", err))?; - - let mut signable = signable.to_signable_tx(); - let signature = - signer.sign_transaction(&mut signable).await.expect("Failed to sign typed data"); - let encoded_rlp = deploy_request - .rlp_signed(signature.to_ethers()) - .map_err(|err| eyre!("failed encoding deployment request {:?}", err))?; - - let tx = [&[EIP712_TX_TYPE], encoded_rlp.to_vec().as_slice()].concat().into(); - - Ok(tx) -} - /// Estimated gas from a ZK network. pub struct EstimatedGas { /// Estimated gas price. @@ -185,41 +106,11 @@ pub struct EstimatedGas { /// Estimates the gas parameters for the provided transaction. pub async fn estimate_gas, T: Transport + Clone>( tx: &WithOtherFields, - factory_deps: Vec>, provider: P, ) -> Result { - let to = tx - .to - .and_then(|to| match to { - alloy_primitives::TxKind::Create => None, - alloy_primitives::TxKind::Call(to) => Some(to), - }) - .ok_or_eyre("`to` cannot be empty")?; - let chain_id = tx.chain_id.ok_or_eyre("`chain_id` cannot be empty")?; - let nonce = tx.nonce.ok_or_eyre("`nonce` cannot be empty")?; - let gas_price = if let Some(gas_price) = tx.gas_price { - gas_price - } else { - provider.get_gas_price().await? - }; - let data = tx.input.clone().into_input().unwrap_or_default(); - let custom_data = Eip712Meta::new().factory_deps(factory_deps); - - let mut deploy_request = Eip712TransactionRequest::new() - .r#type(EIP712_TX_TYPE) - .to(to.to_h160()) - .chain_id(chain_id) - .nonce(nonce) - .gas_price(gas_price) - .data(data.to_ethers()) - .custom_data(custom_data); - if let Some(from) = tx.from { - deploy_request = deploy_request.from(from.to_h160()) - } - let gas_price = provider.get_gas_price().await.unwrap(); let fee: Fee = provider - .raw_request("zks_estimateFee".into(), [deploy_request.clone()]) + .raw_request("zks_estimateFee".into(), [tx.clone()]) .await .map_err(|err| eyre!("failed rpc call for estimating fee: {:?}", err))?; diff --git a/crates/zksync/core/src/utils.rs b/crates/zksync/core/src/utils.rs index 191db267f..0f58aa4cc 100644 --- a/crates/zksync/core/src/utils.rs +++ b/crates/zksync/core/src/utils.rs @@ -32,7 +32,7 @@ use alloy_primitives::hex; use eyre::Result; use url::Url; use zksync_basic_types::U256; -use zksync_web3_rs::types::H256; +use zksync_types::H256; /// Gets the RPC URL for Ethereum. /// diff --git a/deny.toml b/deny.toml index 303bfec5b..a30889bca 100644 --- a/deny.toml +++ b/deny.toml @@ -110,9 +110,7 @@ allow-git = [ "https://github.com/alloy-rs/alloy", "https://github.com/paradigmxyz/revm-inspectors", "https://github.com/bluealloy/revm", - "https://github.com/lambdaclass/zksync-web3-rs", "https://github.com/RustCrypto/hashes", - "https://github.com/jrigada/zksync-web3-rs.git", "https://github.com/Karrq/alloy", ]