diff --git a/Cargo.lock b/Cargo.lock index ac89f7a2963..7f5bf5e997a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3351,7 +3351,6 @@ dependencies = [ "tokio", "tracing", "vlog", - "zksync", "zksync_config", "zksync_contracts", "zksync_eth_client", @@ -7923,24 +7922,6 @@ dependencies = [ "sha3 0.10.8", ] -[[package]] -name = "zksync" -version = "0.4.0" -dependencies = [ - "anyhow", - "hex", - "num", - "serde_json", - "thiserror", - "tokio", - "zksync_config", - "zksync_eth_client", - "zksync_eth_signer", - "zksync_types", - "zksync_utils", - "zksync_web3_decl", -] - [[package]] name = "zksync_basic_types" version = "0.1.0" @@ -8256,7 +8237,6 @@ dependencies = [ "zksync_contracts", "zksync_dal", "zksync_db_connection", - "zksync_env_config", "zksync_eth_client", "zksync_eth_signer", "zksync_health_check", @@ -8267,7 +8247,6 @@ dependencies = [ "zksync_object_store", "zksync_protobuf", "zksync_protobuf_build", - "zksync_protobuf_config", "zksync_prover_interface", "zksync_queued_job_processor", "zksync_state", @@ -8465,7 +8444,6 @@ dependencies = [ name = "zksync_l1_contract_interface" version = "0.1.0" dependencies = [ - "circuit_sequencer_api 0.1.0", "codegen 0.1.0", "hex", "kzg", @@ -8779,7 +8757,6 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "serde_with", "strum", "thiserror", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 50bde4a95cd..f95f61117a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,8 +49,6 @@ members = [ "core/tests/loadnext", "core/tests/vm-benchmark", "core/tests/vm-benchmark/harness", - # SDK section - "sdk/zksync-rs", ] resolver = "2" diff --git a/core/lib/l1_contract_interface/Cargo.toml b/core/lib/l1_contract_interface/Cargo.toml index 5e79cb1417c..56274c525f9 100644 --- a/core/lib/l1_contract_interface/Cargo.toml +++ b/core/lib/l1_contract_interface/Cargo.toml @@ -15,8 +15,6 @@ zksync_prover_interface.workspace = true # Used to serialize proof data crypto_codegen.workspace = true -# Used to calculate commitment for vk from the old L1 verifier contract (backward comatibility needs) -circuit_sequencer_api_1_3_3.workspace = true # Used to calculate the kzg commitment and proofs kzg.workspace = true diff --git a/core/lib/types/Cargo.toml b/core/lib/types/Cargo.toml index 0ed3646fc88..8ffa5bf678f 100644 --- a/core/lib/types/Cargo.toml +++ b/core/lib/types/Cargo.toml @@ -26,7 +26,6 @@ once_cell.workspace = true rlp.workspace = true serde.workspace = true serde_json.workspace = true -serde_with = { workspace = true, features = ["base64"] } strum = { workspace = true, features = ["derive"] } thiserror.workspace = true num_enum.workspace = true @@ -40,7 +39,6 @@ blake2.workspace = true [dev-dependencies] tokio = { workspace = true, features = ["rt", "macros"] } -serde_with = { workspace = true, features = ["hex"] } [build-dependencies] zksync_protobuf_build.workspace = true diff --git a/core/lib/zksync_core/Cargo.toml b/core/lib/zksync_core/Cargo.toml index 5623ddcb5df..d3d21334e77 100644 --- a/core/lib/zksync_core/Cargo.toml +++ b/core/lib/zksync_core/Cargo.toml @@ -20,8 +20,6 @@ zksync_dal.workspace = true prover_dal.workspace = true zksync_db_connection.workspace = true zksync_config.workspace = true -zksync_env_config.workspace = true -zksync_protobuf_config.workspace = true zksync_utils.workspace = true zksync_contracts.workspace = true zksync_system_constants.workspace = true diff --git a/core/tests/loadnext/Cargo.toml b/core/tests/loadnext/Cargo.toml index 8fa75f5965a..3fdf92d3b52 100644 --- a/core/tests/loadnext/Cargo.toml +++ b/core/tests/loadnext/Cargo.toml @@ -11,7 +11,6 @@ categories.workspace = true publish = false [dependencies] -zksync = { workspace = true, features = ["mint"] } zksync_types.workspace = true zksync_utils.workspace = true zksync_eth_signer.workspace = true diff --git a/core/tests/loadnext/src/account/api_request_executor.rs b/core/tests/loadnext/src/account/api_request_executor.rs index 18d25a1da9c..20c4bc2f597 100644 --- a/core/tests/loadnext/src/account/api_request_executor.rs +++ b/core/tests/loadnext/src/account/api_request_executor.rs @@ -2,11 +2,6 @@ use std::time::Instant; use rand::seq::IteratorRandom; use regex::Regex; -use zksync::{ - error::{ClientError, RpcError}, - types::FilterBuilder, - EthNamespaceClient, -}; use zksync_types::{api, ethabi::Contract, H256, U64}; use super::{Aborted, AccountLifespan}; @@ -16,6 +11,11 @@ use crate::{ constants::API_REQUEST_TIMEOUT, report::{ApiActionType, ReportBuilder, ReportLabel}, rng::LoadtestRng, + sdk::{ + error::{ClientError, RpcError}, + types::FilterBuilder, + EthNamespaceClient, + }, }; impl AccountLifespan { diff --git a/core/tests/loadnext/src/account/mod.rs b/core/tests/loadnext/src/account/mod.rs index 9a1243151d0..627ef04c1df 100644 --- a/core/tests/loadnext/src/account/mod.rs +++ b/core/tests/loadnext/src/account/mod.rs @@ -6,7 +6,6 @@ use std::{ use futures::{channel::mpsc, SinkExt}; use tokio::sync::RwLock; -use zksync::{error::ClientError, operations::SyncTransactionHandle, HttpClient}; use zksync_contracts::test_contracts::LoadnextContractExecutionParams; use zksync_types::{api::TransactionReceipt, Address, Nonce, H256, U256, U64}; use zksync_web3_decl::jsonrpsee::core::ClientError as CoreError; @@ -18,6 +17,7 @@ use crate::{ config::{LoadtestConfig, RequestLimiters}, constants::{MAX_L1_TRANSACTIONS, POLLING_INTERVAL}, report::{Report, ReportBuilder, ReportLabel}, + sdk::{error::ClientError, operations::SyncTransactionHandle, HttpClient}, utils::format_gwei, }; diff --git a/core/tests/loadnext/src/account/pubsub_executor.rs b/core/tests/loadnext/src/account/pubsub_executor.rs index d3c9d7144f1..246954a26a2 100644 --- a/core/tests/loadnext/src/account/pubsub_executor.rs +++ b/core/tests/loadnext/src/account/pubsub_executor.rs @@ -1,7 +1,6 @@ use std::time::{Duration, Instant}; use futures::{stream, TryStreamExt}; -use zksync::{error::ClientError, types::PubSubFilterBuilder}; use zksync_web3_decl::{ jsonrpsee::{ core::client::{Subscription, SubscriptionClientT}, @@ -17,6 +16,7 @@ use crate::{ config::RequestLimiters, report::{ReportBuilder, ReportLabel}, rng::WeightedRandom, + sdk::{error::ClientError, types::PubSubFilterBuilder}, }; impl AccountLifespan { diff --git a/core/tests/loadnext/src/account/tx_command_executor.rs b/core/tests/loadnext/src/account/tx_command_executor.rs index 618a671bbb2..bdc596b89b2 100644 --- a/core/tests/loadnext/src/account/tx_command_executor.rs +++ b/core/tests/loadnext/src/account/tx_command_executor.rs @@ -1,14 +1,5 @@ use std::time::Instant; -use zksync::{ - error::ClientError, - ethereum::PriorityOpHolder, - utils::{ - get_approval_based_paymaster_input, get_approval_based_paymaster_input_for_estimation, - }, - web3::ethabi, - EthNamespaceClient, -}; use zksync_eth_client::EthInterface; use zksync_system_constants::MAX_L1_TRANSACTION_GAS_LIMIT; use zksync_types::{ @@ -25,6 +16,15 @@ use crate::{ }, corrupted_tx::Corrupted, report::ReportLabel, + sdk::{ + error::ClientError, + ethereum::PriorityOpHolder, + utils::{ + get_approval_based_paymaster_input, get_approval_based_paymaster_input_for_estimation, + }, + web3::ethabi, + EthNamespaceClient, + }, utils::format_gwei, }; diff --git a/core/tests/loadnext/src/account_pool.rs b/core/tests/loadnext/src/account_pool.rs index a6ae8cd6816..7317e635ad8 100644 --- a/core/tests/loadnext/src/account_pool.rs +++ b/core/tests/loadnext/src/account_pool.rs @@ -3,7 +3,6 @@ use std::{collections::VecDeque, convert::TryFrom, str::FromStr, sync::Arc, time use once_cell::sync::OnceCell; use rand::Rng; use tokio::time::timeout; -use zksync::{signer::Signer, HttpClient, HttpClientBuilder, Wallet, ZksNamespaceClient}; use zksync_eth_signer::PrivateKeySigner; use zksync_types::{tx::primitives::PackedEthSignature, Address, L2ChainId, H256}; @@ -12,6 +11,7 @@ use crate::{ corrupted_tx::CorruptedSigner, fs_utils::{loadnext_contract, TestContract}, rng::{LoadtestRng, Random}, + sdk::{signer::Signer, HttpClient, HttpClientBuilder, Wallet, ZksNamespaceClient}, }; /// An alias to [`zksync::Wallet`] with HTTP client. Wrapped in `Arc` since diff --git a/core/tests/loadnext/src/command/api.rs b/core/tests/loadnext/src/command/api.rs index 278f4e1a749..b32620bd343 100644 --- a/core/tests/loadnext/src/command/api.rs +++ b/core/tests/loadnext/src/command/api.rs @@ -1,12 +1,12 @@ use num::Integer; use rand::RngCore; -use zksync::EthNamespaceClient; use zksync_types::api; use crate::{ account_pool::SyncWallet, all::AllWeighted, rng::{LoadtestRng, WeightedRandom}, + sdk::EthNamespaceClient, }; /// Helper enum for generating random block number. diff --git a/core/tests/loadnext/src/corrupted_tx.rs b/core/tests/loadnext/src/corrupted_tx.rs index 9f2b3c95add..3b87cae37f2 100644 --- a/core/tests/loadnext/src/corrupted_tx.rs +++ b/core/tests/loadnext/src/corrupted_tx.rs @@ -1,5 +1,4 @@ use async_trait::async_trait; -use zksync::signer::Signer; use zksync_eth_signer::{ error::SignerError, raw_ethereum_tx::TransactionParameters, EthereumSigner, }; @@ -7,7 +6,7 @@ use zksync_types::{ fee::Fee, l2::L2Tx, Address, EIP712TypedStructure, Eip712Domain, PackedEthSignature, }; -use crate::command::IncorrectnessModifier; +use crate::{command::IncorrectnessModifier, sdk::signer::Signer}; /// Trait that exists solely to extend the signed zkSync transaction interface, providing the ability /// to modify transaction in a way that will make it invalid. diff --git a/core/tests/loadnext/src/executor.rs b/core/tests/loadnext/src/executor.rs index e5623cde70b..3a6dcd42f30 100644 --- a/core/tests/loadnext/src/executor.rs +++ b/core/tests/loadnext/src/executor.rs @@ -2,14 +2,6 @@ use std::sync::Arc; use anyhow::anyhow; use futures::{channel::mpsc, future, SinkExt}; -use zksync::{ - ethereum::{PriorityOpHolder, DEFAULT_PRIORITY_FEE}, - utils::{ - get_approval_based_paymaster_input, get_approval_based_paymaster_input_for_estimation, - }, - web3::types::TransactionReceipt, - EthNamespaceClient, EthereumProvider, ZksNamespaceClient, -}; use zksync_eth_client::{BoundEthInterface, EthInterface, Options}; use zksync_eth_signer::PrivateKeySigner; use zksync_system_constants::MAX_L1_TRANSACTION_GAS_LIMIT; @@ -25,6 +17,14 @@ use crate::{ constants::*, report::ReportBuilder, report_collector::{LoadtestResult, ReportCollector}, + sdk::{ + ethereum::{PriorityOpHolder, DEFAULT_PRIORITY_FEE}, + utils::{ + get_approval_based_paymaster_input, get_approval_based_paymaster_input_for_estimation, + }, + web3::types::TransactionReceipt, + EthNamespaceClient, EthereumProvider, ZksNamespaceClient, + }, utils::format_eth, }; diff --git a/core/tests/loadnext/src/lib.rs b/core/tests/loadnext/src/lib.rs index 9b1f5da95c4..eeb59c9f2fe 100644 --- a/core/tests/loadnext/src/lib.rs +++ b/core/tests/loadnext/src/lib.rs @@ -12,4 +12,5 @@ pub mod fs_utils; pub mod report; pub mod report_collector; pub mod rng; +pub(crate) mod sdk; pub mod utils; diff --git a/core/tests/loadnext/src/rng.rs b/core/tests/loadnext/src/rng.rs index 20f163e69ee..a68c99f37bb 100644 --- a/core/tests/loadnext/src/rng.rs +++ b/core/tests/loadnext/src/rng.rs @@ -1,10 +1,9 @@ use std::convert::TryInto; use rand::{rngs::SmallRng, seq::SliceRandom, thread_rng, RngCore, SeedableRng}; -use zksync::web3::signing::keccak256; use zksync_types::H256; -use crate::all::AllWeighted; +use crate::{all::AllWeighted, sdk::web3::signing::keccak256}; // SmallRng seed type is [u8; 32]. const SEED_SIZE: usize = 32; diff --git a/sdk/zksync-rs/src/abi/IERC20.json b/core/tests/loadnext/src/sdk/abi/IERC20.json similarity index 100% rename from sdk/zksync-rs/src/abi/IERC20.json rename to core/tests/loadnext/src/sdk/abi/IERC20.json diff --git a/sdk/zksync-rs/src/abi/IL1Bridge.json b/core/tests/loadnext/src/sdk/abi/IL1Bridge.json similarity index 100% rename from sdk/zksync-rs/src/abi/IL1Bridge.json rename to core/tests/loadnext/src/sdk/abi/IL1Bridge.json diff --git a/sdk/zksync-rs/src/abi/IPaymasterFlow.json b/core/tests/loadnext/src/sdk/abi/IPaymasterFlow.json similarity index 100% rename from sdk/zksync-rs/src/abi/IPaymasterFlow.json rename to core/tests/loadnext/src/sdk/abi/IPaymasterFlow.json diff --git a/sdk/zksync-rs/src/abi/IZkSync.json b/core/tests/loadnext/src/sdk/abi/IZkSync.json similarity index 100% rename from sdk/zksync-rs/src/abi/IZkSync.json rename to core/tests/loadnext/src/sdk/abi/IZkSync.json diff --git a/sdk/zksync-rs/src/abi/update-abi.sh b/core/tests/loadnext/src/sdk/abi/update-abi.sh similarity index 100% rename from sdk/zksync-rs/src/abi/update-abi.sh rename to core/tests/loadnext/src/sdk/abi/update-abi.sh diff --git a/sdk/zksync-rs/src/error.rs b/core/tests/loadnext/src/sdk/error.rs similarity index 100% rename from sdk/zksync-rs/src/error.rs rename to core/tests/loadnext/src/sdk/error.rs diff --git a/sdk/zksync-rs/src/ethereum/DepositERC20GasLimit.json b/core/tests/loadnext/src/sdk/ethereum/DepositERC20GasLimit.json similarity index 100% rename from sdk/zksync-rs/src/ethereum/DepositERC20GasLimit.json rename to core/tests/loadnext/src/sdk/ethereum/DepositERC20GasLimit.json diff --git a/sdk/zksync-rs/src/ethereum/mod.rs b/core/tests/loadnext/src/sdk/ethereum/mod.rs similarity index 99% rename from sdk/zksync-rs/src/ethereum/mod.rs rename to core/tests/loadnext/src/sdk/ethereum/mod.rs index ce18cea6993..b851889a2f9 100644 --- a/sdk/zksync-rs/src/ethereum/mod.rs +++ b/core/tests/loadnext/src/sdk/ethereum/mod.rs @@ -24,7 +24,7 @@ use zksync_types::{ }; use zksync_web3_decl::namespaces::{EthNamespaceClient, ZksNamespaceClient}; -use crate::{ +use crate::sdk::{ error::ClientError, operations::SyncTransactionHandle, utils::{is_token_eth, load_contract}, @@ -309,7 +309,6 @@ impl EthereumProvider { Ok(transaction_hash) } - #[cfg(feature = "mint")] pub async fn mint_erc20( &self, token_address: Address, diff --git a/sdk/zksync-rs/src/lib.rs b/core/tests/loadnext/src/sdk/mod.rs similarity index 83% rename from sdk/zksync-rs/src/lib.rs rename to core/tests/loadnext/src/sdk/mod.rs index aa4a158ef06..90ce41b83fc 100644 --- a/sdk/zksync-rs/src/lib.rs +++ b/core/tests/loadnext/src/sdk/mod.rs @@ -5,7 +5,7 @@ pub use zksync_web3_decl::{ types, }; -pub use crate::{ethereum::EthereumProvider, wallet::Wallet}; +pub use crate::sdk::{ethereum::EthereumProvider, wallet::Wallet}; pub mod error; pub mod ethereum; diff --git a/sdk/zksync-rs/src/operations/deploy_contract.rs b/core/tests/loadnext/src/sdk/operations/deploy_contract.rs similarity index 99% rename from sdk/zksync-rs/src/operations/deploy_contract.rs rename to core/tests/loadnext/src/sdk/operations/deploy_contract.rs index ef6c55fbfd0..adf1fe09ee7 100644 --- a/sdk/zksync-rs/src/operations/deploy_contract.rs +++ b/core/tests/loadnext/src/sdk/operations/deploy_contract.rs @@ -4,7 +4,7 @@ use zksync_types::{ }; use zksync_utils::bytecode::hash_bytecode; -use crate::{ +use crate::sdk::{ error::ClientError, operations::SyncTransactionHandle, wallet::Wallet, zksync_types::fee::Fee, EthNamespaceClient, ZksNamespaceClient, }; diff --git a/sdk/zksync-rs/src/operations/execute_contract.rs b/core/tests/loadnext/src/sdk/operations/execute_contract.rs similarity index 99% rename from sdk/zksync-rs/src/operations/execute_contract.rs rename to core/tests/loadnext/src/sdk/operations/execute_contract.rs index 66df46580c5..3572d24a8b5 100644 --- a/sdk/zksync-rs/src/operations/execute_contract.rs +++ b/core/tests/loadnext/src/sdk/operations/execute_contract.rs @@ -3,7 +3,7 @@ use zksync_types::{ fee::Fee, l2::L2Tx, transaction_request::PaymasterParams, Address, Nonce, U256, }; -use crate::{ +use crate::sdk::{ error::ClientError, operations::SyncTransactionHandle, wallet::Wallet, EthNamespaceClient, ZksNamespaceClient, }; diff --git a/sdk/zksync-rs/src/operations/mod.rs b/core/tests/loadnext/src/sdk/operations/mod.rs similarity index 92% rename from sdk/zksync-rs/src/operations/mod.rs rename to core/tests/loadnext/src/sdk/operations/mod.rs index 32f90519219..757758ef501 100644 --- a/sdk/zksync-rs/src/operations/mod.rs +++ b/core/tests/loadnext/src/sdk/operations/mod.rs @@ -4,8 +4,7 @@ use std::time::{Duration, Instant}; use zksync_types::{ api::{BlockNumber, TransactionReceipt}, - l2::L2Tx, - Bytes, L2ChainId, H256, + H256, }; pub use self::{ @@ -14,21 +13,13 @@ pub use self::{ transfer::{create_transfer_calldata, TransferBuilder}, withdraw::WithdrawBuilder, }; -use crate::{error::ClientError, EthNamespaceClient}; +use crate::sdk::{error::ClientError, EthNamespaceClient}; mod deploy_contract; mod execute_contract; mod transfer; mod withdraw; -/// Encodes transaction into a bytes sequence in accordance -/// with the zkSync L2 protocol contract. -/// -/// Used for estimating fees and submitting transactions. -pub fn encode_transaction(tx: &L2Tx, chain_id: L2ChainId) -> Result { - Ok(tx.get_rlp_bytes(chain_id)) -} - /// Handle for transaction, providing an interface to control its execution. /// For obtained handle it's possible to set the polling interval, commit timeout /// and verify timeout values. diff --git a/sdk/zksync-rs/src/operations/transfer.rs b/core/tests/loadnext/src/sdk/operations/transfer.rs similarity index 99% rename from sdk/zksync-rs/src/operations/transfer.rs rename to core/tests/loadnext/src/sdk/operations/transfer.rs index f0f7525e8f6..c5036449659 100644 --- a/sdk/zksync-rs/src/operations/transfer.rs +++ b/core/tests/loadnext/src/sdk/operations/transfer.rs @@ -1,7 +1,7 @@ use zksync_eth_signer::EthereumSigner; use zksync_types::{fee::Fee, l2::L2Tx, Address, Nonce, L2_ETH_TOKEN_ADDRESS, U256}; -use crate::{ +use crate::sdk::{ error::ClientError, ethereum::ierc20_contract, operations::SyncTransactionHandle, diff --git a/sdk/zksync-rs/src/operations/withdraw.rs b/core/tests/loadnext/src/sdk/operations/withdraw.rs similarity index 99% rename from sdk/zksync-rs/src/operations/withdraw.rs rename to core/tests/loadnext/src/sdk/operations/withdraw.rs index a580a0c35e0..781876ad101 100644 --- a/sdk/zksync-rs/src/operations/withdraw.rs +++ b/core/tests/loadnext/src/sdk/operations/withdraw.rs @@ -4,7 +4,7 @@ use zksync_types::{ web3::ethabi, Address, Nonce, L2_ETH_TOKEN_ADDRESS, U256, }; -use crate::{ +use crate::sdk::{ error::ClientError, operations::{ExecuteContractBuilder, SyncTransactionHandle}, wallet::Wallet, diff --git a/sdk/zksync-rs/src/signer.rs b/core/tests/loadnext/src/sdk/signer.rs similarity index 97% rename from sdk/zksync-rs/src/signer.rs rename to core/tests/loadnext/src/sdk/signer.rs index 445c5172ff6..9d97f7df82b 100644 --- a/sdk/zksync-rs/src/signer.rs +++ b/core/tests/loadnext/src/sdk/signer.rs @@ -6,7 +6,7 @@ use zksync_types::{ Nonce, PackedEthSignature, L2_ETH_TOKEN_ADDRESS, U256, }; -use crate::{operations::create_transfer_calldata, types::TransactionRequest}; +use crate::sdk::{operations::create_transfer_calldata, types::TransactionRequest}; fn signing_failed_error(err: impl ToString) -> SignerError { SignerError::SigningFailed(err.to_string()) diff --git a/sdk/zksync-rs/src/utils.rs b/core/tests/loadnext/src/sdk/utils.rs similarity index 53% rename from sdk/zksync-rs/src/utils.rs rename to core/tests/loadnext/src/sdk/utils.rs index 6decb062f08..6fa846ec461 100644 --- a/sdk/zksync-rs/src/utils.rs +++ b/core/tests/loadnext/src/sdk/utils.rs @@ -1,9 +1,8 @@ use std::str::FromStr; -use num::BigUint; use zksync_types::{transaction_request::PaymasterParams, Address, U256}; -use crate::web3::ethabi::{Contract, Token}; +use crate::sdk::web3::ethabi::{Contract, Token}; const IPAYMASTER_FLOW_INTERFACE: &str = include_str!("./abi/IPaymasterFlow.json"); @@ -11,19 +10,6 @@ pub fn is_token_eth(token_address: Address) -> bool { token_address == Address::zero() } -/// Converts `U256` into the corresponding `BigUint` value. -pub fn u256_to_biguint(value: U256) -> BigUint { - let mut bytes = [0u8; 32]; - value.to_little_endian(&mut bytes); - BigUint::from_bytes_le(&bytes) -} - -/// Converts `BigUint` value into the corresponding `U256` value. -pub fn biguint_to_u256(value: BigUint) -> U256 { - let bytes = value.to_bytes_le(); - U256::from_little_endian(&bytes) -} - pub fn load_contract(raw_abi_string: &str) -> Contract { let abi_string = serde_json::Value::from_str(raw_abi_string) .expect("Malformed contract abi file") @@ -69,49 +55,3 @@ pub fn get_approval_based_paymaster_input_for_estimation( ) -> PaymasterParams { get_approval_based_paymaster_input(paymaster, token_address, min_allowance, Default::default()) } - -pub fn get_general_paymaster_input(paymaster: Address, inner_input: Vec) -> PaymasterParams { - let paymaster_contract = load_contract(IPAYMASTER_FLOW_INTERFACE); - let paymaster_input = paymaster_contract - .function("general") - .unwrap() - .encode_input(&[Token::Bytes(inner_input)]) - .unwrap(); - PaymasterParams { - paymaster, - paymaster_input, - } -} - -#[cfg(test)] -mod tests { - use super::*; - - fn biguint_u256_conversion_roundrip(u256: U256) { - let biguint = u256_to_biguint(u256); - // Make sure that the string representations are the same. - assert_eq!(biguint.to_string(), u256.to_string()); - - let restored = biguint_to_u256(biguint); - assert_eq!(u256, restored); - } - - #[test] - fn test_zero_conversion() { - biguint_u256_conversion_roundrip(U256::zero()) - } - - #[test] - fn test_biguint_u256_conversion() { - // random value that is big enough - let u256 = U256::from(1_235_999_123_u64).pow(4u64.into()); - biguint_u256_conversion_roundrip(u256) - } - - #[test] - fn test_biguint_with_msb_conversion() { - // make sure the most significant bit was set - let u256 = U256::from_big_endian(&[0b11010011; 32]); - biguint_u256_conversion_roundrip(u256) - } -} diff --git a/sdk/zksync-rs/src/wallet.rs b/core/tests/loadnext/src/sdk/wallet.rs similarity index 99% rename from sdk/zksync-rs/src/wallet.rs rename to core/tests/loadnext/src/sdk/wallet.rs index dd2cdf14208..62dbddbe8aa 100644 --- a/sdk/zksync-rs/src/wallet.rs +++ b/core/tests/loadnext/src/sdk/wallet.rs @@ -11,7 +11,7 @@ use zksync_web3_decl::{ namespaces::{EthNamespaceClient, NetNamespaceClient, Web3NamespaceClient, ZksNamespaceClient}, }; -use crate::{ +use crate::sdk::{ error::ClientError, ethereum::{ierc20_contract, EthereumProvider}, operations::*, diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 2cb0d0b2d78..3ab27af7dd3 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -7834,7 +7834,6 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "serde_with", "strum", "thiserror", "zksync_basic_types", diff --git a/sdk/zksync-rs/CHANGELOG.md b/sdk/zksync-rs/CHANGELOG.md deleted file mode 100644 index dc1f16719e1..00000000000 --- a/sdk/zksync-rs/CHANGELOG.md +++ /dev/null @@ -1,17 +0,0 @@ -# Changelog - -## [0.4.0](https://github.com/matter-labs/zksync-2-dev/compare/zksync-v0.3.0...zksync-v0.4.0) (2023-03-23) - - -### ⚠ BREAKING CHANGES - -* **contracts:** M6 batch of breaking changes ([#1482](https://github.com/matter-labs/zksync-2-dev/issues/1482)) - -### Features - -* **contracts:** M6 batch of breaking changes ([#1482](https://github.com/matter-labs/zksync-2-dev/issues/1482)) ([d28e01c](https://github.com/matter-labs/zksync-2-dev/commit/d28e01ce0fbf0129c2cbba877efe65da7f7ed367)) - - -### Bug Fixes - -* Fix using L1 option parameters ([#1552](https://github.com/matter-labs/zksync-2-dev/issues/1552)) ([a769ca1](https://github.com/matter-labs/zksync-2-dev/commit/a769ca1cfd638b796ff99d30dc2530c2abae6074)) diff --git a/sdk/zksync-rs/Cargo.toml b/sdk/zksync-rs/Cargo.toml deleted file mode 100644 index 4a96c034f85..00000000000 --- a/sdk/zksync-rs/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "zksync" -version = "0.4.0" -authors = ["The Matter Labs Team "] -edition = "2018" -license = "MIT OR Apache-2.0" - -[dependencies] -zksync_types.workspace = true -zksync_utils.workspace = true -zksync_eth_client.workspace = true -zksync_eth_signer.workspace = true -zksync_web3_decl = { workspace = true, features = [ - "client", -] } - -tokio = { workspace = true, features = ["time"] } - -serde_json.workspace = true -num = { workspace = true, features = ["serde"] } -thiserror.workspace = true - -[dev-dependencies] -zksync_config.workspace = true -tokio = { workspace = true, features = ["full"] } -anyhow.workspace = true -hex.workspace = true - -[features] -integration-tests = [] -mint = [] diff --git a/sdk/zksync-rs/README.md b/sdk/zksync-rs/README.md deleted file mode 100644 index 209e7fa4104..00000000000 --- a/sdk/zksync-rs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Rust SDK for zkSync - -This SDK is currently under construction and is only used for internal needs. A public version of the SDK will be -announced later. diff --git a/sdk/zksync-rs/tests/integration.rs b/sdk/zksync-rs/tests/integration.rs deleted file mode 100644 index 10c37c55c68..00000000000 --- a/sdk/zksync-rs/tests/integration.rs +++ /dev/null @@ -1,731 +0,0 @@ -// //! Integration test for zkSync Rust SDK. -// //! -// //! In order to pass these tests, there must be a running -// //! instance of zkSync server and prover: -// //! -// //! ```bash -// //! zk server &! -// //! zk dummy-prover run &! -// //! zk test integration rust-sdk -// //! ``` -// //! -// //! Note: If tests are failing, first check the following two things: -// //! -// //! 1. If tests are failing with an error "cannot operate after unexpected tx failure", -// //! ensure that dummy prover is enabled. -// //! 2. If tests are failing with an error "replacement transaction underpriced", -// //! ensure that tests are ran in one thread. Running the tests with many threads won't -// //! work, since many thread will attempt in sending transactions from one (main) Ethereum -// //! account, which may result in nonce mismatch. -// //! Also, if there will be many tests running at once, and the server will die, it will be -// //! hard to distinguish which test exactly caused this problem. - -// use std::env; -// use std::time::{Duration, Instant}; - -// use zksync::operations::SyncTransactionHandle; -// use zksync::{ -// error::ClientError, -// ethereum::ierc20_contract, -// provider::Provider, -// types::BlockStatus, -// web3::{ -// contract::{Contract, Options}, -// transports::Http, -// types::{Address, H160, H256, U256}, -// }, -// zksync_types::{tx::primitives::PackedEthSignature, Token, TokenLike, TxFeeTypes, ZkSyncTx}, -// EthereumProvider, Network, RpcProvider, Wallet, WalletCredentials, -// }; -// use zksync_eth_signer::{EthereumSigner, PrivateKeySigner}; - -// const ETH_ADDR: &str = "36615Cf349d7F6344891B1e7CA7C72883F5dc049"; -// const ETH_PRIVATE_KEY: &str = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; -// const LOCALHOST_WEB3_ADDR: &str = "http://127.0.0.1:8545"; -// const DOCKER_WEB3_ADDR: &str = "http://reth:8545"; - -// fn web3_addr() -> &'static str { -// let ci: u8 = env::var("CI").map_or(0, |s| s.parse().unwrap()); -// if ci == 1 { -// DOCKER_WEB3_ADDR -// } else { -// LOCALHOST_WEB3_ADDR -// } -// } - -// fn eth_main_account_credentials() -> (H160, H256) { -// let addr = ETH_ADDR.parse().unwrap(); -// let eth_private_key = ETH_PRIVATE_KEY.parse().unwrap(); - -// (addr, eth_private_key) -// } - -// fn eth_random_account_credentials() -> (H160, H256) { -// let mut eth_private_key = H256::default(); -// eth_private_key.randomize(); - -// let address_from_pk = PackedEthSignature::address_from_private_key(ð_private_key).unwrap(); - -// (address_from_pk, eth_private_key) -// } - -// fn one_ether() -> U256 { -// U256::from(10).pow(18.into()) -// } - -// /// Auxiliary function that returns the balance of the account on Ethereum. -// async fn get_ethereum_balance( -// eth_provider: &EthereumProvider, -// address: Address, -// token: &Token, -// ) -> Result { -// if token.symbol == "ETH" { -// return eth_provider -// .client() -// .eth_balance(address) -// .await -// .map_err(|_e| anyhow::anyhow!("failed to request balance from Ethereum {}", _e)); -// } -// eth_provider -// .client() -// .call_contract_function( -// "balanceOf", -// address, -// None, -// Options::default(), -// None, -// token.address, -// ierc20_contract(), -// ) -// .await -// .map_err(|_e| anyhow::anyhow!("failed to request erc20 balance from Ethereum")) -// } - -// async fn wait_for_deposit_and_update_account_id(wallet: &mut Wallet) -// where -// S: EthereumSigner, -// P: Provider + Clone, -// { -// let timeout = Duration::from_secs(60); -// let mut poller = tokio::time::interval(std::time::Duration::from_millis(100)); -// let start = Instant::now(); -// while wallet -// .provider -// .account_info(wallet.address()) -// .await -// .unwrap() -// .id -// .is_none() -// { -// if start.elapsed() > timeout { -// panic!("Timeout elapsed while waiting for Ethereum transaction"); -// } -// poller.tick().await; -// } - -// wallet.update_account_id().await.unwrap(); -// assert!(wallet.account_id().is_some(), "Account ID was not set"); -// } - -// async fn transfer_to( -// token_like: impl Into, -// amount: impl Into, -// to: H160, -// ) -> Result<(), anyhow::Error> { -// let (main_eth_address, main_eth_private_key) = eth_main_account_credentials(); - -// let provider = RpcProvider::new(Network::Localhost); -// let eth_signer = PrivateKeySigner::new(main_eth_private_key); -// let credentials = -// WalletCredentials::from_eth_signer(main_eth_address, eth_signer, Network::Localhost) -// .await -// .unwrap(); - -// let wallet = Wallet::new(provider, credentials).await?; -// let ethereum = wallet.ethereum(web3_addr()).await?; -// let hash = ethereum -// .transfer(token_like.into(), amount.into(), to) -// .await -// .unwrap(); - -// ethereum.wait_for_tx(hash).await?; -// Ok(()) -// } - -// /// Creates a new wallet and tries to make a transfer -// /// from a new wallet without SigningKey. -// async fn test_tx_fail(zksync_depositor_wallet: &Wallet) -> Result<(), anyhow::Error> -// where -// S: EthereumSigner, -// P: Provider + Clone, -// { -// let provider = RpcProvider::new(Network::Localhost); - -// let (random_eth_address, random_eth_private_key) = eth_random_account_credentials(); -// let eth_signer = PrivateKeySigner::new(random_eth_private_key); -// let random_credentials = -// WalletCredentials::from_eth_signer(random_eth_address, eth_signer, Network::Localhost) -// .await?; -// let sync_wallet = Wallet::new(provider, random_credentials).await?; - -// let handle = sync_wallet -// .start_transfer() -// .to(zksync_depositor_wallet.address()) -// .token("ETH")? -// .amount(1_000_000u64) -// .send() -// .await; - -// assert!(matches!( -// handle, -// Err(ClientError::SigningError(_no_signing_key)) -// )); - -// Ok(()) -// } - -// /// Checks the correctness of the `Deposit` operation. -// async fn test_deposit( -// deposit_wallet: &Wallet, -// sync_wallet: &mut Wallet, -// token: &Token, -// amount: u128, -// ) -> Result<(), anyhow::Error> -// where -// S: EthereumSigner, -// P: Provider + Clone, -// { -// let ethereum = deposit_wallet.ethereum(web3_addr()).await?; - -// if !deposit_wallet.tokens.is_eth(token.address.into()) { -// if !ethereum.is_erc20_deposit_approved(token.address).await? { -// let tx_approve_deposits = ethereum -// .limited_approve_erc20_token_deposits(token.address, U256::from(amount)) -// .await?; -// ethereum.wait_for_tx(tx_approve_deposits).await?; -// } - -// assert!( -// ethereum -// .is_limited_erc20_deposit_approved(token.address, U256::from(amount)) -// .await?, -// "Token should be approved" -// ); -// }; - -// let deposit_tx_hash = ethereum -// .deposit( -// &token.symbol as &str, -// U256::from(amount), -// sync_wallet.address(), -// ) -// .await?; - -// ethereum.wait_for_tx(deposit_tx_hash).await?; -// wait_for_deposit_and_update_account_id(sync_wallet).await; - -// if !sync_wallet.tokens.is_eth(token.address.into()) { -// // It should not be approved because we have approved only DEPOSIT_AMOUNT, not the maximum possible amount of deposit -// assert!( -// !ethereum -// .is_limited_erc20_deposit_approved(token.address, U256::from(amount)) -// .await? -// ); -// // Unlimited approve for deposit -// let tx_approve_deposits = ethereum.approve_erc20_token_deposits(token.address).await?; -// ethereum.wait_for_tx(tx_approve_deposits).await?; -// assert!(ethereum.is_erc20_deposit_approved(token.address).await?); -// } - -// // To be sure that the deposit is committed, we need to listen to the event `NewPriorityRequest` -// // rust SDK doesn't support getting this information yet, but it will be added soon. -// // assert_eq!(balance_after - balance_before, u256_to_big_dec(amount / 2)); - -// Ok(()) -// } - -// /// Checks the correctness of the `ChangePubKey` operation. -// async fn test_change_pubkey( -// sync_wallet: &Wallet, -// token_symbol: &str, -// ) -> Result<(), anyhow::Error> -// where -// S: EthereumSigner, -// P: Provider + Clone, -// { -// if !sync_wallet.is_signing_key_set().await? { -// let handle = sync_wallet -// .start_change_pubkey() -// .fee_token(token_symbol)? -// .send() -// .await?; - -// handle -// .commit_timeout(Duration::from_secs(60)) -// .wait_for_commit() -// .await?; -// } -// assert!(sync_wallet.is_signing_key_set().await?); -// Ok(()) -// } - -// /// Makes a transfer from Alice to Bob inside zkSync -// /// checks the correctness of the amount of money before the transaction and after. -// async fn test_transfer( -// alice: &Wallet, -// bob: &Wallet, -// token_symbol: &str, -// transfer_amount: u128, -// ) -> Result<(), anyhow::Error> -// where -// S: EthereumSigner, -// P: Provider + Clone, -// { -// let transfer_amount = num::BigUint::from(transfer_amount); - -// let total_fee = alice -// .provider -// .get_tx_fee(TxFeeTypes::Transfer, bob.address(), token_symbol) -// .await? -// .total_fee; - -// let alice_balance_before = alice -// .get_balance(BlockStatus::Committed, token_symbol) -// .await?; - -// let bob_balance_before = bob -// .get_balance(BlockStatus::Committed, token_symbol) -// .await?; - -// let transfer_handle = alice -// .start_transfer() -// .to(bob.address()) -// .token(token_symbol)? -// .amount(transfer_amount.clone()) -// .send() -// .await?; - -// transfer_handle -// .commit_timeout(Duration::from_secs(180)) -// .wait_for_commit() -// .await?; - -// let alice_balance_after = alice -// .get_balance(BlockStatus::Committed, token_symbol) -// .await?; -// let bob_balance_after = bob -// .get_balance(BlockStatus::Committed, token_symbol) -// .await?; - -// assert_eq!( -// alice_balance_before - alice_balance_after, -// transfer_amount.clone() + total_fee -// ); -// assert_eq!(bob_balance_after - bob_balance_before, transfer_amount); -// Ok(()) -// } - -// /// Makes a transaction from the account to its own address -// /// checks if the expected amount of fee has been spent. -// async fn test_transfer_to_self( -// sync_wallet: &Wallet, -// token_symbol: &str, -// transfer_amount: u128, -// ) -> Result<(), anyhow::Error> -// where -// S: EthereumSigner, -// P: Provider + Clone, -// { -// let transfer_amount = num::BigUint::from(transfer_amount); -// let balance_before = sync_wallet -// .get_balance(BlockStatus::Committed, token_symbol) -// .await?; -// let total_fee = sync_wallet -// .provider -// .get_tx_fee(TxFeeTypes::Transfer, sync_wallet.address(), token_symbol) -// .await? -// .total_fee; - -// let transfer_handle = sync_wallet -// .start_transfer() -// .to(sync_wallet.address()) -// .token(token_symbol)? -// .amount(transfer_amount) -// .send() -// .await?; - -// transfer_handle -// .commit_timeout(Duration::from_secs(180)) -// .wait_for_commit() -// .await?; - -// let balance_after = sync_wallet -// .get_balance(BlockStatus::Committed, token_symbol) -// .await?; - -// assert_eq!(balance_before - balance_after, total_fee); - -// Ok(()) -// } - -// /// Makes a withdraw operation on L2 -// /// checks the correctness of their execution. -// async fn test_withdraw( -// eth_provider: &EthereumProvider, -// main_contract: &Contract, -// sync_wallet: &Wallet, -// withdraw_to: &Wallet, -// token: &Token, -// amount: u128, -// ) -> Result<(), anyhow::Error> -// where -// S: EthereumSigner, -// P: Provider + Clone, -// { -// let total_fee = sync_wallet -// .provider -// .get_tx_fee(TxFeeTypes::Withdraw, withdraw_to.address(), token.address) -// .await? -// .total_fee; -// let sync_balance_before = sync_wallet -// .get_balance(BlockStatus::Committed, &token.symbol as &str) -// .await?; -// let onchain_balance_before = -// get_ethereum_balance(eth_provider, withdraw_to.address(), token).await?; -// let pending_to_be_onchain_balance_before: U256 = { -// let query = main_contract.query( -// "getPendingBalance", -// (withdraw_to.address(), token.address), -// None, -// Options::default(), -// None, -// ); - -// query -// .await -// .map_err(|err| anyhow::anyhow!(format!("Contract query fail: {}", err)))? -// }; - -// let withdraw_handle = sync_wallet -// .start_withdraw() -// .to(withdraw_to.address()) -// .token(token.address)? -// .amount(amount) -// .send() -// .await?; - -// withdraw_handle -// .verify_timeout(Duration::from_secs(360)) -// .wait_for_verify() -// .await?; - -// let sync_balance_after = sync_wallet -// .get_balance(BlockStatus::Committed, &token.symbol as &str) -// .await?; -// let onchain_balance_after = -// get_ethereum_balance(eth_provider, withdraw_to.address(), token).await?; - -// let pending_to_be_onchain_balance_after: U256 = { -// let query = main_contract.query( -// "getPendingBalance", -// (withdraw_to.address(), token.address), -// None, -// Options::default(), -// None, -// ); - -// query -// .await -// .map_err(|err| anyhow::anyhow!(format!("Contract query fail: {}", err)))? -// }; - -// assert_eq!( -// onchain_balance_after - onchain_balance_before + pending_to_be_onchain_balance_after -// - pending_to_be_onchain_balance_before, -// U256::from(amount) -// ); -// assert_eq!( -// sync_balance_before - sync_balance_after, -// num::BigUint::from(amount) + total_fee -// ); - -// Ok(()) -// } - -// /// Makes transfers for different types of operations -// /// checks the correctness of their execution. -// async fn move_funds( -// main_contract: &Contract, -// eth_provider: &EthereumProvider, -// depositor_wallet: &Wallet, -// alice: &mut Wallet, -// bob: &Wallet, -// token_like: impl Into, -// deposit_amount: u128, -// ) -> Result<(), anyhow::Error> -// where -// S: EthereumSigner, -// P: Provider + Clone, -// { -// let token_like = token_like.into(); -// let token = depositor_wallet -// .tokens -// .resolve(token_like.clone()) -// .ok_or_else(|| anyhow::anyhow!("Error resolve token"))?; - -// let transfer_amount = deposit_amount / 10; -// let withdraw_amount = deposit_amount / 10; - -// test_deposit(depositor_wallet, alice, &token, deposit_amount).await?; -// println!("Deposit ok, Token: {}", token.symbol); - -// test_change_pubkey(alice, &token.symbol).await?; -// println!("Change pubkey ok"); - -// test_transfer(alice, bob, &token.symbol, transfer_amount).await?; -// println!("Transfer to new ok, Token: {}", token.symbol); - -// test_transfer(alice, bob, &token.symbol, transfer_amount).await?; -// println!("Transfer ok, Token: {}", token.symbol); - -// test_transfer_to_self(&alice, &token.symbol, transfer_amount).await?; -// println!("Transfer to self ok, Token: {}", token.symbol); - -// test_withdraw( -// ð_provider, -// &main_contract, -// &alice, -// &bob, -// &token, -// withdraw_amount, -// ) -// .await?; -// println!("Withdraw ok, Token: {}", token.symbol); - -// // Currently fast withdraw aren't supported by zksync-rs, but they will be in the near future. -// // test_fast_withdraw(eth, main_contract, &bob, &bob, &token, withdraw_amount); -// // println!("Fast withdraw ok, Token: {}", token.symbol); - -// // Currently multi transactions aren't supported by zksync-rs, but they will be in the near future. -// // test_multi_transfer(alice, bob, &token.symbol, transfersAmount / 2); -// // println!("Batched transfers ok, Token: {}, token.symbol"); - -// Ok(()) -// } - -// /// Auxiliary function that generates a new wallet, performs an initial deposit and changes the public key. -// async fn init_account_with_one_ether( -// ) -> Result, anyhow::Error> { -// let (eth_address, eth_private_key) = eth_random_account_credentials(); - -// // Transfer funds from "rich" account to a randomly created one (so we won't reuse the same -// // account in subsequent test runs). -// transfer_to("ETH", one_ether(), eth_address).await?; - -// let provider = RpcProvider::new(Network::Localhost); - -// let eth_signer = PrivateKeySigner::new(eth_private_key); -// let credentials = -// WalletCredentials::from_eth_signer(eth_address, eth_signer, Network::Localhost) -// .await -// .unwrap(); - -// let mut wallet = Wallet::new(provider, credentials).await?; -// let ethereum = wallet.ethereum(web3_addr()).await?; - -// let deposit_tx_hash = ethereum -// .deposit("ETH", one_ether() / 2, wallet.address()) -// .await?; - -// ethereum.wait_for_tx(deposit_tx_hash).await?; - -// // Update stored wallet ID after we initialized a wallet via deposit. -// wait_for_deposit_and_update_account_id(&mut wallet).await; - -// if !wallet.is_signing_key_set().await? { -// let handle = wallet -// .start_change_pubkey() -// .fee_token("ETH")? -// .send() -// .await?; - -// handle -// .commit_timeout(Duration::from_secs(60)) -// .wait_for_commit() -// .await?; -// } - -// Ok(wallet) -// } - -// async fn make_wallet( -// provider: RpcProvider, -// (eth_address, eth_private_key): (H160, H256), -// ) -> Result, ClientError> { -// let eth_signer = PrivateKeySigner::new(eth_private_key); -// let credentials = -// WalletCredentials::from_eth_signer(eth_address, eth_signer, Network::Localhost).await?; -// Wallet::new(provider, credentials).await -// } - -// #[tokio::test] -// #[cfg_attr(not(feature = "integration-tests"), ignore)] -// async fn comprehensive_test() -> Result<(), anyhow::Error> { -// let provider = RpcProvider::new(Network::Localhost); - -// let main_wallet = make_wallet(provider.clone(), eth_main_account_credentials()).await?; -// let sync_depositor_wallet = -// make_wallet(provider.clone(), eth_random_account_credentials()).await?; -// let mut alice_wallet1 = make_wallet(provider.clone(), eth_random_account_credentials()).await?; -// let bob_wallet1 = make_wallet(provider.clone(), eth_random_account_credentials()).await?; - -// let ethereum = main_wallet.ethereum(web3_addr()).await?; - -// let main_contract = { -// let address_response = provider.contract_address().await?; -// let contract_address = if address_response.main_contract.starts_with("0x") { -// &address_response.main_contract[2..] -// } else { -// &address_response.main_contract -// } -// .parse()?; -// ethereum -// .client() -// .main_contract_with_address(contract_address) -// }; - -// let token_eth = sync_depositor_wallet -// .tokens -// .resolve("ETH".into()) -// .ok_or_else(|| anyhow::anyhow!("Error resolve token"))?; -// let token_dai = sync_depositor_wallet -// .tokens -// .resolve("DAI".into()) -// .ok_or_else(|| anyhow::anyhow!("Error resolve token"))?; - -// let dai_deposit_amount = U256::from(10).pow(18.into()) * 10000; // 10000 DAI - -// // Move ETH to wallets so they will have some funds for L1 transactions. -// let eth_deposit_amount = U256::from(10).pow(17.into()); // 0.1 ETH -// transfer_to("ETH", eth_deposit_amount, sync_depositor_wallet.address()).await?; -// transfer_to("ETH", eth_deposit_amount, alice_wallet1.address()).await?; -// transfer_to("ETH", eth_deposit_amount, bob_wallet1.address()).await?; - -// transfer_to("DAI", dai_deposit_amount, sync_depositor_wallet.address()).await?; - -// assert_eq!( -// get_ethereum_balance(ðereum, sync_depositor_wallet.address(), &token_eth).await?, -// eth_deposit_amount -// ); -// assert_eq!( -// get_ethereum_balance(ðereum, sync_depositor_wallet.address(), &token_dai).await?, -// dai_deposit_amount -// ); - -// test_tx_fail(&sync_depositor_wallet).await?; - -// move_funds( -// &main_contract, -// ðereum, -// &sync_depositor_wallet, -// &mut alice_wallet1, -// &bob_wallet1, -// "DAI", -// // 200 DAI -// 200_000_000_000_000_000_000u128, -// ) -// .await?; - -// Ok(()) -// } - -// #[tokio::test] -// #[cfg_attr(not(feature = "integration-tests"), ignore)] -// async fn simple_transfer() -> Result<(), anyhow::Error> { -// let wallet = init_account_with_one_ether().await?; - -// // Perform a transfer to itself. -// let handle = wallet -// .start_transfer() -// .to(wallet.signer.address) -// .token("ETH")? -// .amount(1_000_000u64) -// .send() -// .await?; - -// handle -// .commit_timeout(Duration::from_secs(180)) -// .wait_for_commit() -// .await?; - -// Ok(()) -// } - -// #[tokio::test] -// #[cfg_attr(not(feature = "integration-tests"), ignore)] -// async fn batch_transfer() -> Result<(), anyhow::Error> { -// let wallet = init_account_with_one_ether().await?; - -// const RECIPIENT_COUNT: usize = 4; -// let recipients = vec![eth_random_account_credentials().0; RECIPIENT_COUNT]; - -// let token_like = TokenLike::Symbol("ETH".to_owned()); -// let token = wallet -// .tokens -// .resolve(token_like.clone()) -// .expect("ETH token resolving failed"); - -// let mut nonce = wallet.account_info().await?.committed.nonce; - -// // Sign a transfer for each recipient created above -// let mut signed_transfers = Vec::with_capacity(recipients.len()); - -// // Obtain total fee for this batch -// let mut total_fee = Some( -// wallet -// .provider -// .get_txs_batch_fee( -// vec![TxFeeTypes::Transfer; recipients.len()], -// recipients.clone(), -// token_like.clone(), -// ) -// .await?, -// ); - -// for recipient in recipients { -// let (transfer, signature) = wallet -// .signer -// .sign_transfer( -// token.clone(), -// 1_000_000u64.into(), -// // Set a total batch fee in the first transaction. -// total_fee.take().unwrap_or_default(), -// recipient, -// nonce, -// Default::default(), -// ) -// .await -// .expect("Transfer signing error"); - -// signed_transfers.push((ZkSyncTx::Transfer(Box::new(transfer)), signature)); - -// *nonce += 1; -// } - -// // Send the batch and store its transaction hashes -// let handles = wallet -// .provider -// .send_txs_batch(signed_transfers, None) -// .await? -// .into_iter() -// .map(|tx_hash| SyncTransactionHandle::new(tx_hash, wallet.provider.clone())); - -// for handle in handles { -// handle -// .commit_timeout(Duration::from_secs(180)) -// .wait_for_commit() -// .await?; -// } - -// Ok(()) -// } diff --git a/sdk/zksync-rs/tests/unit.rs b/sdk/zksync-rs/tests/unit.rs deleted file mode 100644 index 1bd238d9e92..00000000000 --- a/sdk/zksync-rs/tests/unit.rs +++ /dev/null @@ -1,653 +0,0 @@ -// use std::collections::HashMap; -// use zksync::{tokens_cache::TokensCache, utils::*, web3::types::H160, zksync_types::Token}; -// use zksync_config::test_config::unit_vectors::{Config as TestVectorsConfig, TestEntry}; -// use zksync_crypto::PrivateKey; -// use zksync_types::{tx::TxSignature, AccountId, Nonce, TokenId}; - -// #[test] -// fn test_tokens_cache() { -// let mut tokens: HashMap = HashMap::default(); - -// let token_eth = Token::new(TokenId(0), H160::default(), "ETH", 18); -// tokens.insert("ETH".to_string(), token_eth.clone()); -// let token_dai = Token::new(TokenId(1), H160::random(), "DAI", 18); -// tokens.insert("DAI".to_string(), token_dai.clone()); - -// let uncahed_token = Token::new(TokenId(2), H160::random(), "UNC", 5); - -// let tokens_hash = TokensCache::new(tokens); - -// assert_eq!( -// tokens_hash.resolve(token_eth.address.into()), -// Some(token_eth.clone()) -// ); -// assert_eq!( -// tokens_hash.resolve(token_eth.id.into()), -// Some(token_eth.clone()) -// ); -// assert_eq!( -// tokens_hash.resolve((&token_eth.symbol as &str).into()), -// Some(token_eth.clone()) -// ); - -// assert_eq!( -// tokens_hash.resolve(token_dai.address.into()), -// Some(token_dai.clone()) -// ); -// assert_eq!( -// tokens_hash.resolve(token_dai.id.into()), -// Some(token_dai.clone()) -// ); -// assert_eq!( -// tokens_hash.resolve((&token_dai.symbol as &str).into()), -// Some(token_dai.clone()) -// ); - -// assert_eq!(tokens_hash.resolve(uncahed_token.address.into()), None); -// assert_eq!(tokens_hash.resolve(uncahed_token.id.into()), None); -// assert_eq!( -// tokens_hash.resolve((&uncahed_token.symbol as &str).into()), -// None -// ); - -// assert!(tokens_hash.is_eth(token_eth.address.into())); -// assert!(tokens_hash.is_eth(token_eth.id.into())); -// assert!(tokens_hash.is_eth((&token_eth.symbol as &str).into())); - -// assert!(!tokens_hash.is_eth(token_dai.address.into())); -// assert!(!tokens_hash.is_eth(token_dai.id.into())); -// assert!(!tokens_hash.is_eth((&token_dai.symbol as &str).into())); -// } - -// fn priv_key_from_raw(raw: &[u8]) -> Option { -// use zksync_crypto::{ -// bellman::{pairing::ff::PrimeField, PrimeFieldRepr}, -// franklin_crypto::alt_babyjubjub::fs::FsRepr, -// priv_key_from_fs, Fs, -// }; - -// let mut fs_repr = FsRepr::default(); -// fs_repr.read_be(raw).ok()?; -// Fs::from_repr(fs_repr).ok().map(priv_key_from_fs) -// } - -// fn assert_tx_signature(signature: &TxSignature, expected_pub: &str, expected_sig: &str) { -// let TxSignature { pub_key, signature } = signature; - -// let pub_point = pub_key.serialize_packed().unwrap(); -// assert_eq!(hex::encode(pub_point), expected_pub); - -// let packed_sig = signature.serialize_packed().unwrap(); -// assert_eq!(hex::encode(packed_sig), expected_sig); -// } - -// #[cfg(test)] -// mod primitives_with_vectors { -// use super::*; - -// #[test] -// fn test_signature() { -// let test_vectors = TestVectorsConfig::load(); -// for TestEntry { inputs, outputs } in test_vectors.crypto_primitives.items { -// let private_key = -// private_key_from_seed(&inputs.seed).expect("Cannot get key from seed"); - -// assert_eq!( -// priv_key_from_raw(&outputs.private_key).unwrap().0, -// private_key.0 -// ); - -// let signature = TxSignature::sign_musig(&private_key, &inputs.message); -// assert_tx_signature(&signature, &outputs.pub_key, &outputs.signature); -// } -// } -// } - -// #[cfg(test)] -// mod utils_with_vectors { -// use super::*; -// use zksync_utils::format_units; - -// #[test] -// fn test_token_packing() { -// let test_vectors = TestVectorsConfig::load(); -// for TestEntry { inputs, outputs } in test_vectors.utils.amount_packing.items { -// let token_amount = inputs.value; - -// assert_eq!(is_token_amount_packable(&token_amount), outputs.packable); -// assert_eq!( -// closest_packable_token_amount(&token_amount), -// outputs.closest_packable -// ); -// assert_eq!(pack_token_amount(&token_amount), outputs.packed_value); -// } -// } - -// #[test] -// fn test_fee_packing() { -// let test_vectors = TestVectorsConfig::load(); -// for TestEntry { inputs, outputs } in test_vectors.utils.fee_packing.items { -// let fee_amount = inputs.value; - -// assert_eq!(is_fee_amount_packable(&fee_amount), outputs.packable); -// assert_eq!( -// closest_packable_fee_amount(&fee_amount), -// outputs.closest_packable -// ); -// assert_eq!(pack_fee_amount(&fee_amount), outputs.packed_value); -// } -// } - -// #[test] -// fn test_formatting() { -// let test_vectors = TestVectorsConfig::load(); -// for TestEntry { inputs, outputs } in test_vectors.utils.token_formatting.items { -// let units_str = format_units(inputs.amount, inputs.decimals); -// assert_eq!(format!("{} {}", units_str, inputs.token), outputs.formatted); -// } -// } -// } - -// #[cfg(test)] -// mod signatures_with_vectors { -// use super::*; -// use zksync::{signer::Signer, WalletCredentials}; -// use zksync_config::test_config::unit_vectors::TxData; -// use zksync_eth_signer::PrivateKeySigner; -// use zksync_types::tx::{ChangePubKeyECDSAData, ChangePubKeyEthAuthData}; -// use zksync_types::{network::Network, AccountId, Address, H256}; - -// async fn get_signer( -// eth_private_key_raw: &[u8], -// from_address: Address, -// account_id: AccountId, -// ) -> Signer { -// let eth_private_key = H256::from_slice(eth_private_key_raw); -// let eth_signer = PrivateKeySigner::new(eth_private_key); - -// let creds = WalletCredentials::from_eth_signer(from_address, eth_signer, Network::Mainnet) -// .await -// .unwrap(); - -// let mut signer = Signer::with_credentials(creds); -// signer.set_account_id(Some(account_id)); -// signer -// } - -// #[tokio::test] -// async fn test_transfer_signature() { -// let test_vectors = TestVectorsConfig::load(); -// for TestEntry { inputs, outputs } in test_vectors.transactions.items { -// if let TxData::Transfer { -// data: transfer_tx, -// eth_sign_data: sign_data, -// } = &inputs.data -// { -// let signer = get_signer( -// &inputs.eth_private_key, -// transfer_tx.from, -// sign_data.account_id, -// ) -// .await; - -// let token = Token { -// id: transfer_tx.token_id, -// address: Default::default(), -// symbol: sign_data.string_token.clone(), -// decimals: 0, -// }; -// let (transfer, eth_signature) = signer -// .sign_transfer( -// token, -// transfer_tx.amount.clone(), -// transfer_tx.fee.clone(), -// sign_data.to, -// sign_data.nonce, -// transfer_tx.time_range, -// ) -// .await -// .expect("Transfer signing error"); - -// assert_eq!(transfer.get_bytes(), outputs.sign_bytes); -// assert_tx_signature( -// &transfer.signature, -// &outputs.signature.pub_key, -// &outputs.signature.signature, -// ); - -// assert_eq!( -// transfer -// .get_ethereum_sign_message(&sign_data.string_token, 0) -// .into_bytes(), -// outputs.eth_sign_message.unwrap() -// ); - -// if let Some(expected_eth_signature) = outputs.eth_signature { -// let eth_signature = eth_signature.unwrap().serialize_packed(); -// assert_eq!(ð_signature[..], expected_eth_signature.as_slice()); -// } -// } -// } -// } - -// #[tokio::test] -// async fn test_withdraw_signature() { -// let test_vectors = TestVectorsConfig::load(); -// for TestEntry { inputs, outputs } in test_vectors.transactions.items { -// if let TxData::Withdraw { -// data: withdraw_tx, -// eth_sign_data: sign_data, -// } = &inputs.data -// { -// let signer = get_signer( -// &inputs.eth_private_key, -// withdraw_tx.from, -// sign_data.account_id, -// ) -// .await; - -// let token = Token { -// id: withdraw_tx.token_id, -// address: Default::default(), -// symbol: sign_data.string_token.clone(), -// decimals: 0, -// }; -// let (withdraw, eth_signature) = signer -// .sign_withdraw( -// token, -// withdraw_tx.amount.clone(), -// withdraw_tx.fee.clone(), -// sign_data.eth_address, -// sign_data.nonce, -// withdraw_tx.time_range, -// ) -// .await -// .expect("Withdraw signing error"); - -// assert_eq!(withdraw.get_bytes(), outputs.sign_bytes); -// assert_tx_signature( -// &withdraw.signature, -// &outputs.signature.pub_key, -// &outputs.signature.signature, -// ); - -// assert_eq!( -// withdraw -// .get_ethereum_sign_message(&sign_data.string_token, 0) -// .into_bytes(), -// outputs.eth_sign_message.unwrap() -// ); - -// if let Some(expected_eth_signature) = outputs.eth_signature { -// let eth_signature = eth_signature.unwrap().serialize_packed(); -// assert_eq!(ð_signature[..], expected_eth_signature.as_slice()); -// } -// } -// } -// } - -// #[tokio::test] -// async fn test_change_pubkey_signature() { -// let test_vectors = TestVectorsConfig::load(); -// for TestEntry { inputs, outputs } in test_vectors.transactions.items { -// if let TxData::ChangePubKey { -// data: change_pubkey_tx, -// eth_sign_data: sign_data, -// } = &inputs.data -// { -// let mut signer = get_signer( -// &inputs.eth_private_key, -// change_pubkey_tx.account, -// sign_data.account_id, -// ) -// .await; -// signer.pubkey_hash = change_pubkey_tx.new_pk_hash; - -// let token = Token { -// id: change_pubkey_tx.fee_token_id, -// address: Default::default(), -// symbol: String::new(), -// decimals: 0, -// }; -// let change_pub_key = signer -// .sign_change_pubkey_tx( -// sign_data.nonce, -// false, -// token, -// change_pubkey_tx.fee.clone(), -// change_pubkey_tx.time_range, -// ) -// .await -// .expect("Change pub key signing error"); - -// assert_eq!(change_pub_key.get_bytes(), outputs.sign_bytes); -// assert_tx_signature( -// &change_pub_key.signature, -// &outputs.signature.pub_key, -// &outputs.signature.signature, -// ); - -// assert_eq!( -// change_pub_key.get_eth_signed_data().unwrap(), -// outputs.eth_sign_message.unwrap() -// ); - -// if let Some(expected_eth_signature) = outputs.eth_signature { -// let eth_signature = match &change_pub_key.eth_auth_data { -// Some(ChangePubKeyEthAuthData::ECDSA(ChangePubKeyECDSAData { -// eth_signature, -// .. -// })) => eth_signature.serialize_packed(), -// _ => panic!("No ChangePubKey ethereum signature"), -// }; -// assert_eq!(ð_signature[..], expected_eth_signature.as_slice()); -// } -// } -// } -// } - -// #[tokio::test] -// async fn test_forced_exit_signature() { -// let test_vectors = TestVectorsConfig::load(); -// for TestEntry { inputs, outputs } in test_vectors.transactions.items { -// if let TxData::ForcedExit { data: forced_exit } = &inputs.data { -// let signer = get_signer( -// &inputs.eth_private_key, -// forced_exit.from, -// forced_exit.initiator_account_id, -// ) -// .await; - -// let token = Token { -// id: forced_exit.token_id, -// address: Default::default(), -// symbol: String::new(), -// decimals: 0, -// }; -// let (forced_exit, _) = signer -// .sign_forced_exit( -// forced_exit.target, -// token, -// forced_exit.fee.clone(), -// forced_exit.nonce, -// forced_exit.time_range, -// ) -// .await -// .expect("Forced exit signing error"); - -// assert_eq!(forced_exit.get_bytes(), outputs.sign_bytes); -// assert_tx_signature( -// &forced_exit.signature, -// &outputs.signature.pub_key, -// &outputs.signature.signature, -// ); -// } -// } -// } -// } - -// #[cfg(test)] -// mod wallet_tests { -// use super::*; -// use num::{BigUint, ToPrimitive}; -// use zksync::{ -// error::ClientError, -// provider::Provider, -// signer::Signer, -// types::{ -// AccountInfo, AccountState, BlockStatus, ContractAddress, EthOpInfo, Fee, Tokens, -// TransactionInfo, -// }, -// Network, Wallet, WalletCredentials, -// }; -// use zksync_eth_signer::PrivateKeySigner; -// use zksync_types::{ -// tokens::get_genesis_token_list, -// tx::{PackedEthSignature, TxHash}, -// Address, PubKeyHash, TokenId, TokenLike, TxFeeTypes, ZkSyncTx, H256, -// }; - -// #[derive(Debug, Clone)] -// /// Provides some hardcoded values the `Provider` responsible to -// /// without communicating with the network -// struct MockProvider { -// network: Network, -// eth_private_key: H256, -// } - -// impl MockProvider { -// async fn pub_key_hash(&self) -> PubKeyHash { -// let address = -// PackedEthSignature::address_from_private_key(&self.eth_private_key).unwrap(); -// let eth_signer = PrivateKeySigner::new(self.eth_private_key); -// let creds = WalletCredentials::from_eth_signer(address, eth_signer, self.network) -// .await -// .unwrap(); -// let signer = Signer::with_credentials(creds); -// signer.pubkey_hash -// } -// } - -// #[async_trait::async_trait] -// impl Provider for MockProvider { -// /// Returns the example `AccountInfo` instance: -// /// - assigns the '42' value to account_id; -// /// - assigns the PubKeyHash to match the wallet's signer's PubKeyHash -// /// - adds single entry of "DAI" token to the committed balances; -// /// - adds single entry of "USDC" token to the verified balances. -// async fn account_info(&self, address: Address) -> Result { -// let mut committed_balances = HashMap::new(); -// committed_balances.insert("DAI".into(), BigUint::from(12345_u32).into()); - -// let mut verified_balances = HashMap::new(); -// verified_balances.insert("USDC".into(), BigUint::from(98765_u32).into()); - -// Ok(AccountInfo { -// address, -// id: Some(AccountId(42)), -// depositing: Default::default(), -// committed: AccountState { -// balances: committed_balances, -// nonce: Nonce(0), -// pub_key_hash: self.pub_key_hash().await, -// }, -// verified: AccountState { -// balances: verified_balances, -// ..Default::default() -// }, -// }) -// } - -// /// Returns first three tokens from the configuration found in -// /// $ZKSYNC_HOME/etc/tokens/.json -// async fn tokens(&self) -> Result { -// let genesis_tokens = get_genesis_token_list(&self.network.to_string()) -// .expect("Initial token list not found"); - -// let tokens = (1..) -// .zip(&genesis_tokens[..3]) -// .map(|(id, token)| Token { -// id: TokenId(id), -// symbol: token.symbol.clone(), -// address: token.address[2..] -// .parse() -// .expect("failed to parse token address"), -// decimals: token.decimals, -// }) -// .map(|token| (token.symbol.clone(), token)) -// .collect(); -// Ok(tokens) -// } - -// async fn tx_info(&self, _tx_hash: TxHash) -> Result { -// unreachable!() -// } - -// async fn get_tx_fee( -// &self, -// _tx_type: TxFeeTypes, -// _address: Address, -// _token: impl Into + Send + 'async_trait, -// ) -> Result { -// unreachable!() -// } - -// async fn get_txs_batch_fee( -// &self, -// _tx_types: Vec, -// _addresses: Vec
, -// _token: impl Into + Send + 'async_trait, -// ) -> Result { -// unreachable!() -// } - -// async fn ethop_info(&self, _serial_id: u32) -> Result { -// unreachable!() -// } - -// async fn get_eth_tx_for_withdrawal( -// &self, -// _withdrawal_hash: TxHash, -// ) -> Result, ClientError> { -// unreachable!() -// } - -// /// Returns the example `ContractAddress` instance: -// /// - the HEX-encoded sequence of bytes [0..20) provided as the `main_contract`; -// /// - the `gov_contract` is not usable in tests and it is simply an empty string. -// async fn contract_address(&self) -> Result { -// Ok(ContractAddress { -// main_contract: "0x000102030405060708090a0b0c0d0e0f10111213".to_string(), -// gov_contract: "".to_string(), -// }) -// } - -// async fn send_tx( -// &self, -// _tx: ZkSyncTx, -// _eth_signature: Option, -// ) -> Result { -// unreachable!() -// } - -// async fn send_txs_batch( -// &self, -// _txs_signed: Vec<(ZkSyncTx, Option)>, -// _eth_signature: Option, -// ) -> Result, ClientError> { -// unreachable!() -// } - -// fn network(&self) -> Network { -// self.network -// } -// } - -// async fn get_test_wallet( -// private_key_raw: &[u8], -// network: Network, -// ) -> Wallet { -// let private_key = H256::from_slice(private_key_raw); -// let address = PackedEthSignature::address_from_private_key(&private_key).unwrap(); - -// let eth_signer = PrivateKeySigner::new(private_key); -// let creds = WalletCredentials::from_eth_signer(address, eth_signer, Network::Mainnet) -// .await -// .unwrap(); - -// let provider = MockProvider { -// network, -// eth_private_key: private_key, -// }; -// Wallet::new(provider, creds).await.unwrap() -// } - -// #[tokio::test] -// async fn test_wallet_address() { -// let wallet = get_test_wallet(&[5; 32], Network::Mainnet).await; -// let expected_address = -// PackedEthSignature::address_from_private_key(&H256::from([5; 32])).unwrap(); -// assert_eq!(wallet.address(), expected_address); -// } - -// #[tokio::test] -// async fn test_wallet_account_info() { -// let wallet = get_test_wallet(&[10; 32], Network::Mainnet).await; -// let account_info = wallet.account_info().await.unwrap(); -// assert_eq!(account_info.address, wallet.address()); -// } - -// #[tokio::test] -// async fn test_wallet_account_id() { -// let wallet = get_test_wallet(&[14; 32], Network::Mainnet).await; -// assert_eq!(wallet.account_id(), Some(AccountId(42))); -// } - -// #[tokio::test] -// async fn test_wallet_refresh_tokens() { -// let mut wallet = get_test_wallet(&[20; 32], Network::Mainnet).await; -// let _dai_token = wallet -// .tokens -// .resolve(TokenLike::Symbol("DAI".into())) -// .unwrap(); - -// wallet.provider.network = Network::Rinkeby; -// wallet.refresh_tokens_cache().await.unwrap(); - -// // DAI is not in the Rinkeby network -// assert!(wallet -// .tokens -// .resolve(TokenLike::Symbol("DAI".into())) -// .is_none()); -// } - -// #[tokio::test] -// async fn test_wallet_get_balance_committed() { -// let wallet = get_test_wallet(&[40; 32], Network::Mainnet).await; -// let balance = wallet -// .get_balance(BlockStatus::Committed, "DAI") -// .await -// .unwrap(); -// assert_eq!(balance.to_u32(), Some(12345)); -// } - -// #[tokio::test] -// async fn test_wallet_get_balance_committed_not_existent() { -// let wallet = get_test_wallet(&[40; 32], Network::Mainnet).await; -// let result = wallet.get_balance(BlockStatus::Committed, "ETH").await; - -// assert_eq!(result.unwrap_err(), ClientError::UnknownToken); -// } - -// #[tokio::test] -// async fn test_wallet_get_balance_verified() { -// let wallet = get_test_wallet(&[50; 32], Network::Mainnet).await; -// let balance = wallet -// .get_balance(BlockStatus::Verified, "USDC") -// .await -// .unwrap(); -// assert_eq!(balance.to_u32(), Some(98765)); -// } - -// #[tokio::test] -// async fn test_wallet_get_balance_verified_not_existent() { -// let wallet = get_test_wallet(&[50; 32], Network::Mainnet).await; -// let result = wallet.get_balance(BlockStatus::Verified, "ETH").await; - -// assert_eq!(result.unwrap_err(), ClientError::UnknownToken); -// } - -// #[tokio::test] -// async fn test_wallet_is_signing_key_set() { -// let wallet = get_test_wallet(&[50; 32], Network::Mainnet).await; -// assert!(wallet.is_signing_key_set().await.unwrap()); -// } - -// #[tokio::test] -// async fn test_wallet_ethereum() { -// let wallet = get_test_wallet(&[50; 32], Network::Mainnet).await; -// let eth_provider = wallet.ethereum("http://some.random.url").await.unwrap(); -// let expected_address: Vec<_> = (0..20).collect(); -// assert_eq!(eth_provider.contract_address().as_bytes(), expected_address); -// } -// } diff --git a/sdk/zksync-web3.js/README.md b/sdk/zksync-web3.js/README.md deleted file mode 100644 index c3fbd13aead..00000000000 --- a/sdk/zksync-web3.js/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# JavaScript SDK for zkSync - -🔗 This SDK migrated into its own [GitHub repo](https://github.com/zksync-sdk/zksync2-js).