From 5b88fae8d89a736861b5034543114d28aeb5c00a Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:43:33 +0200 Subject: [PATCH 01/75] Rename crate --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c4fac4c..1807963 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "zksync-web3-rs" +name = "zksync-ethers-rs" version = "0.1.1" edition = "2021" license = "MIT" description = "Rust SDK for zkSync Era" -repository = "https://github.com/lambdaclass/zksync-web3-rs/" -homepage = "https://github.com/lambdaclass/zksync-web3-rs/" +repository = "https://github.com/lambdaclass/zksync-ethers-rs/" +homepage = "https://github.com/lambdaclass/zksync-ethers-rs/" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From f13a81b18662829893777ee98e886b9b1000ce2b Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:45:37 +0200 Subject: [PATCH 02/75] Rename utils module --- src/lib.rs | 4 +- src/{zks_utils.rs => utils.rs} | 131 ++++----------------------------- 2 files changed, 18 insertions(+), 117 deletions(-) rename src/{zks_utils.rs => utils.rs} (61%) diff --git a/src/lib.rs b/src/lib.rs index 14b3691..9af470e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,10 +45,10 @@ pub mod abi; pub use ethers::*; +pub mod utils; + pub mod contracts; pub mod eip712; -pub mod zks_provider; -pub mod zks_utils; pub mod zks_wallet; pub use zks_wallet::{ZKSWallet, ZKSWalletError}; diff --git a/src/zks_utils.rs b/src/utils.rs similarity index 61% rename from src/zks_utils.rs rename to src/utils.rs index 319c44c..1dd732a 100644 --- a/src/zks_utils.rs +++ b/src/utils.rs @@ -2,20 +2,29 @@ use ethers::{ abi::{ encode, token::{LenientTokenizer, StrictTokenizer, Tokenizer}, - Constructor, Function, Param, ParamType, Token, + Address, Constructor, Function, Param, ParamType, Token, }, - types::{Address, H160, U256}, + types::U256, }; use ethers_contract::AbiError; use std::str::FromStr; +use zksync_types::H160; -/* Misc */ - +pub const L1_ETH_TOKEN_ADDRESS: Address = H160([ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +]); +pub const L2_ETH_TOKEN_ADDRESS: Address = H160([ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, +]); pub const ETH_CHAIN_ID: u16 = 0x9; -pub const ERA_CHAIN_ID: u16 = 0x10E; -pub const ERA_MAINNET_CHAIN_ID: u16 = 324; -pub const EIP712_TX_TYPE: u8 = 0x71; +/// The `L1->L2` transactions are required to have the following gas per pubdata byte. +pub const REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT: u64 = 800; +/// Gas limit used for displaying the error messages when the +/// users do not have enough fee when depositing `ETH` token from L1 to L2 +pub const L1_RECOMMENDED_MIN_ETH_DEPOSIT_GAS_LIMIT: u64 = 200_000; // The large L2 gas per pubdata to sign. This gas is enough to ensure that // any reasonable limit will be accepted. Note, that the operator is NOT required to // use the honest value of gas per pubdata and it can use any value up to the one signed by the user. @@ -24,114 +33,6 @@ pub const DEFAULT_GAS_PER_PUBDATA_LIMIT: u64 = 50000; pub const MAX_PRIORITY_FEE_PER_GAS: u64 = 1063439364; pub const MAX_FEE_PER_GAS: u64 = 1063439378; pub const DEFAULT_GAS: u64 = 91435; -/// This the number of pubdata such that it should be always possible to publish -/// from a single transaction. Note, that these pubdata bytes include only bytes that are -/// to be published inside the body of transaction (i.e. excluding of factory deps). -pub const GUARANTEED_PUBDATA_PER_L1_BATCH: u64 = 4000; -pub const MAX_L2_TX_GAS_LIMIT: u64 = 80000000; -// The users should always be able to provide `MAX_GAS_PER_PUBDATA_BYTE` gas per pubdata in their -// transactions so that they are able to send at least GUARANTEED_PUBDATA_PER_L1_BATCH bytes per -// transaction. -pub const MAX_GAS_PER_PUBDATA_BYTE: u64 = MAX_L2_TX_GAS_LIMIT / GUARANTEED_PUBDATA_PER_L1_BATCH; - -pub const RECOMMENDED_DEPOSIT_L1_GAS_LIMIT: u64 = 10000000; -pub const RECOMMENDED_DEPOSIT_L2_GAS_LIMIT: u64 = 10000000; -pub const DEPOSIT_GAS_PER_PUBDATA_LIMIT: u64 = 800; -pub const DEFAULT_ERC20_DEPOSIT_GAS_LIMIT: u64 = 300000_u64; - -/* Contracts */ - -pub const CHAIN_STATE_KEEPER_BOOTLOADER_HASH: &str = - "0x0100038581be3d0e201b3cc45d151ef5cc59eb3a0f146ad44f0f72abf00b594c"; -pub const CHAIN_STATE_KEEPER_DEFAULT_AA_HASH: &str = - "0x0100038dc66b69be75ec31653c64cb931678299b9b659472772b2550b703f41c"; - -pub const CONTRACT_DEPLOYER_ADDR: &str = "0x0000000000000000000000000000000000008006"; -pub const CONTRACTS_DIAMOND_INIT_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_DIAMOND_UPGRADE_INIT_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_MAILBOX_FACET_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_DIAMOND_CUT_FACET_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_EXECUTOR_FACET_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_GOVERNANCE_FACET_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_GETTERS_FACET_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_VERIFIER_ADDR: &str = "0xDAbb67b676F5b01FcC8997Cc8439846D0d8078ca"; -pub const CONTRACTS_DIAMOND_PROXY_ADDR: &str = "0xFC073319977e314F251EAE6ae6bE76B0B3BAeeCF"; -pub const CONTRACTS_L1_ERC20_BRIDGE_PROXY_ADDR: &str = "0xFC073319977e314F251EAE6ae6bE76B0B3BAeeCF"; -pub const CONTRACTS_L1_ERC20_BRIDGE_IMPL_ADDR: &str = "0xFC073319977e314F251EAE6ae6bE76B0B3BAeeCF"; -pub const CONTRACTS_L2_ERC20_BRIDGE_ADDR: &str = "0xFC073319977e314F251EAE6ae6bE76B0B3BAeeCF"; -pub const CONTRACTS_L2_TESTNET_PAYMASTER_ADDR: &str = "0xFC073319977e314F251EAE6ae6bE76B0B3BAeeCF"; -pub const CONTRACTS_L1_ALLOW_LIST_ADDR: &str = "0xFC073319977e314F251EAE6ae6bE76B0B3BAeeCF"; -pub const CONTRACTS_CREATE2_FACTORY_ADDR: &str = "0xce0042B868300000d44A59004Da54A005ffdcf9f"; -pub const CONTRACTS_VALIDATOR_TIMELOCK_ADDR: &str = "0xFC073319977e314F251EAE6ae6bE76B0B3BAeeCF"; -pub const CONTRACTS_L1_WETH_BRIDGE_IMPL_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_L1_WETH_BRIDGE_PROXY_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_L1_WETH_TOKEN_ADDR: &str = "0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"; -pub const CONTRACTS_L2_ETH_TOKEN_ADDR: &str = "0x000000000000000000000000000000000000800a"; -pub const CONTRACTS_L1_MESSENGER_ADDR: &str = "0x0000000000000000000000000000000000008008"; - -pub const ETHER_L1_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -]); - -/* Precompiles */ - -pub const ECRECOVER_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, -]); - -pub const SHA256_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x02, -]); - -pub const RIPEMD_160_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, -]); - -pub const IDENTITY_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, -]); - -pub const MODEXP_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x05, -]); - -pub const ECADD_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, -]); - -pub const ECMUL_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x07, -]); - -pub const ECPAIRING_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x08, -]); - -pub const BLAKE2F_PRECOMPILE_ADDRESS: Address = H160([ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x09, -]); - -pub fn is_precompile(address: Address) -> bool { - address == ECRECOVER_PRECOMPILE_ADDRESS - || address == SHA256_PRECOMPILE_ADDRESS - || address == RIPEMD_160_PRECOMPILE_ADDRESS - || address == IDENTITY_PRECOMPILE_ADDRESS - || address == MODEXP_PRECOMPILE_ADDRESS - || address == ECADD_PRECOMPILE_ADDRESS - || address == ECMUL_PRECOMPILE_ADDRESS - || address == ECPAIRING_PRECOMPILE_ADDRESS - || address == BLAKE2F_PRECOMPILE_ADDRESS -} /// Given a function and a vector of string arguments, it proceeds to convert the args to ethabi /// Tokens and then ABI encode them. From c336a518bb2362366f14abe54f4338be0c1e8cd9 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:46:46 +0200 Subject: [PATCH 03/75] Add new ABIs and move ABIs dir to root --- abi/IBridgehub.json | 631 +++++ .../IContractDeployer.json | 277 +- abi/IERC1271.json | 26 + abi/IERC20.json | 224 ++ abi/IEthToken.json | 245 ++ abi/IL1Bridge.json | 512 ++++ abi/IL1ERC20Bridge.json | 377 +++ abi/IL1Messenger.json | 146 + abi/IL1SharedBridge.json | 692 +++++ abi/IL2Bridge.json | 109 + abi/INonceHolder.json | 219 ++ abi/IPaymasterFlow.json | 38 + abi/ITestnetERC20Token.json | 39 + abi/IZkSyncHyperchain.json | 2405 +++++++++++++++++ .../IZkSyncStateTransition.json | 1171 +++++--- .../test_contracts/basic_combined.json | 0 .../test_contracts/counter_combined.json | 0 .../test_contracts/greeter_combined.json | 0 .../test_contracts/import_combined.json | 0 .../test_contracts/storage_combined.json | 0 src/abi/IL1Bridge.json | 243 -- src/abi/mod.rs | 21 - 22 files changed, 6542 insertions(+), 833 deletions(-) create mode 100644 abi/IBridgehub.json rename src/abi/ContractDeployer.json => abi/IContractDeployer.json (84%) create mode 100644 abi/IERC1271.json create mode 100644 abi/IERC20.json create mode 100644 abi/IEthToken.json create mode 100644 abi/IL1Bridge.json create mode 100644 abi/IL1ERC20Bridge.json create mode 100644 abi/IL1Messenger.json create mode 100644 abi/IL1SharedBridge.json create mode 100644 abi/IL2Bridge.json create mode 100644 abi/INonceHolder.json create mode 100644 abi/IPaymasterFlow.json create mode 100644 abi/ITestnetERC20Token.json create mode 100644 abi/IZkSyncHyperchain.json rename src/abi/IZkSync.json => abi/IZkSyncStateTransition.json (71%) rename {src/abi => abi}/test_contracts/basic_combined.json (100%) rename {src/abi => abi}/test_contracts/counter_combined.json (100%) rename {src/abi => abi}/test_contracts/greeter_combined.json (100%) rename {src/abi => abi}/test_contracts/import_combined.json (100%) rename {src/abi => abi}/test_contracts/storage_combined.json (100%) delete mode 100644 src/abi/IL1Bridge.json delete mode 100644 src/abi/mod.rs diff --git a/abi/IBridgehub.json b/abi/IBridgehub.json new file mode 100644 index 0000000..22db2fd --- /dev/null +++ b/abi/IBridgehub.json @@ -0,0 +1,631 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "NewAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "stateTransitionManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "chainGovernance", + "type": "address" + } + ], + "name": "NewChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingAdmin", + "type": "address" + } + ], + "name": "NewPendingAdmin", + "type": "event" + }, + { + "inputs": [], + "name": "acceptAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stateTransitionManager", + "type": "address" + } + ], + "name": "addStateTransitionManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "addToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "baseToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_stateTransitionManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_baseToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_initData", + "type": "bytes" + } + ], + "name": "createNewChain", + "outputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "getStateTransition", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2GasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2GasPerPubdataByteLimit", + "type": "uint256" + } + ], + "name": "l2TransactionBaseCost", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_l2TxHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + }, + { + "internalType": "enum TxStatus", + "name": "_status", + "type": "uint8" + } + ], + "name": "proveL1ToL2TransactionStatus", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_batchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint8", + "name": "l2ShardId", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isService", + "type": "bool" + }, + { + "internalType": "uint16", + "name": "txNumberInBatch", + "type": "uint16" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "internalType": "struct L2Log", + "name": "_log", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_proof", + "type": "bytes32[]" + } + ], + "name": "proveL2LogInclusion", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_batchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint16", + "name": "txNumberInBatch", + "type": "uint16" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct L2Message", + "name": "_message", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_proof", + "type": "bytes32[]" + } + ], + "name": "proveL2MessageInclusion", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stateTransitionManager", + "type": "address" + } + ], + "name": "removeStateTransitionManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintValue", + "type": "uint256" + }, + { + "internalType": "address", + "name": "l2Contract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "l2Value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "l2Calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "l2GasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2GasPerPubdataByteLimit", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "factoryDeps", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "refundRecipient", + "type": "address" + } + ], + "internalType": "struct L2TransactionRequestDirect", + "name": "_request", + "type": "tuple" + } + ], + "name": "requestL2TransactionDirect", + "outputs": [ + { + "internalType": "bytes32", + "name": "canonicalTxHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2Value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2GasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2GasPerPubdataByteLimit", + "type": "uint256" + }, + { + "internalType": "address", + "name": "refundRecipient", + "type": "address" + }, + { + "internalType": "address", + "name": "secondBridgeAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "secondBridgeValue", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "secondBridgeCalldata", + "type": "bytes" + } + ], + "internalType": "struct L2TransactionRequestTwoBridgesOuter", + "name": "_request", + "type": "tuple" + } + ], + "name": "requestL2TransactionTwoBridges", + "outputs": [ + { + "internalType": "bytes32", + "name": "canonicalTxHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPendingAdmin", + "type": "address" + } + ], + "name": "setPendingAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sharedBridge", + "type": "address" + } + ], + "name": "setSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedBridge", + "outputs": [ + { + "internalType": "contract IL1SharedBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "stateTransitionManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stateTransitionManager", + "type": "address" + } + ], + "name": "stateTransitionManagerIsRegistered", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baseToken", + "type": "address" + } + ], + "name": "tokenIsRegistered", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/abi/ContractDeployer.json b/abi/IContractDeployer.json similarity index 84% rename from src/abi/ContractDeployer.json rename to abi/IContractDeployer.json index 5f749f9..2525a78 100644 --- a/src/abi/ContractDeployer.json +++ b/abi/IContractDeployer.json @@ -1,411 +1,410 @@ [ - { + { "anonymous": false, "inputs": [ - { + { "indexed": true, "internalType": "address", "name": "accountAddress", "type": "address" - }, - { + }, + { "indexed": false, "internalType": "enum IContractDeployer.AccountNonceOrdering", "name": "nonceOrdering", "type": "uint8" - } + } ], "name": "AccountNonceOrderingUpdated", "type": "event" - }, - { + }, + { "anonymous": false, "inputs": [ - { + { "indexed": true, "internalType": "address", "name": "accountAddress", "type": "address" - }, - { + }, + { "indexed": false, "internalType": "enum IContractDeployer.AccountAbstractionVersion", "name": "aaVersion", "type": "uint8" - } + } ], "name": "AccountVersionUpdated", "type": "event" - }, - { + }, + { "anonymous": false, "inputs": [ - { + { "indexed": true, "internalType": "address", "name": "deployerAddress", "type": "address" - }, - { + }, + { "indexed": true, "internalType": "bytes32", "name": "bytecodeHash", "type": "bytes32" - }, - { + }, + { "indexed": true, "internalType": "address", "name": "contractAddress", "type": "address" - } + } ], "name": "ContractDeployed", "type": "event" - }, - { + }, + { "inputs": [ - { + { "internalType": "bytes32", "name": "_salt", "type": "bytes32" - }, - { + }, + { "internalType": "bytes32", "name": "_bytecodeHash", "type": "bytes32" - }, - { + }, + { "internalType": "bytes", "name": "_input", "type": "bytes" - } + } ], "name": "create", "outputs": [ - { + { "internalType": "address", "name": "", "type": "address" - } + } ], "stateMutability": "payable", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "bytes32", "name": "_salt", "type": "bytes32" - }, - { + }, + { "internalType": "bytes32", "name": "_bytecodeHash", "type": "bytes32" - }, - { + }, + { "internalType": "bytes", "name": "_input", "type": "bytes" - } + } ], "name": "create2", "outputs": [ - { + { "internalType": "address", "name": "", "type": "address" - } + } ], "stateMutability": "payable", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "bytes32", "name": "_salt", "type": "bytes32" - }, - { + }, + { "internalType": "bytes32", "name": "_bytecodeHash", "type": "bytes32" - }, - { + }, + { "internalType": "bytes", "name": "_input", "type": "bytes" - }, - { + }, + { "internalType": "enum IContractDeployer.AccountAbstractionVersion", "name": "_aaVersion", "type": "uint8" - } + } ], "name": "create2Account", "outputs": [ - { + { "internalType": "address", "name": "", "type": "address" - } + } ], "stateMutability": "payable", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "bytes32", "name": "", "type": "bytes32" - }, - { + }, + { "internalType": "bytes32", "name": "_bytecodeHash", "type": "bytes32" - }, - { + }, + { "internalType": "bytes", "name": "_input", "type": "bytes" - }, - { + }, + { "internalType": "enum IContractDeployer.AccountAbstractionVersion", "name": "_aaVersion", "type": "uint8" - } + } ], "name": "createAccount", "outputs": [ - { + { "internalType": "address", "name": "", "type": "address" - } + } ], "stateMutability": "payable", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "address", "name": "_address", "type": "address" - } + } ], "name": "extendedAccountVersion", "outputs": [ - { + { "internalType": "enum IContractDeployer.AccountAbstractionVersion", "name": "", "type": "uint8" - } + } ], "stateMutability": "view", "type": "function" - }, - { + }, + { "inputs": [ - { + { "components": [ - { + { "internalType": "bytes32", "name": "bytecodeHash", "type": "bytes32" - }, - { + }, + { "internalType": "address", "name": "newAddress", "type": "address" - }, - { + }, + { "internalType": "bool", "name": "callConstructor", "type": "bool" - }, - { + }, + { "internalType": "uint256", "name": "value", "type": "uint256" - }, - { + }, + { "internalType": "bytes", "name": "input", "type": "bytes" - } + } ], "internalType": "struct ContractDeployer.ForceDeployment", "name": "_deployment", "type": "tuple" - }, - { + }, + { "internalType": "address", "name": "_sender", "type": "address" - } + } ], "name": "forceDeployOnAddress", "outputs": [], "stateMutability": "payable", "type": "function" - }, - { + }, + { "inputs": [ - { + { "components": [ - { + { "internalType": "bytes32", "name": "bytecodeHash", "type": "bytes32" - }, - { + }, + { "internalType": "address", "name": "newAddress", "type": "address" - }, - { + }, + { "internalType": "bool", "name": "callConstructor", "type": "bool" - }, - { + }, + { "internalType": "uint256", "name": "value", "type": "uint256" - }, - { + }, + { "internalType": "bytes", "name": "input", "type": "bytes" - } + } ], "internalType": "struct ContractDeployer.ForceDeployment[]", "name": "_deployments", "type": "tuple[]" - } + } ], "name": "forceDeployOnAddresses", "outputs": [], "stateMutability": "payable", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "address", "name": "_address", "type": "address" - } + } ], "name": "getAccountInfo", "outputs": [ - { + { "components": [ - { + { "internalType": "enum IContractDeployer.AccountAbstractionVersion", "name": "supportedAAVersion", "type": "uint8" - }, - { + }, + { "internalType": "enum IContractDeployer.AccountNonceOrdering", "name": "nonceOrdering", "type": "uint8" - } + } ], "internalType": "struct IContractDeployer.AccountInfo", "name": "info", "type": "tuple" - } + } ], "stateMutability": "view", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "address", "name": "_sender", "type": "address" - }, - { + }, + { "internalType": "uint256", "name": "_senderNonce", "type": "uint256" - } + } ], "name": "getNewAddressCreate", "outputs": [ - { + { "internalType": "address", "name": "newAddress", "type": "address" - } + } ], "stateMutability": "pure", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "address", "name": "_sender", "type": "address" - }, - { + }, + { "internalType": "bytes32", "name": "_bytecodeHash", "type": "bytes32" - }, - { + }, + { "internalType": "bytes32", "name": "_salt", "type": "bytes32" - }, - { + }, + { "internalType": "bytes", "name": "_input", "type": "bytes" - } + } ], "name": "getNewAddressCreate2", "outputs": [ - { + { "internalType": "address", "name": "newAddress", "type": "address" - } + } ], "stateMutability": "view", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "enum IContractDeployer.AccountAbstractionVersion", "name": "_version", "type": "uint8" - } + } ], "name": "updateAccountVersion", "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { + }, + { "inputs": [ - { + { "internalType": "enum IContractDeployer.AccountNonceOrdering", "name": "_nonceOrdering", "type": "uint8" - } + } ], "name": "updateNonceOrdering", "outputs": [], "stateMutability": "nonpayable", "type": "function" - } + } ] - \ No newline at end of file diff --git a/abi/IERC1271.json b/abi/IERC1271.json new file mode 100644 index 0000000..bebcf03 --- /dev/null +++ b/abi/IERC1271.json @@ -0,0 +1,26 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "magicValue", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/abi/IERC20.json b/abi/IERC20.json new file mode 100644 index 0000000..177ac83 --- /dev/null +++ b/abi/IERC20.json @@ -0,0 +1,224 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IEthToken.json b/abi/IEthToken.json new file mode 100644 index 0000000..c497f23 --- /dev/null +++ b/abi/IEthToken.json @@ -0,0 +1,245 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_l2Sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_l1Receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_l2Sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_l1Receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_additionalData", + "type": "bytes" + } + ], + "name": "WithdrawalWithMessage", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferFromTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Receiver", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Receiver", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_additionalData", + "type": "bytes" + } + ], + "name": "withdrawWithMessage", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } +] diff --git a/abi/IL1Bridge.json b/abi/IL1Bridge.json new file mode 100644 index 0000000..7069b2d --- /dev/null +++ b/abi/IL1Bridge.json @@ -0,0 +1,512 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "txDataHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "l2DepositTxHash", + "type": "bytes32" + } + ], + "name": "BridgehubDepositFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "txDataHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgehubDepositInitiatedSharedBridge", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimedFailedDepositSharedBridge", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "l2DepositTxHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DepositInitiatedSharedBridge", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawalFinalizedSharedBridge", + "type": "event" + }, + { + "inputs": [], + "name": "bridgehub", + "outputs": [ + { + "internalType": "contract IBridgehub", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_txDataHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txHash", + "type": "bytes32" + } + ], + "name": "bridgehubConfirmL2Transaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_prevMsgSender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "bridgehubDeposit", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "magicValue", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "l2Contract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "l2Calldata", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "factoryDeps", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "txDataHash", + "type": "bytes32" + } + ], + "internalType": "struct L2TransactionRequestTwoBridgesInner", + "name": "request", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_prevMsgSender", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "bridgehubDepositBaseToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_depositSender", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_l2TxHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "claimFailedDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_l2Receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_mintValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2TxGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2TxGasPerPubdataByte", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_refundRecipient", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_l2TxHash", + "type": "bytes32" + } + ], + "name": "depositHappened", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "finalizeWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + } + ], + "name": "isWithdrawalFinalizedShared", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "l2BridgeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/abi/IL1ERC20Bridge.json b/abi/IL1ERC20Bridge.json new file mode 100644 index 0000000..bdade3c --- /dev/null +++ b/abi/IL1ERC20Bridge.json @@ -0,0 +1,377 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimedFailedDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "l2DepositTxHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DepositInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawalFinalized", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_depositSender", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_l2TxHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "claimFailedDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2TxGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2TxGasPerPubdataByte", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2TxGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2TxGasPerPubdataByte", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_refundRecipient", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_depositL2TxHash", + "type": "bytes32" + } + ], + "name": "depositAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "finalizeWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + } + ], + "name": "isWithdrawalFinalized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Bridge", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + } + ], + "name": "l2TokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2TokenBeacon", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharedBridge", + "outputs": [ + { + "internalType": "contract IL1SharedBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferTokenToSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/abi/IL1Messenger.json b/abi/IL1Messenger.json new file mode 100644 index 0000000..0bf5502 --- /dev/null +++ b/abi/IL1Messenger.json @@ -0,0 +1,146 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + } + ], + "name": "BytecodeL1PublicationRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_hash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "L1MessageSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint8", + "name": "l2ShardId", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isService", + "type": "bool" + }, + { + "internalType": "uint16", + "name": "txNumberInBlock", + "type": "uint16" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct L2ToL1Log", + "name": "_l2log", + "type": "tuple" + } + ], + "name": "L2ToL1LogSent", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + } + ], + "name": "requestBytecodeL1Publication", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isService", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_value", + "type": "bytes32" + } + ], + "name": "sendL2ToL1Log", + "outputs": [ + { + "internalType": "uint256", + "name": "logIdInMerkleTree", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "sendToL1", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IL1SharedBridge.json b/abi/IL1SharedBridge.json new file mode 100644 index 0000000..a56f86e --- /dev/null +++ b/abi/IL1SharedBridge.json @@ -0,0 +1,692 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgehubDepositBaseTokenInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "txDataHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "l2DepositTxHash", + "type": "bytes32" + } + ], + "name": "BridgehubDepositFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "txDataHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgehubDepositInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimedFailedDepositSharedBridge", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "l2DepositTxHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LegacyDepositInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawalFinalizedSharedBridge", + "type": "event" + }, + { + "inputs": [], + "name": "bridgehub", + "outputs": [ + { + "internalType": "contract IBridgehub", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_txDataHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txHash", + "type": "bytes32" + } + ], + "name": "bridgehubConfirmL2Transaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_prevMsgSender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_l2Value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "bridgehubDeposit", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "magicValue", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "l2Contract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "l2Calldata", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "factoryDeps", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "txDataHash", + "type": "bytes32" + } + ], + "internalType": "struct L2TransactionRequestTwoBridgesInner", + "name": "request", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_prevMsgSender", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "bridgehubDepositBaseToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_depositSender", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_l2TxHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "claimFailedDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_depositSender", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_l2TxHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "claimFailedDepositLegacyErc20Bridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_l2TxHash", + "type": "bytes32" + } + ], + "name": "depositHappened", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_msgSender", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2TxGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2TxGasPerPubdataByte", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_refundRecipient", + "type": "address" + } + ], + "name": "depositLegacyErc20Bridge", + "outputs": [ + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "finalizeWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "finalizeWithdrawalLegacyErc20Bridge", + "outputs": [ + { + "internalType": "address", + "name": "l1Receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + } + ], + "name": "isWithdrawalFinalized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1WethAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "l2BridgeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "legacyBridge", + "outputs": [ + { + "internalType": "contract IL1ERC20Bridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "receiveEth", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_eraFirstPostUpgradeBatch", + "type": "uint256" + } + ], + "name": "setEraFirstPostUpgradeBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IL2Bridge.json b/abi/IL2Bridge.json new file mode 100644 index 0000000..5750421 --- /dev/null +++ b/abi/IL2Bridge.json @@ -0,0 +1,109 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "finalizeDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "l1Bridge", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Token", + "type": "address" + } + ], + "name": "l1TokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Token", + "type": "address" + } + ], + "name": "l2TokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/INonceHolder.json b/abi/INonceHolder.json new file mode 100644 index 0000000..1ee9c5c --- /dev/null +++ b/abi/INonceHolder.json @@ -0,0 +1,219 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "accountAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "key", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ValueSetUnderNonce", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "getDeploymentNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "getMinNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "getRawNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_key", + "type": "uint256" + } + ], + "name": "getValueUnderNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "increaseMinNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "incrementDeploymentNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_expectedNonce", + "type": "uint256" + } + ], + "name": "incrementMinNonceIfEquals", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "isNonceUsed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_key", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "setValueUnderNonce", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_key", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_shouldBeUsed", + "type": "bool" + } + ], + "name": "validateNonceUsage", + "outputs": [], + "stateMutability": "view", + "type": "function" + } +] diff --git a/abi/IPaymasterFlow.json b/abi/IPaymasterFlow.json new file mode 100644 index 0000000..132e55b --- /dev/null +++ b/abi/IPaymasterFlow.json @@ -0,0 +1,38 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minAllowance", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_innerInput", + "type": "bytes" + } + ], + "name": "approvalBased", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "input", + "type": "bytes" + } + ], + "name": "general", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/ITestnetERC20Token.json b/abi/ITestnetERC20Token.json new file mode 100644 index 0000000..3c4bbc4 --- /dev/null +++ b/abi/ITestnetERC20Token.json @@ -0,0 +1,39 @@ +[ + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IZkSyncHyperchain.json b/abi/IZkSyncHyperchain.json new file mode 100644 index 0000000..504434c --- /dev/null +++ b/abi/IZkSyncHyperchain.json @@ -0,0 +1,2405 @@ +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "batchNumber", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "name": "BlockCommit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "batchNumber", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "name": "BlockExecution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "totalBatchesCommitted", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBatchesVerified", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBatchesExecuted", + "type": "uint256" + } + ], + "name": "BlocksRevert", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "previousLastVerifiedBatch", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "currentLastVerifiedBatch", + "type": "uint256" + } + ], + "name": "BlocksVerification", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EthWithdrawalFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct Diamond.DiamondCutData", + "name": "diamondCut", + "type": "tuple" + } + ], + "name": "ExecuteUpgrade", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Freeze", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "isPorterAvailable", + "type": "bool" + } + ], + "name": "IsPorterAvailableStatusUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "NewAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "oldNominator", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "oldDenominator", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newNominator", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newDenominator", + "type": "uint128" + } + ], + "name": "NewBaseTokenMultiplier", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "enum PubdataPricingMode", + "name": "pubdataPricingMode", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "batchOverheadL1Gas", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxPubdataPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxL2GasPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "priorityTxMaxPubdata", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "minimalL2GasPrice", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct FeeParams", + "name": "oldFeeParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum PubdataPricingMode", + "name": "pubdataPricingMode", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "batchOverheadL1Gas", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxPubdataPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxL2GasPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "priorityTxMaxPubdata", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "minimalL2GasPrice", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct FeeParams", + "name": "newFeeParams", + "type": "tuple" + } + ], + "name": "NewFeeParams", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingAdmin", + "type": "address" + } + ], + "name": "NewPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "txId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "expirationTimestamp", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "txType", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "from", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "to", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPerPubdataByteLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeePerGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPriorityFeePerGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "paymaster", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "reserved", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "factoryDeps", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "paymasterInput", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "reservedDynamic", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct L2CanonicalTransaction", + "name": "transaction", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "bytes[]", + "name": "factoryDeps", + "type": "bytes[]" + } + ], + "name": "NewPriorityRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldPriorityTxMaxGasLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPriorityTxMaxGasLimit", + "type": "uint256" + } + ], + "name": "NewPriorityTxMaxGasLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTransactionFilterer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTransactionFilterer", + "type": "address" + } + ], + "name": "NewTransactionFilterer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct Diamond.DiamondCutData", + "name": "diamondCut", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "proposalSalt", + "type": "bytes32" + } + ], + "name": "ProposeTransparentUpgrade", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Unfreeze", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validatorAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "name": "ValidatorStatusUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum PubdataPricingMode", + "name": "validiumMode", + "type": "uint8" + } + ], + "name": "ValidiumModeStatusUpdate", + "type": "event" + }, + { + "inputs": [], + "name": "acceptAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "baseTokenGasPriceMultiplierDenominator", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseTokenGasPriceMultiplierNominator", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "contractL2", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2Value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "l2Calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "l2GasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2GasPerPubdataByteLimit", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "factoryDeps", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "refundRecipient", + "type": "address" + } + ], + "internalType": "struct BridgehubL2TransactionRequest", + "name": "_request", + "type": "tuple" + } + ], + "name": "bridgehubRequestL2Transaction", + "outputs": [ + { + "internalType": "bytes32", + "name": "canonicalTxHash", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum PubdataPricingMode", + "name": "pubdataPricingMode", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "batchOverheadL1Gas", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxPubdataPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxL2GasPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "priorityTxMaxPubdata", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "minimalL2GasPrice", + "type": "uint64" + } + ], + "internalType": "struct FeeParams", + "name": "_newFeeParams", + "type": "tuple" + } + ], + "name": "changeFeeParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_lastCommittedBatchData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "newStateRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "bootloaderHeapInitialContentsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "eventsQueueStateHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "systemLogs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "pubdataCommitments", + "type": "bytes" + } + ], + "internalType": "struct IExecutor.CommitBatchInfo[]", + "name": "_newBatchesData", + "type": "tuple[]" + } + ], + "name": "commitBatches", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_lastCommittedBatchData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "newStateRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "bootloaderHeapInitialContentsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "eventsQueueStateHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "systemLogs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "pubdataCommitments", + "type": "bytes" + } + ], + "internalType": "struct IExecutor.CommitBatchInfo[]", + "name": "_newBatchesData", + "type": "tuple[]" + } + ], + "name": "commitBatchesSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_batchesData", + "type": "tuple[]" + } + ], + "name": "executeBatches", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_batchesData", + "type": "tuple[]" + } + ], + "name": "executeBatchesSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "internalType": "struct Diamond.DiamondCutData", + "name": "_diamondCut", + "type": "tuple" + } + ], + "name": "executeUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "facets", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IGetters.Facet[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + } + ], + "name": "finalizeEthWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "freezeDiamond", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBaseToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBaseTokenBridge", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBridgehub", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFirstUnprocessedPriorityTx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getL2BootloaderBytecodeHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getL2DefaultAccountBytecodeHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getL2SystemContractsUpgradeBatchNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getL2SystemContractsUpgradeTxHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getName", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriorityQueueSize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriorityTxMaxGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPubdataPricingMode", + "outputs": [ + { + "internalType": "enum PubdataPricingMode", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStateTransitionManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalBatchesCommitted", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalBatchesExecuted", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalBatchesVerified", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalPriorityTxs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifier", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierParams", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "recursionNodeLevelVkHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "recursionLeafLevelVkHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "recursionCircuitsSetVksHash", + "type": "bytes32" + } + ], + "internalType": "struct VerifierParams", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDiamondStorageFrozen", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + } + ], + "name": "isEthWithdrawalFinalized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_facet", + "type": "address" + } + ], + "name": "isFacetFreezable", + "outputs": [ + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_selector", + "type": "bytes4" + } + ], + "name": "isFunctionFreezable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "isValidator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_batchNumber", + "type": "uint256" + } + ], + "name": "l2LogsRootHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_gasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2GasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2GasPerPubdataByteLimit", + "type": "uint256" + } + ], + "name": "l2TransactionBaseCost", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priorityQueueFrontOperation", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "canonicalTxHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expirationTimestamp", + "type": "uint64" + }, + { + "internalType": "uint192", + "name": "layer2Tip", + "type": "uint192" + } + ], + "internalType": "struct PriorityOperation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_prevBatch", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_committedBatches", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "recursiveAggregationInput", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "serializedProof", + "type": "uint256[]" + } + ], + "internalType": "struct IExecutor.ProofInput", + "name": "_proof", + "type": "tuple" + } + ], + "name": "proveBatches", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_prevBatch", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_committedBatches", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "recursiveAggregationInput", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "serializedProof", + "type": "uint256[]" + } + ], + "internalType": "struct IExecutor.ProofInput", + "name": "_proof", + "type": "tuple" + } + ], + "name": "proveBatchesSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_l2TxHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_l2BatchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2MessageIndex", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_l2TxNumberInBatch", + "type": "uint16" + }, + { + "internalType": "bytes32[]", + "name": "_merkleProof", + "type": "bytes32[]" + }, + { + "internalType": "enum TxStatus", + "name": "_status", + "type": "uint8" + } + ], + "name": "proveL1ToL2TransactionStatus", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_batchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint8", + "name": "l2ShardId", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isService", + "type": "bool" + }, + { + "internalType": "uint16", + "name": "txNumberInBatch", + "type": "uint16" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "internalType": "struct L2Log", + "name": "_log", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_proof", + "type": "bytes32[]" + } + ], + "name": "proveL2LogInclusion", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_batchNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint16", + "name": "txNumberInBatch", + "type": "uint16" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct L2Message", + "name": "_message", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_proof", + "type": "bytes32[]" + } + ], + "name": "proveL2MessageInclusion", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_contractL2", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_l2Value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_l2GasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2GasPerPubdataByteLimit", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "_factoryDeps", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_refundRecipient", + "type": "address" + } + ], + "name": "requestL2Transaction", + "outputs": [ + { + "internalType": "bytes32", + "name": "canonicalTxHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_newLastBatch", + "type": "uint256" + } + ], + "name": "revertBatches", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_newLastBatch", + "type": "uint256" + } + ], + "name": "revertBatchesSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPendingAdmin", + "type": "address" + } + ], + "name": "setPendingAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_zkPorterIsAvailable", + "type": "bool" + } + ], + "name": "setPorterAvailability", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_newPriorityTxMaxGasLimit", + "type": "uint256" + } + ], + "name": "setPriorityTxMaxGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum PubdataPricingMode", + "name": "_pricingMode", + "type": "uint8" + } + ], + "name": "setPubdataPricingMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "_nominator", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "_denominator", + "type": "uint128" + } + ], + "name": "setTokenMultiplier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_transactionFilterer", + "type": "address" + } + ], + "name": "setTransactionFilterer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "bool", + "name": "_active", + "type": "bool" + } + ], + "name": "setValidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_batchNumber", + "type": "uint256" + } + ], + "name": "storedBatchHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "transferEthToSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unfreezeDiamond", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_protocolVersion", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "internalType": "struct Diamond.DiamondCutData", + "name": "_cutData", + "type": "tuple" + } + ], + "name": "upgradeChainFromVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/src/abi/IZkSync.json b/abi/IZkSyncStateTransition.json similarity index 71% rename from src/abi/IZkSync.json rename to abi/IZkSyncStateTransition.json index 679f8d4..d7f8622 100644 --- a/src/abi/IZkSync.json +++ b/abi/IZkSyncStateTransition.json @@ -5,13 +5,13 @@ { "indexed": true, "internalType": "uint256", - "name": "blockNumber", + "name": "batchNumber", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -30,13 +30,13 @@ { "indexed": true, "internalType": "uint256", - "name": "blockNumber", + "name": "batchNumber", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -55,19 +55,19 @@ { "indexed": false, "internalType": "uint256", - "name": "totalBlocksCommitted", + "name": "totalBatchesCommitted", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "totalBlocksVerified", + "name": "totalBatchesVerified", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "totalBlocksExecuted", + "name": "totalBatchesExecuted", "type": "uint256" } ], @@ -80,38 +80,19 @@ { "indexed": true, "internalType": "uint256", - "name": "previousLastVerifiedBlock", + "name": "previousLastVerifiedBatch", "type": "uint256" }, { "indexed": true, "internalType": "uint256", - "name": "currentLastVerifiedBlock", + "name": "currentLastVerifiedBatch", "type": "uint256" } ], "name": "BlocksVerification", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - } - ], - "name": "CancelUpgradeProposal", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -135,22 +116,49 @@ "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - }, - { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], "indexed": false, - "internalType": "bytes32", - "name": "proposalSalt", - "type": "bytes32" + "internalType": "struct Diamond.DiamondCutData", + "name": "diamondCut", + "type": "tuple" } ], "name": "ExecuteUpgrade", @@ -181,74 +189,131 @@ { "indexed": true, "internalType": "address", - "name": "oldAllowList", + "name": "oldAdmin", "type": "address" }, { "indexed": true, "internalType": "address", - "name": "newAllowList", + "name": "newAdmin", "type": "address" } ], - "name": "NewAllowList", + "name": "NewAdmin", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "oldGovernor", - "type": "address" + "indexed": false, + "internalType": "uint128", + "name": "oldNominator", + "type": "uint128" }, { - "indexed": true, - "internalType": "address", - "name": "newGovernor", - "type": "address" - } - ], - "name": "NewGovernor", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "indexed": false, + "internalType": "uint128", + "name": "oldDenominator", + "type": "uint128" + }, { - "indexed": true, - "internalType": "bytes32", - "name": "previousBytecodeHash", - "type": "bytes32" + "indexed": false, + "internalType": "uint128", + "name": "newNominator", + "type": "uint128" }, { - "indexed": true, - "internalType": "bytes32", - "name": "newBytecodeHash", - "type": "bytes32" + "indexed": false, + "internalType": "uint128", + "name": "newDenominator", + "type": "uint128" } ], - "name": "NewL2BootloaderBytecodeHash", + "name": "NewBaseTokenMultiplier", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "bytes32", - "name": "previousBytecodeHash", - "type": "bytes32" + "components": [ + { + "internalType": "enum PubdataPricingMode", + "name": "pubdataPricingMode", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "batchOverheadL1Gas", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxPubdataPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxL2GasPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "priorityTxMaxPubdata", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "minimalL2GasPrice", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct FeeParams", + "name": "oldFeeParams", + "type": "tuple" }, { - "indexed": true, - "internalType": "bytes32", - "name": "newBytecodeHash", - "type": "bytes32" + "components": [ + { + "internalType": "enum PubdataPricingMode", + "name": "pubdataPricingMode", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "batchOverheadL1Gas", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxPubdataPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxL2GasPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "priorityTxMaxPubdata", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "minimalL2GasPrice", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct FeeParams", + "name": "newFeeParams", + "type": "tuple" } ], - "name": "NewL2DefaultAccountBytecodeHash", + "name": "NewFeeParams", "type": "event" }, { @@ -257,17 +322,17 @@ { "indexed": true, "internalType": "address", - "name": "oldPendingGovernor", + "name": "oldPendingAdmin", "type": "address" }, { "indexed": true, "internalType": "address", - "name": "newPendingGovernor", + "name": "newPendingAdmin", "type": "address" } ], - "name": "NewPendingGovernor", + "name": "NewPendingAdmin", "type": "event" }, { @@ -375,7 +440,7 @@ } ], "indexed": false, - "internalType": "struct IMailbox.L2CanonicalTransaction", + "internalType": "struct L2CanonicalTransaction", "name": "transaction", "type": "tuple" }, @@ -412,91 +477,19 @@ "anonymous": false, "inputs": [ { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "oldVerifier", + "name": "oldTransactionFilterer", "type": "address" }, { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "newVerifier", + "name": "newTransactionFilterer", "type": "address" } ], - "name": "NewVerifier", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "recursionNodeLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionLeafLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionCircuitsSetVksHash", - "type": "bytes32" - } - ], - "indexed": false, - "internalType": "struct VerifierParams", - "name": "oldVerifierParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "recursionNodeLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionLeafLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionCircuitsSetVksHash", - "type": "bytes32" - } - ], - "indexed": false, - "internalType": "struct VerifierParams", - "name": "newVerifierParams", - "type": "tuple" - } - ], - "name": "NewVerifierParams", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - } - ], - "name": "ProposeShadowUpgrade", + "name": "NewTransactionFilterer", "type": "event" }, { @@ -563,25 +556,6 @@ "name": "ProposeTransparentUpgrade", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - } - ], - "name": "SecurityCouncilUpgradeApprove", - "type": "event" - }, { "anonymous": false, "inputs": [], @@ -604,12 +578,162 @@ "type": "bool" } ], - "name": "ValidatorStatusUpdate", - "type": "event" + "name": "ValidatorStatusUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum PubdataPricingMode", + "name": "validiumMode", + "type": "uint8" + } + ], + "name": "ValidiumModeStatusUpdate", + "type": "event" + }, + { + "inputs": [], + "name": "acceptAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "baseTokenGasPriceMultiplierDenominator", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseTokenGasPriceMultiplierNominator", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "contractL2", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2Value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "l2Calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "l2GasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2GasPerPubdataByteLimit", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "factoryDeps", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "refundRecipient", + "type": "address" + } + ], + "internalType": "struct BridgehubL2TransactionRequest", + "name": "_request", + "type": "tuple" + } + ], + "name": "bridgehubRequestL2Transaction", + "outputs": [ + { + "internalType": "bytes32", + "name": "canonicalTxHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" }, { - "inputs": [], - "name": "acceptGovernor", + "inputs": [ + { + "components": [ + { + "internalType": "enum PubdataPricingMode", + "name": "pubdataPricingMode", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "batchOverheadL1Gas", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxPubdataPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxL2GasPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "priorityTxMaxPubdata", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "minimalL2GasPrice", + "type": "uint64" + } + ], + "internalType": "struct FeeParams", + "name": "_newFeeParams", + "type": "tuple" + } + ], + "name": "changeFeeParams", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -617,28 +741,132 @@ { "inputs": [ { - "internalType": "bytes32", - "name": "_proposedUpgradeHash", - "type": "bytes32" + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_lastCommittedBatchData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "newStateRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "bootloaderHeapInitialContentsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "eventsQueueStateHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "systemLogs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "pubdataCommitments", + "type": "bytes" + } + ], + "internalType": "struct IExecutor.CommitBatchInfo[]", + "name": "_newBatchesData", + "type": "tuple[]" } ], - "name": "cancelUpgradeProposal", + "name": "commitBatches", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, { "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -672,15 +900,15 @@ "type": "bytes32" } ], - "internalType": "struct IExecutor.StoredBlockInfo", - "name": "_lastCommittedBlockData", + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_lastCommittedBatchData", "type": "tuple" }, { "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { @@ -705,62 +933,112 @@ }, { "internalType": "bytes32", - "name": "l2LogsTreeRoot", + "name": "priorityOperationsHash", "type": "bytes32" }, { "internalType": "bytes32", - "name": "priorityOperationsHash", + "name": "bootloaderHeapInitialContentsHash", "type": "bytes32" }, { - "internalType": "bytes", - "name": "initialStorageChanges", - "type": "bytes" + "internalType": "bytes32", + "name": "eventsQueueStateHash", + "type": "bytes32" }, { "internalType": "bytes", - "name": "repeatedStorageChanges", + "name": "systemLogs", "type": "bytes" }, { "internalType": "bytes", - "name": "l2Logs", + "name": "pubdataCommitments", "type": "bytes" + } + ], + "internalType": "struct IExecutor.CommitBatchInfo[]", + "name": "_newBatchesData", + "type": "tuple[]" + } + ], + "name": "commitBatchesSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" }, { - "internalType": "bytes[]", - "name": "l2ArbitraryLengthMessages", - "type": "bytes[]" + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" }, { - "internalType": "bytes[]", - "name": "factoryDeps", - "type": "bytes[]" + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" } ], - "internalType": "struct IExecutor.CommitBlockInfo[]", - "name": "_newBlocksData", + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_batchesData", "type": "tuple[]" } ], - "name": "commitBlocks", + "name": "executeBatches", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, { "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -794,12 +1072,12 @@ "type": "bytes32" } ], - "internalType": "struct IExecutor.StoredBlockInfo[]", - "name": "_blocksData", + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_batchesData", "type": "tuple[]" } ], - "name": "executeBlocks", + "name": "executeBatchesSharedBridge", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -849,11 +1127,6 @@ "internalType": "struct Diamond.DiamondCutData", "name": "_diamondCut", "type": "tuple" - }, - { - "internalType": "bytes32", - "name": "_proposalSalt", - "type": "bytes32" } ], "name": "executeUpgrade", @@ -941,7 +1214,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -951,7 +1224,7 @@ }, { "internalType": "uint16", - "name": "_l2TxNumberInBlock", + "name": "_l2TxNumberInBatch", "type": "uint16" }, { @@ -979,7 +1252,7 @@ }, { "inputs": [], - "name": "getAllowList", + "name": "getAdmin", "outputs": [ { "internalType": "address", @@ -992,12 +1265,12 @@ }, { "inputs": [], - "name": "getCurrentProposalId", + "name": "getBaseToken", "outputs": [ { - "internalType": "uint256", + "internalType": "address", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -1005,12 +1278,12 @@ }, { "inputs": [], - "name": "getFirstUnprocessedPriorityTx", + "name": "getBaseTokenBridge", "outputs": [ { - "internalType": "uint256", + "internalType": "address", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -1018,7 +1291,7 @@ }, { "inputs": [], - "name": "getGovernor", + "name": "getBridgehub", "outputs": [ { "internalType": "address", @@ -1029,6 +1302,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getFirstUnprocessedPriorityTx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getL2BootloaderBytecodeHash", @@ -1057,12 +1343,12 @@ }, { "inputs": [], - "name": "getPendingGovernor", + "name": "getL2SystemContractsUpgradeBatchNumber", "outputs": [ { - "internalType": "address", + "internalType": "uint256", "name": "", - "type": "address" + "type": "uint256" } ], "stateMutability": "view", @@ -1070,12 +1356,12 @@ }, { "inputs": [], - "name": "getPriorityQueueSize", + "name": "getL2SystemContractsUpgradeTxHash", "outputs": [ { - "internalType": "uint256", + "internalType": "bytes32", "name": "", - "type": "uint256" + "type": "bytes32" } ], "stateMutability": "view", @@ -1083,12 +1369,12 @@ }, { "inputs": [], - "name": "getPriorityTxMaxGasLimit", + "name": "getName", "outputs": [ { - "internalType": "uint256", + "internalType": "string", "name": "", - "type": "uint256" + "type": "string" } ], "stateMutability": "view", @@ -1096,12 +1382,12 @@ }, { "inputs": [], - "name": "getProposedUpgradeHash", + "name": "getPendingAdmin", "outputs": [ { - "internalType": "bytes32", + "internalType": "address", "name": "", - "type": "bytes32" + "type": "address" } ], "stateMutability": "view", @@ -1109,7 +1395,7 @@ }, { "inputs": [], - "name": "getProposedUpgradeTimestamp", + "name": "getPriorityQueueSize", "outputs": [ { "internalType": "uint256", @@ -1122,12 +1408,12 @@ }, { "inputs": [], - "name": "getSecurityCouncil", + "name": "getPriorityTxMaxGasLimit", "outputs": [ { - "internalType": "address", + "internalType": "uint256", "name": "", - "type": "address" + "type": "uint256" } ], "stateMutability": "view", @@ -1135,7 +1421,7 @@ }, { "inputs": [], - "name": "getTotalBlocksCommitted", + "name": "getProtocolVersion", "outputs": [ { "internalType": "uint256", @@ -1148,7 +1434,33 @@ }, { "inputs": [], - "name": "getTotalBlocksExecuted", + "name": "getPubdataPricingMode", + "outputs": [ + { + "internalType": "enum PubdataPricingMode", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStateTransitionManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalBatchesCommitted", "outputs": [ { "internalType": "uint256", @@ -1161,7 +1473,7 @@ }, { "inputs": [], - "name": "getTotalBlocksVerified", + "name": "getTotalBatchesExecuted", "outputs": [ { "internalType": "uint256", @@ -1174,7 +1486,7 @@ }, { "inputs": [], - "name": "getTotalPriorityTxs", + "name": "getTotalBatchesVerified", "outputs": [ { "internalType": "uint256", @@ -1187,12 +1499,12 @@ }, { "inputs": [], - "name": "getUpgradeProposalState", + "name": "getTotalPriorityTxs", "outputs": [ { - "internalType": "enum UpgradeState", + "internalType": "uint256", "name": "", - "type": "uint8" + "type": "uint256" } ], "stateMutability": "view", @@ -1241,19 +1553,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isApprovedBySecurityCouncil", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "isDiamondStorageFrozen", @@ -1271,7 +1570,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -1352,7 +1651,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_blockNumber", + "name": "_batchNumber", "type": "uint256" } ], @@ -1360,7 +1659,7 @@ "outputs": [ { "internalType": "bytes32", - "name": "hash", + "name": "merkleRoot", "type": "bytes32" } ], @@ -1429,90 +1728,139 @@ { "inputs": [ { - "internalType": "bytes32", - "name": "_proposalHash", - "type": "bytes32" + "components": [ + { + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_prevBatch", + "type": "tuple" }, - { - "internalType": "uint40", - "name": "_proposalId", - "type": "uint40" - } - ], - "name": "proposeShadowUpgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ { "components": [ { - "components": [ - { - "internalType": "address", - "name": "facet", - "type": "address" - }, - { - "internalType": "enum Diamond.Action", - "name": "action", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isFreezable", - "type": "bool" - }, - { - "internalType": "bytes4[]", - "name": "selectors", - "type": "bytes4[]" - } - ], - "internalType": "struct Diamond.FacetCut[]", - "name": "facetCuts", - "type": "tuple[]" + "internalType": "uint64", + "name": "batchNumber", + "type": "uint64" }, { - "internalType": "address", - "name": "initAddress", - "type": "address" + "internalType": "bytes32", + "name": "batchHash", + "type": "bytes32" }, { - "internalType": "bytes", - "name": "initCalldata", - "type": "bytes" + "internalType": "uint64", + "name": "indexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "numberOfLayer1Txs", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "priorityOperationsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l2LogsTreeRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" } ], - "internalType": "struct Diamond.DiamondCutData", - "name": "_diamondCut", - "type": "tuple" + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_committedBatches", + "type": "tuple[]" }, { - "internalType": "uint40", - "name": "_proposalId", - "type": "uint40" + "components": [ + { + "internalType": "uint256[]", + "name": "recursiveAggregationInput", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "serializedProof", + "type": "uint256[]" + } + ], + "internalType": "struct IExecutor.ProofInput", + "name": "_proof", + "type": "tuple" } ], - "name": "proposeTransparentUpgrade", + "name": "proveBatches", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, { "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -1546,20 +1894,20 @@ "type": "bytes32" } ], - "internalType": "struct IExecutor.StoredBlockInfo", - "name": "_prevBlock", + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_prevBatch", "type": "tuple" }, { "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -1593,8 +1941,8 @@ "type": "bytes32" } ], - "internalType": "struct IExecutor.StoredBlockInfo[]", - "name": "_committedBlocks", + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_committedBatches", "type": "tuple[]" }, { @@ -1615,7 +1963,7 @@ "type": "tuple" } ], - "name": "proveBlocks", + "name": "proveBatchesSharedBridge", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1629,7 +1977,7 @@ }, { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -1639,7 +1987,7 @@ }, { "internalType": "uint16", - "name": "_l2TxNumberInBlock", + "name": "_l2TxNumberInBatch", "type": "uint16" }, { @@ -1668,7 +2016,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_blockNumber", + "name": "_batchNumber", "type": "uint256" }, { @@ -1690,7 +2038,7 @@ }, { "internalType": "uint16", - "name": "txNumberInBlock", + "name": "txNumberInBatch", "type": "uint16" }, { @@ -1734,7 +2082,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_blockNumber", + "name": "_batchNumber", "type": "uint256" }, { @@ -1746,7 +2094,7 @@ "components": [ { "internalType": "uint16", - "name": "txNumberInBlock", + "name": "txNumberInBatch", "type": "uint16" }, { @@ -1834,11 +2182,11 @@ "inputs": [ { "internalType": "uint256", - "name": "_newLastBlock", + "name": "_newLastBatch", "type": "uint256" } ], - "name": "revertBlocks", + "name": "revertBatches", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1846,12 +2194,17 @@ { "inputs": [ { - "internalType": "bytes32", - "name": "_upgradeProposalHash", - "type": "bytes32" + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_newLastBatch", + "type": "uint256" } ], - "name": "securityCouncilUpgradeApprove", + "name": "revertBatchesSharedBridge", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1859,12 +2212,12 @@ { "inputs": [ { - "internalType": "contract IAllowList", - "name": "_newAllowList", + "internalType": "address", + "name": "_newPendingAdmin", "type": "address" } ], - "name": "setAllowList", + "name": "setPendingAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1872,12 +2225,12 @@ { "inputs": [ { - "internalType": "bytes32", - "name": "_l2BootloaderBytecodeHash", - "type": "bytes32" + "internalType": "bool", + "name": "_zkPorterIsAvailable", + "type": "bool" } ], - "name": "setL2BootloaderBytecodeHash", + "name": "setPorterAvailability", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1885,12 +2238,12 @@ { "inputs": [ { - "internalType": "bytes32", - "name": "_l2DefaultAccountBytecodeHash", - "type": "bytes32" + "internalType": "uint256", + "name": "_newPriorityTxMaxGasLimit", + "type": "uint256" } ], - "name": "setL2DefaultAccountBytecodeHash", + "name": "setPriorityTxMaxGasLimit", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1898,25 +2251,17 @@ { "inputs": [ { - "internalType": "address", - "name": "_newPendingGovernor", - "type": "address" - } - ], - "name": "setPendingGovernor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + "internalType": "uint128", + "name": "_nominator", + "type": "uint128" + }, { - "internalType": "bool", - "name": "_zkPorterIsAvailable", - "type": "bool" + "internalType": "uint128", + "name": "_denominator", + "type": "uint128" } ], - "name": "setPorterAvailability", + "name": "setTokenMultiplier", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1924,12 +2269,12 @@ { "inputs": [ { - "internalType": "uint256", - "name": "_newPriorityTxMaxGasLimit", - "type": "uint256" + "internalType": "address", + "name": "_transactionFilterer", + "type": "address" } ], - "name": "setPriorityTxMaxGasLimit", + "name": "setTransactionFilterer", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1955,42 +2300,12 @@ { "inputs": [ { - "internalType": "contract Verifier", - "name": "_newVerifier", - "type": "address" - } - ], - "name": "setVerifier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "recursionNodeLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionLeafLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionCircuitsSetVksHash", - "type": "bytes32" - } - ], - "internalType": "struct VerifierParams", - "name": "_newVerifierParams", - "type": "tuple" + "internalType": "enum PubdataPricingMode", + "name": "_validiumMode", + "type": "uint8" } ], - "name": "setVerifierParams", + "name": "setValidiumMode", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1999,11 +2314,11 @@ "inputs": [ { "internalType": "uint256", - "name": "_blockNumber", + "name": "_batchNumber", "type": "uint256" } ], - "name": "storedBlockHash", + "name": "storedBatchHash", "outputs": [ { "internalType": "bytes32", @@ -2014,6 +2329,13 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "transferEthToSharedBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "unfreezeDiamond", @@ -2023,6 +2345,11 @@ }, { "inputs": [ + { + "internalType": "uint256", + "name": "_protocolVersion", + "type": "uint256" + }, { "components": [ { @@ -2064,29 +2391,13 @@ } ], "internalType": "struct Diamond.DiamondCutData", - "name": "_diamondCut", + "name": "_cutData", "type": "tuple" - }, - { - "internalType": "uint256", - "name": "_proposalId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_salt", - "type": "bytes32" - } - ], - "name": "upgradeProposalHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" } ], - "stateMutability": "pure", + "name": "upgradeChainFromVersion", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" } ] diff --git a/src/abi/test_contracts/basic_combined.json b/abi/test_contracts/basic_combined.json similarity index 100% rename from src/abi/test_contracts/basic_combined.json rename to abi/test_contracts/basic_combined.json diff --git a/src/abi/test_contracts/counter_combined.json b/abi/test_contracts/counter_combined.json similarity index 100% rename from src/abi/test_contracts/counter_combined.json rename to abi/test_contracts/counter_combined.json diff --git a/src/abi/test_contracts/greeter_combined.json b/abi/test_contracts/greeter_combined.json similarity index 100% rename from src/abi/test_contracts/greeter_combined.json rename to abi/test_contracts/greeter_combined.json diff --git a/src/abi/test_contracts/import_combined.json b/abi/test_contracts/import_combined.json similarity index 100% rename from src/abi/test_contracts/import_combined.json rename to abi/test_contracts/import_combined.json diff --git a/src/abi/test_contracts/storage_combined.json b/abi/test_contracts/storage_combined.json similarity index 100% rename from src/abi/test_contracts/storage_combined.json rename to abi/test_contracts/storage_combined.json diff --git a/src/abi/IL1Bridge.json b/src/abi/IL1Bridge.json deleted file mode 100644 index 98e16be..0000000 --- a/src/abi/IL1Bridge.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "l1Token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ClaimedFailedDeposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "l1Token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DepositInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "l1Token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WithdrawalFinalized", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_depositSender", - "type": "address" - }, - { - "internalType": "address", - "name": "_l1Token", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_l2TxHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_l2BlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_l2MessageIndex", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "_l2TxNumberInBlock", - "type": "uint16" - }, - { - "internalType": "bytes32[]", - "name": "_merkleProof", - "type": "bytes32[]" - } - ], - "name": "claimFailedDeposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_l2Receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "_l1Token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_l2TxGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_l2TxGasPerPubdataByte", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [ - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_l2BlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_l2MessageIndex", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "_l2TxNumberInBlock", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "_message", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "_merkleProof", - "type": "bytes32[]" - } - ], - "name": "finalizeWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_l2BlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_l2MessageIndex", - "type": "uint256" - } - ], - "name": "isWithdrawalFinalized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_l1Token", - "type": "address" - } - ], - "name": "l2TokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} diff --git a/src/abi/mod.rs b/src/abi/mod.rs deleted file mode 100644 index 0cc0c5a..0000000 --- a/src/abi/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -use ethers::abi::Contract; -use std::str::FromStr; - -const L1_DEFAULT_BRIDGE_INTERFACE: &str = include_str!("./IL1Bridge.json"); - -fn load_contract(raw_abi_string: &str) -> Contract { - // Note that using `.expect` here is acceptable because this is a private function and we - // expect the value of `raw_abi_string` to be correct. In the future, we should refactor this - // piece of code to run in compile time. - #![allow(clippy::unwrap_used, clippy::expect_used)] - let abi_string = serde_json::Value::from_str(raw_abi_string) - .expect("Malformed contract abi file") - .get("abi") - .expect("Malformed contract abi file") - .to_string(); - Contract::load(abi_string.as_bytes()).unwrap() -} - -pub fn l1_bridge_contract() -> Contract { - load_contract(L1_DEFAULT_BRIDGE_INTERFACE) -} From 72e9152613f7a6e7d8e05882d529e5d0fde68db9 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:47:30 +0200 Subject: [PATCH 04/75] Remove old l1 bridge contract implementation --- src/contracts/l1_bridge_contract.rs | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 src/contracts/l1_bridge_contract.rs diff --git a/src/contracts/l1_bridge_contract.rs b/src/contracts/l1_bridge_contract.rs deleted file mode 100644 index df2d557..0000000 --- a/src/contracts/l1_bridge_contract.rs +++ /dev/null @@ -1,3 +0,0 @@ -use ethers_contract::abigen; - -abigen!(L1Bridge, "src/abi/IL1Bridge.json"); From 2dcf554ccc50d917092bb9eee0a8ec96c6d2fbba Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:49:14 +0200 Subject: [PATCH 05/75] Add types module --- Cargo.toml | 12 ++++++++++-- src/eip712/meta.rs | 4 ++-- src/lib.rs | 1 + src/types.rs | 9 +++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 src/types.rs diff --git a/Cargo.toml b/Cargo.toml index 1807963..3623098 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,11 @@ ethers-contract = "2.0.7" clap = { version = "4.2.7", features = ["derive"] } lazy_static = "1.4.0" +# ZKsync +zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_types"} +zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_web3_decl"} +zksync_system_constants = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_system_constants"} + # Async tokio = { version = "1", features = ["macros", "process"] } async-trait = "0.1.68" @@ -29,14 +34,17 @@ thiserror = "1.0.40" # Library error handling # Logging log = "0.4" -env_logger = "0.10" +env_logger = "0.11.3" # Hash -sha2 = "0.9.5" +sha2 = "0.10.8" [features] ethers-solc = ["ethers/ethers-solc"] +[dev-dependencies] +colored = "2.1.0" + # Examples [[example]] diff --git a/src/eip712/meta.rs b/src/eip712/meta.rs index a17ac9f..d3fc1fb 100644 --- a/src/eip712/meta.rs +++ b/src/eip712/meta.rs @@ -1,5 +1,5 @@ use super::{rlp_append_option, PaymasterParams}; -use crate::zks_utils::DEFAULT_GAS_PER_PUBDATA_LIMIT; +use crate::utils::REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT; use ethers::{ types::{Bytes, U256}, utils::rlp::Encodable, @@ -55,7 +55,7 @@ impl Eip712Meta { impl Default for Eip712Meta { fn default() -> Self { Self { - gas_per_pubdata: DEFAULT_GAS_PER_PUBDATA_LIMIT.into(), + gas_per_pubdata: REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT.into(), factory_deps: Default::default(), custom_signature: Default::default(), paymaster_params: Default::default(), diff --git a/src/lib.rs b/src/lib.rs index 9af470e..d3c5bd7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,6 +45,7 @@ pub mod abi; pub use ethers::*; +pub mod types; pub mod utils; pub mod contracts; diff --git a/src/types.rs b/src/types.rs new file mode 100644 index 0000000..dcb8252 --- /dev/null +++ b/src/types.rs @@ -0,0 +1,9 @@ +pub mod zksync { + pub use zksync_system_constants::*; + pub use zksync_types::*; + pub use zksync_web3_decl::types as web3_decl; +} + +pub mod ethers { + pub use ethers::types::*; +} From f4e7af3d9044eb2609d4d274dcf10160847fe1e8 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:49:37 +0200 Subject: [PATCH 06/75] Remove abi module decl from lib --- src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d3c5bd7..0e7c5b2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,8 +41,6 @@ clippy::single_char_lifetime_names )] -pub mod abi; - pub use ethers::*; pub mod types; From b24e1437dce432ad433db86e8f52e1aef2b10c00 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:50:22 +0200 Subject: [PATCH 07/75] Move tests to root dir --- src/tests/provider_tests.rs | 910 ------------------------------- src/tests/wallet_tests.rs | 619 --------------------- src/tests/mod.rs => tests/lib.rs | 0 tests/provider_tests.rs | 885 ++++++++++++++++++++++++++++++ {src/tests => tests}/utils.rs | 9 +- tests/wallet_tests.rs | 605 ++++++++++++++++++++ 6 files changed, 1494 insertions(+), 1534 deletions(-) delete mode 100644 src/tests/provider_tests.rs delete mode 100644 src/tests/wallet_tests.rs rename src/tests/mod.rs => tests/lib.rs (100%) create mode 100644 tests/provider_tests.rs rename {src/tests => tests}/utils.rs (88%) create mode 100644 tests/wallet_tests.rs diff --git a/src/tests/provider_tests.rs b/src/tests/provider_tests.rs deleted file mode 100644 index c9a6a74..0000000 --- a/src/tests/provider_tests.rs +++ /dev/null @@ -1,910 +0,0 @@ -#[cfg(test)] -mod zks_provider_tests { - use std::{collections::HashMap, fs::File, path::PathBuf, str::FromStr}; - - use crate::{ - tests::utils::*, - zks_provider::{types::TracerConfig, ZKSProvider}, - zks_wallet::{CallRequest, DeployRequest, TransferRequest, ZKSWallet}, - }; - use ethers::{ - abi::Tokenize, - providers::Middleware, - types::{Address, Bytes, H256, U256}, - }; - use serde::{Deserialize, Serialize}; - - #[tokio::test] - async fn test_provider_estimate_fee() { - let provider = era_provider(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let transaction = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); - - assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); - assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); - assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); - assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); - } - - #[tokio::test] - async fn test_provider_get_testnet_paymaster() { - let provider = era_provider(); - - assert!(provider.get_testnet_paymaster().await.is_ok()); - } - - #[tokio::test] - async fn test_provider_estimate_gas_l1_to_l2() { - let provider = era_provider(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let transaction = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); - - assert_eq!(estimated_fee, U256::from(36_768_868_u64)); - } - - #[tokio::test] - // TODO: This test is flacky. It could fail in the future. - async fn test_provider_get_all_account_balances() { - let provider = era_provider(); - let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" - .parse() - .unwrap(); - let balance = provider.get_balance(address, None).await.unwrap(); - - let balances = provider.get_all_account_balances(address).await.unwrap(); - - assert_eq!( - balances - .get( - &"0x0000000000000000000000000000000000000000" - .parse::
() - .unwrap() - ) - .unwrap() - .clone(), - balance - ); - } - - #[tokio::test] - async fn test_provider_get_block_details() { - let provider = era_provider(); - let existing_block = 1_u64; - let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; - - let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); - let non_existing_block_details = provider - .get_block_details(non_existing_block.as_u32()) - .await - .unwrap(); - - assert!(existing_block_details.is_some()); - assert!(non_existing_block_details.is_none()) - } - - #[tokio::test] - async fn test_provider_get_bridge_contracts() { - let provider = era_provider(); - - assert!(provider.get_bridge_contracts().await.is_ok()); - } - - #[tokio::test] - async fn test_provider_get_bytecode_by_hash() { - let provider = era_provider(); - let invalid_hash = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" - .parse() - .unwrap(); - let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); - let valid_hash = test_block.root_hash; - - assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); - assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); - } - - #[ignore] - #[tokio::test] - async fn test_provider_get_confirmed_tokens() { - let provider = era_provider(); - let from = 0; - let limit = 10; - - assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); - } - - // TODO: This test is flacky. It could fail in the future. - #[tokio::test] - async fn test_provider_get_l1_batch_block_range() { - let provider = era_provider(); - let batch = 1_u64; - - assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); - } - - #[tokio::test] - async fn test_provider_get_l1_batch_details() { - let provider = era_provider(); - let batch = 1_u64; - - assert!(provider.get_l1_batch_details(batch).await.is_ok()); - } - - #[tokio::test] - async fn test_provider_get_l2_to_l1_log_proof() { - let provider = era_provider(); - let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" - .parse() - .unwrap(); - - assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); - } - - // #[tokio::test] - // async fn test_provider_get_l2_to_l1_msg_proof() { - // let provider = local_provider(); - // let block = 2; - // let sender = /* create an address object */; - // let msg = /* create a hash object */; - - // assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); - // } - - #[tokio::test] - async fn test_provider_get_main_contract() { - let provider = era_provider(); - - assert!(provider.get_main_contract().await.is_ok()); - } - - // TODO: This test is flacky. It could fail in the future. We should create a - // transaction, send it, and the assert that the details match. - #[tokio::test] - async fn test_provider_get_raw_block_transactions() { - let provider = era_provider(); - let block = 1_u64; - - assert!(provider.get_raw_block_transactions(block).await.is_ok()); - } - - #[tokio::test] - async fn test_provider_get_token_price() { - let provider = era_provider(); - let address: Address = "0x0000000000000000000000000000000000000000" - .parse() - .unwrap(); - - assert!(provider.get_token_price(address).await.is_ok()); - } - - // TODO: This test is flacky. It could fail in the future. We should create a - // transaction, send it, and the assert that the details match. - #[tokio::test] - async fn test_provider_get_transaction_details() { - let provider = era_provider(); - let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); - let hash = test_block.root_hash; - - assert!(provider.get_transaction_details(hash).await.is_ok()); - } - - #[tokio::test] - async fn test_provider_get_l1_batch_number() { - let provider = era_provider(); - - assert!(provider.get_l1_batch_number().await.is_ok()); - } - - #[tokio::test] - async fn test_provider_get_l1_chain_id() { - let provider = era_provider(); - - assert!(provider.get_l1_chain_id().await.is_ok()); - } - - #[tokio::test] - async fn test_provider_debug_trace_block_by_hash() { - let provider = era_provider(); - let block_number = provider.get_block_number().await.unwrap() - 1_u64; - let test_block = provider - .get_block_details(block_number.as_u32()) - .await - .unwrap() - .unwrap(); - let hash_block = test_block.root_hash; - - let options = Some(TracerConfig { - disable_storage: None, - disable_stack: None, - enable_memory: None, - enable_return_data: None, - tracer: Some("callTracer".to_owned()), - tracer_config: Some(HashMap::from([("onlyTopCall".to_owned(), true)])), - }); - - assert!( - ZKSProvider::debug_trace_block_by_hash(&provider, hash_block, None) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_block_by_hash(&provider, hash_block, options) - .await - .is_ok() - ); - } - - #[tokio::test] - async fn test_provider_debug_trace_block_by_number() { - let provider = era_provider(); - let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; - let non_existing_block_number = existing_block_number + 100_u64; - let options = Some(TracerConfig { - disable_storage: None, - disable_stack: None, - enable_memory: None, - enable_return_data: None, - tracer: Some("callTracer".to_owned()), - tracer_config: Some(HashMap::from([("onlyTopCall".to_owned(), true)])), - }); - - assert!( - ZKSProvider::debug_trace_block_by_number(&provider, existing_block_number, None) - .await - .is_ok() - ); - assert!(ZKSProvider::debug_trace_block_by_number( - &provider, - existing_block_number, - options.clone() - ) - .await - .is_ok()); - assert!(ZKSProvider::debug_trace_block_by_number( - &provider, - non_existing_block_number, - None - ) - .await - .is_err()); - assert!(ZKSProvider::debug_trace_block_by_number( - &provider, - non_existing_block_number, - options - ) - .await - .is_err()); - } - - #[tokio::test] - async fn test_provider_debug_trace_call() { - let provider = era_provider(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let request = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let block = provider.get_block_number().await.ok(); - let options = Some(TracerConfig { - disable_storage: None, - disable_stack: None, - enable_memory: None, - enable_return_data: None, - tracer: Some("callTracer".to_owned()), - tracer_config: Some(HashMap::from([("onlyTopCall".to_owned(), true)])), - }); - - println!( - "{:?}", - ZKSProvider::debug_trace_call::<&TestTransaction, u64>(&provider, &request, None, None) - .await - ); - - assert!(ZKSProvider::debug_trace_call::<&TestTransaction, u64>( - &provider, &request, None, None - ) - .await - .is_ok()); - assert!( - ZKSProvider::debug_trace_call(&provider, &request, block, None) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_call(&provider, &request, block, options.clone()) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_call::<_, u64>(&provider, request, None, options) - .await - .is_ok() - ); - } - - // TODO: This test is flacky. It could fail in the future. - #[tokio::test] - async fn test_provider_debug_trace_transaction() { - let era_provider = era_provider(); - let zk_wallet = - ZKSWallet::new(local_wallet(), None, Some(era_provider.clone()), None).unwrap(); - - let transfer_request = TransferRequest::new(1_u64.into()) - .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) - .from(zk_wallet.l2_address()); - let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); - let invalid_transaction_hash: H256 = - "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" - .parse() - .unwrap(); - - let options = Some(TracerConfig { - disable_storage: None, - disable_stack: None, - enable_memory: None, - enable_return_data: None, - tracer: Some("callTracer".to_owned()), - tracer_config: Some(HashMap::from([("onlyTopCall".to_owned(), true)])), - }); - - assert!( - ZKSProvider::debug_trace_transaction(&era_provider, transaction_hash, None) - .await - .is_ok() - ); - assert!(ZKSProvider::debug_trace_transaction( - &era_provider, - transaction_hash, - options.clone() - ) - .await - .is_ok()); - assert!(ZKSProvider::debug_trace_transaction( - &era_provider, - invalid_transaction_hash, - None - ) - .await - .is_err()); - assert!(ZKSProvider::debug_trace_transaction( - &era_provider, - invalid_transaction_hash, - options - ) - .await - .is_err()); - } - - #[tokio::test] - async fn test_signer_estimate_fee() { - let provider = era_signer(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let transaction = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); - - assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); - assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); - assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); - assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); - } - - #[tokio::test] - async fn test_signer_get_testnet_paymaster() { - let provider = era_signer(); - - assert!(provider.get_testnet_paymaster().await.is_ok()); - } - - #[tokio::test] - async fn test_signer_estimate_gas_l1_to_l2() { - let provider = era_signer(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let transaction = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); - - assert_eq!(estimated_fee, U256::from(36_768_868_u32)); - } - - #[tokio::test] - // TODO: This test is flacky. It could fail in the future. - async fn test_signer_get_all_account_balances() { - let provider = era_signer(); - let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" - .parse() - .unwrap(); - let balance = provider.get_balance(address, None).await.unwrap(); - - let balances = provider.get_all_account_balances(address).await.unwrap(); - - assert_eq!( - balances - .get( - &"0x0000000000000000000000000000000000000000" - .parse::
() - .unwrap() - ) - .unwrap() - .clone(), - balance - ); - } - - #[tokio::test] - async fn test_signer_get_block_details() { - let provider = era_signer(); - let existing_block = 1_u64; - let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; - - let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); - let non_existing_block_details = provider - .get_block_details(non_existing_block.as_u32()) - .await - .unwrap(); - - assert!(existing_block_details.is_some()); - assert!(non_existing_block_details.is_none()) - } - - #[tokio::test] - async fn test_signer_get_bridge_contracts() { - let provider = era_signer(); - - assert!(provider.get_bridge_contracts().await.is_ok()); - } - - #[tokio::test] - async fn test_signer_get_bytecode_by_hash() { - let provider = era_signer(); - let invalid_hash = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" - .parse() - .unwrap(); - let valid_hash: H256 = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" - .parse() - .unwrap(); - - assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); - assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); - } - - #[ignore] - #[tokio::test] - async fn test_signer_get_confirmed_tokens() { - let provider = era_signer(); - let from = 0; - let limit = 10; - - assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); - } - - // TODO: This test is flacky. It could fail in the future. - #[tokio::test] - async fn test_signer_get_l1_batch_block_range() { - let provider = era_signer(); - let batch = 1_u64; - - assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); - } - - #[tokio::test] - async fn test_signer_get_l1_batch_details() { - let provider = era_signer(); - let batch = 1_u64; - - assert!(provider.get_l1_batch_details(batch).await.is_ok()); - } - - #[tokio::test] - async fn test_signer_get_l2_to_l1_log_proof() { - let provider = era_signer(); - let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" - .parse() - .unwrap(); - - assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); - } - - // #[tokio::test] - // async fn test_signer_get_l2_to_l1_msg_proof() { - // let provider = local_signer(); - // let block = 2; - // let sender = /* create an address object */; - // let msg = /* create a hash object */; - - // assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); - // } - - #[tokio::test] - async fn test_signer_get_main_contract() { - let provider = era_signer(); - - assert!(provider.get_main_contract().await.is_ok()); - } - - // TODO: This test is flacky. It could fail in the future. We should create a - // transaction, send it, and the assert that the details match. - #[tokio::test] - async fn test_signer_get_raw_block_transactions() { - let provider = era_signer(); - let block = 1_u64; - - assert!(provider.get_raw_block_transactions(block).await.is_ok()); - } - - #[tokio::test] - async fn test_signer_get_token_price() { - let provider = era_signer(); - let address: Address = "0x0000000000000000000000000000000000000000" - .parse() - .unwrap(); - - assert!(provider.get_token_price(address).await.is_ok()); - } - - // TODO: This test is flacky. It could fail in the future. We should create a - // transaction, send it, and the assert that the details match. - #[tokio::test] - async fn test_signer_get_transaction_details() { - let provider = era_signer(); - let hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" - .parse() - .unwrap(); - - assert!(provider.get_transaction_details(hash).await.is_ok()); - } - - #[tokio::test] - async fn test_signer_get_l1_batch_number() { - let provider = era_signer(); - - assert!(provider.get_l1_batch_number().await.is_ok()); - } - - #[tokio::test] - async fn test_signer_get_l1_chain_id() { - let provider = era_signer(); - - assert!(provider.get_l1_chain_id().await.is_ok()); - } - - #[tokio::test] - async fn test_signer_debug_trace_block_by_hash() { - let provider = era_signer(); - let block_number = provider.get_block_number().await.unwrap() - 1_u64; - let test_block = provider - .get_block_details(block_number.as_u32()) - .await - .unwrap() - .unwrap(); - let hash = test_block.root_hash; - - let options = Some(TracerConfig { - disable_storage: None, - disable_stack: None, - enable_memory: None, - enable_return_data: None, - tracer: Some("callTracer".to_owned()), - tracer_config: Some(HashMap::from([("onlyTopCall".to_owned(), true)])), - }); - - assert!( - ZKSProvider::debug_trace_block_by_hash(&provider, hash, None) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_block_by_hash(&provider, hash, options) - .await - .is_ok() - ); - } - - #[tokio::test] - async fn test_signer_debug_trace_block_by_number() { - let provider = era_signer(); - let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; - let non_existing_block_number = existing_block_number + 100_u64; - let options = Some(TracerConfig { - disable_storage: None, - disable_stack: None, - enable_memory: None, - enable_return_data: None, - tracer: Some("callTracer".to_owned()), - tracer_config: Some(HashMap::from([("onlyTopCall".to_owned(), true)])), - }); - - assert!( - ZKSProvider::debug_trace_block_by_number(&provider, existing_block_number, None) - .await - .is_ok() - ); - assert!(ZKSProvider::debug_trace_block_by_number( - &provider, - existing_block_number, - options.clone() - ) - .await - .is_ok()); - assert!(ZKSProvider::debug_trace_block_by_number( - &provider, - non_existing_block_number, - None - ) - .await - .is_err()); - assert!(ZKSProvider::debug_trace_block_by_number( - &provider, - non_existing_block_number, - options - ) - .await - .is_err()); - } - - #[tokio::test] - async fn test_signer_debug_trace_call() { - let provider = era_signer(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let request = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let block = provider.get_block_number().await.ok(); - let options = Some(TracerConfig { - disable_storage: None, - disable_stack: None, - enable_memory: None, - enable_return_data: None, - tracer: Some("callTracer".to_owned()), - tracer_config: Some(HashMap::from([("onlyTopCall".to_owned(), true)])), - }); - - assert!( - ZKSProvider::debug_trace_call::<_, u64>(&provider, &request, None, None) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_call(&provider, &request, block, None) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_call(&provider, &request, block, options.clone()) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_call::<_, u64>(&provider, request, None, options) - .await - .is_ok() - ); - } - - #[tokio::test] - async fn test_signer_debug_trace_transaction() { - let era_signer = era_signer(); - let zk_wallet = - ZKSWallet::new(local_wallet(), None, Some(era_signer.clone()), None).unwrap(); - - let transfer_request = TransferRequest::new(1_u64.into()) - .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) - .from(zk_wallet.l2_address()); - let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); - let invalid_transaction_hash: H256 = - "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" - .parse() - .unwrap(); - - let options = Some(TracerConfig { - disable_storage: None, - disable_stack: None, - enable_memory: None, - enable_return_data: None, - tracer: Some("callTracer".to_owned()), - tracer_config: Some(HashMap::from([("onlyTopCall".to_owned(), true)])), - }); - - assert!( - ZKSProvider::debug_trace_transaction(&era_signer, transaction_hash, None) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_transaction(&era_signer, transaction_hash, options) - .await - .is_ok() - ); - assert!( - ZKSProvider::debug_trace_transaction(&era_signer, invalid_transaction_hash, None) - .await - .is_err() - ); - } - - #[tokio::test] - async fn test_send_function_with_arguments() { - // Deploying a test contract - let era_provider = era_provider(); - let wallet = local_wallet(); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/storage_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = - DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["0".to_owned()]) - .from(zk_wallet.l2_address()); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let call_request = CallRequest::new(contract_address, "getValue()(uint256)".to_owned()); - let initial_value = ZKSProvider::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!(initial_value, U256::from(0_i32).into_tokens()); - - let value_to_set = String::from("10"); - era_provider - .send_eip712( - &zk_wallet.l2_wallet, - contract_address, - "setValue(uint256)", - Some([value_to_set.clone()].into()), - None, - ) - .await - .unwrap() - .await - .unwrap() - .unwrap(); - let set_value = ZKSProvider::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!( - set_value, - U256::from(value_to_set.parse::().unwrap()).into_tokens() - ); - - era_provider - .send_eip712( - &zk_wallet.l2_wallet, - contract_address, - "incrementValue()", - None, - None, - ) - .await - .unwrap() - .await - .unwrap() - .unwrap(); - let incremented_value = ZKSProvider::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!( - incremented_value, - (value_to_set.parse::().unwrap() + 1_u64).into_tokens() - ); - } - - #[tokio::test] - async fn test_call_view_function_with_no_parameters() { - // Deploying a test contract - let era_provider = era_provider(); - let wallet = local_wallet(); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/basic_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let call_request = CallRequest::new(contract_address, "str_out()(string)".to_owned()); - let output = ZKSProvider::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!(output, String::from("Hello World!").into_tokens()); - } - - #[tokio::test] - async fn test_call_view_function_with_arguments() { - // Deploying a test contract - let era_provider = era_provider(); - let wallet = local_wallet(); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/basic_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]) - .from(zk_wallet.l2_address()); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let call_request = CallRequest::new(contract_address, "plus_one(uint256)".to_owned()) - .function_parameters(vec!["1".to_owned()]); - let no_return_type_output = ZKSProvider::call(&era_provider, &call_request) - .await - .unwrap(); - - let call_request = call_request.function_signature("plus_one(uint256)(uint256)".to_owned()); - let known_return_type_output = ZKSProvider::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!( - no_return_type_output, - Bytes::from([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2 - ]) - .into_tokens() - ); - assert_eq!(known_return_type_output, U256::from(2_u64).into_tokens()); - } -} diff --git a/src/tests/wallet_tests.rs b/src/tests/wallet_tests.rs deleted file mode 100644 index a4893dc..0000000 --- a/src/tests/wallet_tests.rs +++ /dev/null @@ -1,619 +0,0 @@ -mod zks_signer_tests { - use crate::tests::utils::*; - use crate::zks_provider::ZKSProvider; - use crate::zks_utils::{ERA_CHAIN_ID, ETH_CHAIN_ID}; - use crate::zks_wallet::{ - CallRequest, DeployRequest, DepositRequest, TransferRequest, WithdrawRequest, ZKSWallet, - }; - use ethers::abi::Tokenize; - use ethers::contract::abigen; - use ethers::providers::Middleware; - use ethers::signers::{LocalWallet, Signer}; - use ethers::types::Address; - use ethers::types::U256; - use ethers::utils::parse_units; - use std::fs::File; - use std::path::PathBuf; - use std::str::FromStr; - use std::sync::Arc; - - abigen!( - ERC20Token, - r#"[ - balanceOf(address)(uint256) - ]"# - ); - - #[tokio::test] - async fn test_transfer() { - let sender_private_key = - "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" - .parse() - .unwrap(); - let amount_to_transfer: U256 = 1_i32.into(); - - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(sender_private_key) - .unwrap() - .with_chain_id(ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let sender_balance_before = era_provider - .get_balance(zk_wallet.l2_address(), None) - .await - .unwrap(); - let receiver_balance_before = era_provider - .get_balance(receiver_address, None) - .await - .unwrap(); - - println!("Sender balance before: {sender_balance_before}"); - println!("Receiver balance before: {receiver_balance_before}"); - - let request = TransferRequest::new(amount_to_transfer) - .to(receiver_address) - .from(zk_wallet.l2_address()); - let tx_hash = zk_wallet.transfer(&request, None).await.unwrap(); - - let receipt = era_provider - .get_transaction_receipt(tx_hash) - .await - .unwrap() - .unwrap(); - - assert_eq!(receipt.from, zk_wallet.l2_address()); - assert_eq!(receipt.to.unwrap(), receiver_address); - - let sender_balance_after = era_provider - .get_balance(zk_wallet.l2_address(), None) - .await - .unwrap(); - let receiver_balance_after = era_provider - .get_balance(receiver_address, None) - .await - .unwrap(); - - println!("Sender balance after: {sender_balance_after}"); - println!("Receiver balance after: {receiver_balance_after}"); - - assert_eq!( - sender_balance_after, - sender_balance_before - - (amount_to_transfer - + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) - ); - assert_eq!( - receiver_balance_after, - receiver_balance_before + amount_to_transfer - ); - } - - #[tokio::test] - async fn test_deposit() { - let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let request = DepositRequest::new(parse_units("0.01", "ether").unwrap().into()); - println!("Amount: {}", request.amount); - - let l1_provider = eth_provider(); - let l2_provider = era_provider(); - let wallet = LocalWallet::from_str(private_key) - .unwrap() - .with_chain_id(ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new( - wallet, - None, - Some(l2_provider.clone()), - Some(l1_provider.clone()), - ) - .unwrap(); - - let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_before = zk_wallet.era_balance().await.unwrap(); - println!("L1 balance before: {l1_balance_before}"); - println!("L2 balance before: {l2_balance_before}"); - - let tx_hash = zk_wallet.deposit(&request).await.unwrap(); - let receipt = l1_provider - .get_transaction_receipt(tx_hash) - .await - .unwrap() - .unwrap(); - assert_eq!(receipt.status.unwrap(), 1_u8.into()); - - let _l2_receipt = l2_provider - .get_transaction_receipt(receipt.transaction_hash) - .await - .unwrap(); - - let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_after = zk_wallet.era_balance().await.unwrap(); - println!("L1 balance after: {l1_balance_after}"); - println!("L2 balance after: {l2_balance_after}"); - - assert!( - l1_balance_after <= l1_balance_before - request.amount(), - "Balance on L1 should be decreased" - ); - assert!( - l2_balance_after >= l2_balance_before + request.amount(), - "Balance on L2 should be increased" - ); - } - - #[tokio::test] - async fn test_deposit_to_another_address() { - let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let to: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" - .parse() - .unwrap(); - let amount = parse_units("0.01", "ether").unwrap().into(); - println!("Amount: {amount}"); - - let request = DepositRequest::new(amount).to(to); - - let l1_provider = eth_provider(); - let l2_provider = era_provider(); - let wallet = LocalWallet::from_str(private_key).unwrap(); - let zk_wallet = ZKSWallet::new( - wallet, - None, - Some(l2_provider.clone()), - Some(l1_provider.clone()), - ) - .unwrap(); - - let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_before = era_provider().get_balance(to, None).await.unwrap(); - println!("L1 balance before: {l1_balance_before}"); - println!("L2 balance before: {l2_balance_before}"); - - let tx_hash = zk_wallet.deposit(&request).await.unwrap(); - let receipt = l1_provider - .get_transaction_receipt(tx_hash) - .await - .unwrap() - .unwrap(); - assert_eq!(receipt.status.unwrap(), 1_u8.into()); - - let _l2_receipt = l2_provider - .get_transaction_receipt(receipt.transaction_hash) - .await - .unwrap(); - - let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_after = era_provider().get_balance(to, None).await.unwrap(); - println!("L1 balance after: {l1_balance_after}"); - println!("L2 balance after: {l2_balance_after}"); - - assert!( - l1_balance_after <= l1_balance_before - request.amount(), - "Balance on L1 should be decreased" - ); - assert!( - l2_balance_after >= l2_balance_before + request.amount(), - "Balance on L2 should be increased" - ); - } - - #[ignore = "FIXME Implement a fixture that deploys an ERC20 token"] - #[tokio::test] - async fn test_deposit_erc20_token() { - let amount: U256 = 1_i32.into(); - let private_key = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; - let l1_provider = eth_provider(); - let l2_provider = era_provider(); - let wallet = LocalWallet::from_str(private_key).unwrap(); - let zk_wallet = ZKSWallet::new( - wallet, - None, - Some(l2_provider.clone()), - Some(l1_provider.clone()), - ) - .unwrap(); - - let token_l1_address: Address = "0xc8F8cE6491227a6a2Ab92e67a64011a4Eba1C6CF" - .parse() - .unwrap(); - - let contract_l1 = ERC20Token::new(token_l1_address, Arc::new(l1_provider.clone())); - - let balance_erc20_l1_before: U256 = contract_l1 - .balance_of(zk_wallet.l1_address()) - .call() - .await - .unwrap(); - - let request = DepositRequest::new(amount).token(Some(token_l1_address)); - - let l1_tx_hash = zk_wallet.deposit(&request).await.unwrap(); - let l1_receipt = zk_wallet - .get_eth_provider() - .unwrap() - .get_transaction_receipt(l1_tx_hash) - .await - .unwrap() - .unwrap(); - assert_eq!(l1_receipt.status.unwrap(), 1_i32.into()); - - let balance_erc20_l1_after: U256 = contract_l1 - .balance_of(zk_wallet.l1_address()) - .call() - .await - .unwrap(); - - assert_eq!(balance_erc20_l1_after, balance_erc20_l1_before - amount); - // FIXME check balance on l2. - } - - #[tokio::test] - async fn test_transfer_eip712() { - let sender_private_key = - "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" - .parse() - .unwrap(); - let amount_to_transfer: U256 = 1_i32.into(); - - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(sender_private_key) - .unwrap() - .with_chain_id(ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let sender_balance_before = era_provider - .get_balance(zk_wallet.l2_address(), None) - .await - .unwrap(); - let receiver_balance_before = era_provider - .get_balance(receiver_address, None) - .await - .unwrap(); - - println!("Sender balance before: {sender_balance_before}"); - println!("Receiver balance before: {receiver_balance_before}"); - - let transfer_request = TransferRequest::new(amount_to_transfer) - .to(receiver_address) - .from(zk_wallet.l2_address()); - let tx_hash = zk_wallet - .transfer_eip712(&transfer_request, None) - .await - .unwrap(); - - let receipt = era_provider - .get_transaction_receipt(tx_hash) - .await - .unwrap() - .unwrap(); - assert_eq!(receipt.from, zk_wallet.l2_address()); - assert_eq!(receipt.to.unwrap(), receiver_address); - - let sender_balance_after = era_provider - .get_balance(zk_wallet.l2_address(), None) - .await - .unwrap(); - let receiver_balance_after = era_provider - .get_balance(receiver_address, None) - .await - .unwrap(); - - println!("Sender balance after: {sender_balance_after}"); - println!("Receiver balance after: {receiver_balance_after}"); - - assert_eq!( - sender_balance_after, - sender_balance_before - - (amount_to_transfer - + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) - ); - assert_eq!( - receiver_balance_after, - receiver_balance_before + amount_to_transfer - ); - } - - #[tokio::test] - async fn test_deploy_contract_with_constructor_arg_uint() { - let deployer_private_key = - "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(deployer_private_key) - .unwrap() - .with_chain_id(ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/storage_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = - DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["10".to_owned()]) - .from(zk_wallet.l2_address()); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let deploy_result = era_provider.get_code(contract_address, None).await; - - assert!(deploy_result.is_ok()); - } - - #[tokio::test] - async fn test_deploy_contract_with_constructor_arg_string() { - let deployer_private_key = - "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(deployer_private_key) - .unwrap() - .with_chain_id(ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/greeter_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = - DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["Hey".to_owned()]) - .from(zk_wallet.l2_address()); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let deploy_result = era_provider.get_code(contract_address, None).await; - - assert!(deploy_result.is_ok()); - } - - #[tokio::test] - async fn test_deploy_contract_with_import() { - let deployer_private_key = - "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(deployer_private_key) - .unwrap() - .with_chain_id(ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - // Deploy imported contract first. - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/counter_combined.json"); - let counter_contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = - DeployRequest::with(counter_contract.abi, counter_contract.bin.to_vec(), vec![]) - .from(zk_wallet.l2_address()); - let counter_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let deploy_result = era_provider.get_code(counter_contract_address, None).await; - - assert!(deploy_result.is_ok()); - - // Deploy another contract that imports the previous one. - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/import_combined.json"); - - let import_contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = DeployRequest::with( - import_contract.abi, - import_contract.bin.to_vec(), - vec![format!("{counter_contract_address:?}")], - ) - .from(zk_wallet.l2_address()); - let import_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let call_request = CallRequest::new( - import_contract_address, - "getCounterValue()(uint256)".to_owned(), - ); - let value = ZKSProvider::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!(value, U256::from(0_u64).into_tokens()); - } - - #[tokio::test] - async fn test_withdraw_to_same_address() { - let sender_private_key = - "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let wallet = LocalWallet::from_str(sender_private_key) - .unwrap() - .with_chain_id(ERA_CHAIN_ID); - let zk_wallet = - ZKSWallet::new(wallet, None, Some(era_provider()), Some(eth_provider())).unwrap(); - - // See balances before withdraw - let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_before = zk_wallet.era_balance().await.unwrap(); - - println!("Balance on L1 before withdrawal: {l1_balance_before}"); - println!("Balance on L2 before withdrawal: {l2_balance_before}"); - - // Withdraw - let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); - - let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); - let tx_hash = zk_wallet.withdraw(&withdraw_request).await.unwrap(); - let tx_receipt = zk_wallet - .get_era_provider() - .unwrap() - .wait_for_finalize(tx_hash, None, None) - .await - .unwrap(); - assert_eq!( - 1, - tx_receipt.status.unwrap().as_u64(), - "Check that transaction in L2 is successful" - ); - - println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); - - let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); - let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); - - assert_eq!( - l2_balance_after_withdraw, - l2_balance_before - - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), - "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" - ); - - assert_eq!( - l1_balance_before, l1_balance_after_withdraw, - "Check that L1 balance has not changed" - ); - - let tx_finalize_hash = zk_wallet.finalize_withdraw(tx_hash).await.unwrap(); - - let tx_finalize_receipt = zk_wallet - .get_eth_provider() - .unwrap() - .get_transaction_receipt(tx_finalize_hash) - .await - .unwrap() - .unwrap(); - println!( - "L1 Transaction hash: {:?}", - tx_finalize_receipt.transaction_hash - ); - - assert_eq!( - 1, - tx_finalize_receipt.status.unwrap().as_u64(), - "Check that transaction in L1 is successful" - ); - - // See balances after withdraw - let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); - - println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); - println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); - - assert_eq!( - l2_balance_after_finalize, l2_balance_after_withdraw, - "Check that L2 balance after finalize has decreased by the used gas" - ); - - assert_ne!( - l1_balance_after_finalize, l1_balance_before, - "Check that L1 balance after finalize is not the same" - ); - assert_eq!( - l1_balance_after_finalize, - l1_balance_before - + (amount_to_withdraw - - tx_finalize_receipt.effective_gas_price.unwrap() - * tx_finalize_receipt.gas_used.unwrap()), - "Check that L1 balance after finalize has increased by the amount" - ); - } - - #[tokio::test] - async fn test_withdraw_to_other_address() { - let sender_private_key = - "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let receiver_private_key = - "0xe667e57a9b8aaa6709e51ff7d093f1c5b73b63f9987e4ab4aa9a5c699e024ee8"; - let l2_wallet = LocalWallet::from_str(sender_private_key) - .unwrap() - .with_chain_id(ERA_CHAIN_ID); - - let l1_wallet = LocalWallet::from_str(receiver_private_key) - .unwrap() - .with_chain_id(ETH_CHAIN_ID); - let zk_wallet = ZKSWallet::new( - l2_wallet, - Some(l1_wallet), - Some(era_provider()), - Some(eth_provider()), - ) - .unwrap(); - - // See balances before withdraw - let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_before = zk_wallet.era_balance().await.unwrap(); - - println!("Balance on L1 before withdrawal: {l1_balance_before}"); - println!("Balance on L2 before withdrawal: {l2_balance_before}"); - - // Withdraw - let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); - let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); - let tx_receipt = zk_wallet.withdraw(&withdraw_request).await.unwrap(); - let tx_receipt = zk_wallet - .get_era_provider() - .unwrap() - .wait_for_finalize(tx_receipt, None, None) - .await - .unwrap(); - assert_eq!( - 1, - tx_receipt.status.unwrap().as_u64(), - "Check that transaction in L2 is successful" - ); - - println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); - - let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); - let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); - - assert_eq!( - l2_balance_after_withdraw, - l2_balance_before - - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), - "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" - ); - - assert_eq!( - l1_balance_before, l1_balance_after_withdraw, - "Check that L1 balance has not changed" - ); - - let tx_finalize_hash = zk_wallet - .finalize_withdraw(tx_receipt.transaction_hash) - .await - .unwrap(); - - let tx_finalize_receipt = zk_wallet - .get_eth_provider() - .unwrap() - .get_transaction_receipt(tx_finalize_hash) - .await - .unwrap() - .unwrap(); - println!( - "L1 Transaction hash: {:?}", - tx_finalize_receipt.transaction_hash - ); - - assert_eq!( - 1, - tx_finalize_receipt.status.unwrap().as_u64(), - "Check that transaction in L1 is successful" - ); - - // See balances after withdraw - let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); - - println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); - println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); - - assert_eq!( - l2_balance_after_finalize, l2_balance_after_withdraw, - "Check that L2 balance after finalize has decreased by the used gas" - ); - - assert_ne!( - l1_balance_after_finalize, l1_balance_before, - "Check that L1 balance after finalize is not the same" - ); - assert_eq!( - l1_balance_after_finalize, - l1_balance_before - + (amount_to_withdraw - - tx_finalize_receipt.effective_gas_price.unwrap() - * tx_finalize_receipt.gas_used.unwrap()), - "Check that L1 balance after finalize has increased by the amount" - ); - } -} diff --git a/src/tests/mod.rs b/tests/lib.rs similarity index 100% rename from src/tests/mod.rs rename to tests/lib.rs diff --git a/tests/provider_tests.rs b/tests/provider_tests.rs new file mode 100644 index 0000000..bd383d8 --- /dev/null +++ b/tests/provider_tests.rs @@ -0,0 +1,885 @@ +use ethers::{ + abi::Tokenize, + providers::Middleware, + types::{Address, Bytes, H256, U256}, +}; +use serde::{Deserialize, Serialize}; +use std::{fs::File, path::PathBuf, str::FromStr}; +use zksync_ethers_rs::{ + types::zksync::api::{CallTracerConfig, SupportedTracers, TracerConfig}, + zk_middleware::ZKMiddleware, + zks_wallet::{DeployRequest, TransferRequest, ZKSWallet}, +}; + +#[tokio::test] +async fn test_provider_estimate_fee() { + let provider = era_provider(); + #[derive(Serialize, Deserialize, Debug)] + struct TestTransaction { + from: String, + to: String, + data: String, + } + + let transaction = TestTransaction { + from: "0x1111111111111111111111111111111111111111".to_owned(), + to: "0x2222222222222222222222222222222222222222".to_owned(), + data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), + }; + + let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); + + assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); + assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); + assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); + assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); +} + +#[tokio::test] +async fn test_provider_get_testnet_paymaster() { + let provider = era_provider(); + + assert!(provider.get_testnet_paymaster().await.is_ok()); +} + +#[tokio::test] +async fn test_provider_estimate_gas_l1_to_l2() { + let provider = era_provider(); + #[derive(Serialize, Deserialize, Debug)] + struct TestTransaction { + from: String, + to: String, + data: String, + } + + let transaction = TestTransaction { + from: "0x1111111111111111111111111111111111111111".to_owned(), + to: "0x2222222222222222222222222222222222222222".to_owned(), + data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), + }; + + let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); + + assert_eq!(estimated_fee, U256::from(36_768_868_u64)); +} + +#[tokio::test] +// TODO: This test is flacky. It could fail in the future. +async fn test_provider_get_all_account_balances() { + let provider = era_provider(); + let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" + .parse() + .unwrap(); + let balance = provider.get_balance(address, None).await.unwrap(); + + let balances = provider.get_all_account_balances(address).await.unwrap(); + + assert_eq!( + balances + .get( + &"0x0000000000000000000000000000000000000000" + .parse::
() + .unwrap() + ) + .unwrap() + .clone(), + balance + ); +} + +#[tokio::test] +async fn test_provider_get_block_details() { + let provider = era_provider(); + let existing_block = 1_u64; + let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; + + let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); + let non_existing_block_details = provider + .get_block_details(non_existing_block.as_u32()) + .await + .unwrap(); + + assert!(existing_block_details.is_some()); + assert!(non_existing_block_details.is_none()) +} + +#[tokio::test] +async fn test_provider_get_bridge_contracts() { + let provider = era_provider(); + + assert!(provider.get_bridge_contracts().await.is_ok()); +} + +#[tokio::test] +async fn test_provider_get_bytecode_by_hash() { + let provider = era_provider(); + let invalid_hash = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" + .parse() + .unwrap(); + let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); + let valid_hash = test_block.base.root_hash.unwrap(); + + assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); + assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); +} + +#[ignore] +#[tokio::test] +async fn test_provider_get_confirmed_tokens() { + let provider = era_provider(); + let from = 0; + let limit = 10; + + assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); +} + +// TODO: This test is flacky. It could fail in the future. +#[tokio::test] +async fn test_provider_get_l1_batch_block_range() { + let provider = era_provider(); + let batch = 1_u64; + + assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); +} + +#[tokio::test] +async fn test_provider_get_l1_batch_details() { + let provider = era_provider(); + let batch = 1_u64; + + assert!(provider.get_l1_batch_details(batch).await.is_ok()); +} + +#[tokio::test] +async fn test_provider_get_l2_to_l1_log_proof() { + let provider = era_provider(); + let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" + .parse() + .unwrap(); + + assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); +} + +// #[tokio::test] +// async fn test_provider_get_l2_to_l1_msg_proof() { +// let provider = local_provider(); +// let block = 2; +// let sender = /* create an address object */; +// let msg = /* create a hash object */; + +// assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); +// } + +#[tokio::test] +async fn test_provider_get_main_contract() { + let provider = era_provider(); + + assert!(provider.get_main_contract().await.is_ok()); +} + +// TODO: This test is flacky. It could fail in the future. We should create a +// transaction, send it, and the assert that the details match. +#[tokio::test] +async fn test_provider_get_raw_block_transactions() { + let provider = era_provider(); + let block = 1_u64; + + assert!(provider.get_raw_block_transactions(block).await.is_ok()); +} + +#[tokio::test] +async fn test_provider_get_token_price() { + let provider = era_provider(); + let address: Address = "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(); + + assert!(provider.get_token_price(address).await.is_ok()); +} + +// TODO: This test is flacky. It could fail in the future. We should create a +// transaction, send it, and the assert that the details match. +#[tokio::test] +async fn test_provider_get_transaction_details() { + let provider = era_provider(); + let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); + let hash = test_block.base.root_hash.unwrap(); + + assert!(provider.get_transaction_details(hash).await.is_ok()); +} + +#[tokio::test] +async fn test_provider_get_l1_batch_number() { + let provider = era_provider(); + + assert!(provider.get_l1_batch_number().await.is_ok()); +} + +#[tokio::test] +async fn test_provider_get_l1_chain_id() { + let provider = era_provider(); + + assert!(provider.get_l1_chain_id().await.is_ok()); +} + +#[tokio::test] +async fn test_provider_debug_trace_block_by_hash() { + let provider = era_provider(); + let block_number = provider.get_block_number().await.unwrap() - 1_u64; + let test_block = provider + .get_block_details(block_number.as_u32()) + .await + .unwrap() + .unwrap(); + let hash_block = test_block.base.root_hash.unwrap(); + + let options = Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }); + + assert!( + ZKMiddleware::debug_trace_block_by_hash(&provider, hash_block, None) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_block_by_hash(&provider, hash_block, options) + .await + .is_ok() + ); +} + +#[tokio::test] +async fn test_provider_debug_trace_block_by_number() { + let provider = era_provider(); + let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; + let non_existing_block_number = existing_block_number + 100_u64; + let options = Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }); + + assert!( + ZKMiddleware::debug_trace_block_by_number(&provider, existing_block_number, None) + .await + .is_ok() + ); + assert!(ZKMiddleware::debug_trace_block_by_number( + &provider, + existing_block_number, + options.clone() + ) + .await + .is_ok()); + assert!( + ZKMiddleware::debug_trace_block_by_number(&provider, non_existing_block_number, None) + .await + .is_err() + ); + assert!(ZKMiddleware::debug_trace_block_by_number( + &provider, + non_existing_block_number, + options + ) + .await + .is_err()); +} + +#[tokio::test] +async fn test_provider_debug_trace_call() { + let provider = era_provider(); + #[derive(Serialize, Deserialize, Debug)] + struct TestTransaction { + from: String, + to: String, + data: String, + } + + let request = TestTransaction { + from: "0x1111111111111111111111111111111111111111".to_owned(), + to: "0x2222222222222222222222222222222222222222".to_owned(), + data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), + }; + + let block = provider.get_block_number().await.ok(); + let options = Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }); + + println!( + "{:?}", + ZKMiddleware::debug_trace_call::<&TestTransaction, u64>(&provider, &request, None, None) + .await + ); + + assert!(ZKMiddleware::debug_trace_call::<&TestTransaction, u64>( + &provider, &request, None, None + ) + .await + .is_ok()); + assert!( + ZKMiddleware::debug_trace_call(&provider, &request, block, None) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_call(&provider, &request, block, options.clone()) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_call::<_, u64>(&provider, request, None, options) + .await + .is_ok() + ); +} + +// TODO: This test is flacky. It could fail in the future. +#[tokio::test] +async fn test_provider_debug_trace_transaction() { + let era_provider = era_provider(); + let zk_wallet = ZKSWallet::new(local_wallet(), None, Some(era_provider.clone()), None).unwrap(); + + let transfer_request = TransferRequest::new(1_u64.into()) + .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) + .from(zk_wallet.l2_address()); + let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); + let invalid_transaction_hash: H256 = + "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" + .parse() + .unwrap(); + + let options = Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }); + + assert!( + ZKMiddleware::debug_trace_transaction(&era_provider, transaction_hash, None) + .await + .is_ok() + ); + assert!(ZKMiddleware::debug_trace_transaction( + &era_provider, + transaction_hash, + options.clone() + ) + .await + .is_ok()); + assert!( + ZKMiddleware::debug_trace_transaction(&era_provider, invalid_transaction_hash, None) + .await + .is_err() + ); + assert!(ZKMiddleware::debug_trace_transaction( + &era_provider, + invalid_transaction_hash, + options + ) + .await + .is_err()); +} + +#[tokio::test] +async fn test_signer_estimate_fee() { + let provider = era_signer(); + #[derive(Serialize, Deserialize, Debug)] + struct TestTransaction { + from: String, + to: String, + data: String, + } + + let transaction = TestTransaction { + from: "0x1111111111111111111111111111111111111111".to_owned(), + to: "0x2222222222222222222222222222222222222222".to_owned(), + data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), + }; + + let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); + + assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); + assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); + assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); + assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); +} + +#[tokio::test] +async fn test_signer_get_testnet_paymaster() { + let provider = era_signer(); + + assert!(provider.get_testnet_paymaster().await.is_ok()); +} + +#[tokio::test] +async fn test_signer_estimate_gas_l1_to_l2() { + let provider = era_signer(); + #[derive(Serialize, Deserialize, Debug)] + struct TestTransaction { + from: String, + to: String, + data: String, + } + + let transaction = TestTransaction { + from: "0x1111111111111111111111111111111111111111".to_owned(), + to: "0x2222222222222222222222222222222222222222".to_owned(), + data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), + }; + + let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); + + assert_eq!(estimated_fee, U256::from(36_768_868_u32)); +} + +#[tokio::test] +// TODO: This test is flacky. It could fail in the future. +async fn test_signer_get_all_account_balances() { + let provider = era_signer(); + let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" + .parse() + .unwrap(); + let balance = provider.get_balance(address, None).await.unwrap(); + + let balances = provider.get_all_account_balances(address).await.unwrap(); + + assert_eq!( + balances + .get( + &"0x0000000000000000000000000000000000000000" + .parse::
() + .unwrap() + ) + .unwrap() + .clone(), + balance + ); +} + +#[tokio::test] +async fn test_signer_get_block_details() { + let provider = era_signer(); + let existing_block = 1_u64; + let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; + + let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); + let non_existing_block_details = provider + .get_block_details(non_existing_block.as_u32()) + .await + .unwrap(); + + assert!(existing_block_details.is_some()); + assert!(non_existing_block_details.is_none()) +} + +#[tokio::test] +async fn test_signer_get_bridge_contracts() { + let provider = era_signer(); + + assert!(provider.get_bridge_contracts().await.is_ok()); +} + +#[tokio::test] +async fn test_signer_get_bytecode_by_hash() { + let provider = era_signer(); + let invalid_hash = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" + .parse() + .unwrap(); + let valid_hash: H256 = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" + .parse() + .unwrap(); + + assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); + assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); +} + +#[ignore] +#[tokio::test] +async fn test_signer_get_confirmed_tokens() { + let provider = era_signer(); + let from = 0; + let limit = 10; + + assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); +} + +// TODO: This test is flacky. It could fail in the future. +#[tokio::test] +async fn test_signer_get_l1_batch_block_range() { + let provider = era_signer(); + let batch = 1_u64; + + assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); +} + +#[tokio::test] +async fn test_signer_get_l1_batch_details() { + let provider = era_signer(); + let batch = 1_u64; + + assert!(provider.get_l1_batch_details(batch).await.is_ok()); +} + +#[tokio::test] +async fn test_signer_get_l2_to_l1_log_proof() { + let provider = era_signer(); + let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" + .parse() + .unwrap(); + + assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); +} + +// #[tokio::test] +// async fn test_signer_get_l2_to_l1_msg_proof() { +// let provider = local_signer(); +// let block = 2; +// let sender = /* create an address object */; +// let msg = /* create a hash object */; + +// assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); +// } + +#[tokio::test] +async fn test_signer_get_main_contract() { + let provider = era_signer(); + + assert!(provider.get_main_contract().await.is_ok()); +} + +// TODO: This test is flacky. It could fail in the future. We should create a +// transaction, send it, and the assert that the details match. +#[tokio::test] +async fn test_signer_get_raw_block_transactions() { + let provider = era_signer(); + let block = 1_u64; + + assert!(provider.get_raw_block_transactions(block).await.is_ok()); +} + +#[tokio::test] +async fn test_signer_get_token_price() { + let provider = era_signer(); + let address: Address = "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(); + + assert!(provider.get_token_price(address).await.is_ok()); +} + +// TODO: This test is flacky. It could fail in the future. We should create a +// transaction, send it, and the assert that the details match. +#[tokio::test] +async fn test_signer_get_transaction_details() { + let provider = era_signer(); + let hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" + .parse() + .unwrap(); + + assert!(provider.get_transaction_details(hash).await.is_ok()); +} + +#[tokio::test] +async fn test_signer_get_l1_batch_number() { + let provider = era_signer(); + + assert!(provider.get_l1_batch_number().await.is_ok()); +} + +#[tokio::test] +async fn test_signer_get_l1_chain_id() { + let provider = era_signer(); + + assert!(provider.get_l1_chain_id().await.is_ok()); +} + +#[tokio::test] +async fn test_signer_debug_trace_block_by_hash() { + let provider = era_signer(); + let block_number = provider.get_block_number().await.unwrap() - 1_u64; + let test_block = provider + .get_block_details(block_number.as_u32()) + .await + .unwrap() + .unwrap(); + let hash = test_block.base.root_hash.unwrap(); + + let options = Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }); + + assert!( + ZKMiddleware::debug_trace_block_by_hash(&provider, hash, None) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_block_by_hash(&provider, hash, options) + .await + .is_ok() + ); +} + +#[tokio::test] +async fn test_signer_debug_trace_block_by_number() { + let provider = era_signer(); + let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; + let non_existing_block_number = existing_block_number + 100_u64; + let options = Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }); + + assert!( + ZKMiddleware::debug_trace_block_by_number(&provider, existing_block_number, None) + .await + .is_ok() + ); + assert!(ZKMiddleware::debug_trace_block_by_number( + &provider, + existing_block_number, + options.clone() + ) + .await + .is_ok()); + assert!( + ZKMiddleware::debug_trace_block_by_number(&provider, non_existing_block_number, None) + .await + .is_err() + ); + assert!(ZKMiddleware::debug_trace_block_by_number( + &provider, + non_existing_block_number, + options + ) + .await + .is_err()); +} + +#[tokio::test] +async fn test_signer_debug_trace_call() { + let provider = era_signer(); + #[derive(Serialize, Deserialize, Debug)] + struct TestTransaction { + from: String, + to: String, + data: String, + } + + let request = TestTransaction { + from: "0x1111111111111111111111111111111111111111".to_owned(), + to: "0x2222222222222222222222222222222222222222".to_owned(), + data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), + }; + + let block = provider.get_block_number().await.ok(); + let options = Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }); + + assert!( + ZKMiddleware::debug_trace_call::<_, u64>(&provider, &request, None, None) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_call(&provider, &request, block, None) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_call(&provider, &request, block, options.clone()) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_call::<_, u64>(&provider, request, None, options) + .await + .is_ok() + ); +} + +#[tokio::test] +async fn test_signer_debug_trace_transaction() { + let era_signer = era_signer(); + let zk_wallet = ZKSWallet::new(local_wallet(), None, Some(era_signer.clone()), None).unwrap(); + + let transfer_request = TransferRequest::new(1_u64.into()) + .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) + .from(zk_wallet.l2_address()); + let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); + let invalid_transaction_hash: H256 = + "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" + .parse() + .unwrap(); + + let options = Some(TracerConfig { + tracer: SupportedTracers::CallTracer, + tracer_config: CallTracerConfig { + only_top_call: true, + }, + }); + + assert!( + ZKMiddleware::debug_trace_transaction(&era_signer, transaction_hash, None) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_transaction(&era_signer, transaction_hash, options) + .await + .is_ok() + ); + assert!( + ZKMiddleware::debug_trace_transaction(&era_signer, invalid_transaction_hash, None) + .await + .is_err() + ); +} + +#[ignore = "Deprecated"] +#[tokio::test] +async fn test_send_function_with_arguments() { + // Deploying a test contract + let era_provider = era_provider(); + let wallet = local_wallet(); + let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + contract_path.push("src/abi/test_contracts/storage_combined.json"); + let contract: CompiledContract = + serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + + let deploy_request = + DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["0".to_owned()]) + .from(zk_wallet.l2_address()); + let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); + let call_request = CallRequest::new(contract_address, "getValue()(uint256)".to_owned()); + let initial_value = ZKMiddleware::call(&era_provider, &call_request) + .await + .unwrap(); + + assert_eq!(initial_value, U256::from(0_i32).into_tokens()); + + let value_to_set = String::from("10"); + era_provider + .send_eip712( + &zk_wallet.l2_wallet, + contract_address, + "setValue(uint256)", + Some([value_to_set.clone()].into()), + None, + ) + .await + .unwrap() + .await + .unwrap() + .unwrap(); + let set_value = ZKMiddleware::call(&era_provider, &call_request) + .await + .unwrap(); + + assert_eq!( + set_value, + U256::from(value_to_set.parse::().unwrap()).into_tokens() + ); + + era_provider + .send_eip712( + &zk_wallet.l2_wallet, + contract_address, + "incrementValue()", + None, + None, + ) + .await + .unwrap() + .await + .unwrap() + .unwrap(); + let incremented_value = ZKMiddleware::call(&era_provider, &call_request) + .await + .unwrap(); + + assert_eq!( + incremented_value, + (value_to_set.parse::().unwrap() + 1_u64).into_tokens() + ); +} + +#[ignore = "Deprecated"] +#[tokio::test] +async fn test_call_view_function_with_no_parameters() { + // Deploying a test contract + let era_provider = era_provider(); + let wallet = local_wallet(); + let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + contract_path.push("src/abi/test_contracts/basic_combined.json"); + let contract: CompiledContract = + serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + + let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]); + let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); + let call_request = CallRequest::new(contract_address, "str_out()(string)".to_owned()); + let output = ZKMiddleware::call(&era_provider, &call_request) + .await + .unwrap(); + + assert_eq!(output, String::from("Hello World!").into_tokens()); +} + +#[ignore = "Deprecated"] +#[tokio::test] +async fn test_call_view_function_with_arguments() { + // Deploying a test contract + let era_provider = era_provider(); + let wallet = local_wallet(); + let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + + let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + contract_path.push("src/abi/test_contracts/basic_combined.json"); + let contract: CompiledContract = + serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + + let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]) + .from(zk_wallet.l2_address()); + let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); + let call_request = CallRequest::new(contract_address, "plus_one(uint256)".to_owned()) + .function_parameters(vec!["1".to_owned()]); + let no_return_type_output = ZKMiddleware::call(&era_provider, &call_request) + .await + .unwrap(); + + let call_request = call_request.function_signature("plus_one(uint256)(uint256)".to_owned()); + let known_return_type_output = ZKMiddleware::call(&era_provider, &call_request) + .await + .unwrap(); + + assert_eq!( + no_return_type_output, + Bytes::from([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 2 + ]) + .into_tokens() + ); + assert_eq!(known_return_type_output, U256::from(2_u64).into_tokens()); +} diff --git a/src/tests/utils.rs b/tests/utils.rs similarity index 88% rename from src/tests/utils.rs rename to tests/utils.rs index f484c14..c933280 100644 --- a/src/tests/utils.rs +++ b/tests/utils.rs @@ -9,11 +9,10 @@ use ethers::{ }; use ethers_contract::core::k256::ecdsa::SigningKey; use serde::Deserialize; - -use crate::zks_utils::ERA_CHAIN_ID; +use zksync_types::DEFAULT_ERA_CHAIN_ID; #[derive(Deserialize)] -pub(crate) struct CompiledContract { +pub struct CompiledContract { pub abi: Abi, pub bin: Bytes, } @@ -32,7 +31,7 @@ pub fn local_wallet() -> LocalWallet { "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110" .parse::() .unwrap() - .with_chain_id(ERA_CHAIN_ID) + .with_chain_id(DEFAULT_ERA_CHAIN_ID) } pub fn era_signer() -> SignerMiddleware, Wallet> { @@ -40,7 +39,7 @@ pub fn era_signer() -> SignerMiddleware, Walle "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110" .parse::>() .unwrap(), - ERA_CHAIN_ID, + DEFAULT_ERA_CHAIN_ID, ); era_provider().with_signer(signer) } diff --git a/tests/wallet_tests.rs b/tests/wallet_tests.rs new file mode 100644 index 0000000..b9f1b04 --- /dev/null +++ b/tests/wallet_tests.rs @@ -0,0 +1,605 @@ +use crate::zk_middleware::ZKMiddleware; +use crate::zks_wallet::{DeployRequest, TransferRequest, WithdrawRequest, ZKSWallet}; +use ethers::contract::abigen; +use ethers::providers::Middleware; +use ethers::signers::{LocalWallet, Signer}; +use ethers::types::Address; +use ethers::types::U256; +use ethers::utils::parse_units; +use std::fs::File; +use std::path::PathBuf; +use std::str::FromStr; +use zksync_types::DEFAULT_ERA_CHAIN_ID; + +abigen!( + ERC20Token, + r#"[ + balanceOf(address)(uint256) + ]"# +); + +#[tokio::test] +async fn test_transfer() { + let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; + let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" + .parse() + .unwrap(); + let amount_to_transfer: U256 = 1_i32.into(); + + let era_provider = era_provider(); + let wallet = LocalWallet::from_str(sender_private_key) + .unwrap() + .with_chain_id(DEFAULT_ERA_CHAIN_ID); + let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + + let sender_balance_before = era_provider + .get_balance(zk_wallet.l2_address(), None) + .await + .unwrap(); + let receiver_balance_before = era_provider + .get_balance(receiver_address, None) + .await + .unwrap(); + + println!("Sender balance before: {sender_balance_before}"); + println!("Receiver balance before: {receiver_balance_before}"); + + let request = TransferRequest::new(amount_to_transfer) + .to(receiver_address) + .from(zk_wallet.l2_address()); + let tx_hash = zk_wallet.transfer(&request, None).await.unwrap(); + + let receipt = era_provider + .get_transaction_receipt(tx_hash) + .await + .unwrap() + .unwrap(); + + assert_eq!(receipt.from, zk_wallet.l2_address()); + assert_eq!(receipt.to.unwrap(), receiver_address); + + let sender_balance_after = era_provider + .get_balance(zk_wallet.l2_address(), None) + .await + .unwrap(); + let receiver_balance_after = era_provider + .get_balance(receiver_address, None) + .await + .unwrap(); + + println!("Sender balance after: {sender_balance_after}"); + println!("Receiver balance after: {receiver_balance_after}"); + + assert_eq!( + sender_balance_after, + sender_balance_before + - (amount_to_transfer + + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) + ); + assert_eq!( + receiver_balance_after, + receiver_balance_before + amount_to_transfer + ); +} + +// #[tokio::test] +// async fn test_deposit() { +// let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; +// let request = DepositRequest::new(parse_units("0.01", "ether").unwrap().into()); +// println!("Amount: {}", request.amount); + +// let l1_provider = eth_provider(); +// let l2_provider = era_provider(); +// let wallet = LocalWallet::from_str(private_key) +// .unwrap() +// .with_chain_id(DEFAULT_ERA_CHAIN_ID); +// let zk_wallet = ZKSWallet::new( +// wallet, +// None, +// Some(l2_provider.clone()), +// Some(l1_provider.clone()), +// ) +// .unwrap(); + +// let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); +// let l2_balance_before = zk_wallet.era_balance().await.unwrap(); +// println!("L1 balance before: {l1_balance_before}"); +// println!("L2 balance before: {l2_balance_before}"); + +// let tx_hash = zk_wallet.deposit(&request).await.unwrap(); +// let receipt = l1_provider +// .get_transaction_receipt(tx_hash) +// .await +// .unwrap() +// .unwrap(); +// assert_eq!(receipt.status.unwrap(), 1_u8.into()); + +// let _l2_receipt = l2_provider +// .get_transaction_receipt(receipt.transaction_hash) +// .await +// .unwrap(); + +// let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); +// let l2_balance_after = zk_wallet.era_balance().await.unwrap(); +// println!("L1 balance after: {l1_balance_after}"); +// println!("L2 balance after: {l2_balance_after}"); + +// assert!( +// l1_balance_after <= l1_balance_before - request.amount(), +// "Balance on L1 should be decreased" +// ); +// assert!( +// l2_balance_after >= l2_balance_before + request.amount(), +// "Balance on L2 should be increased" +// ); +// } + +// #[tokio::test] +// async fn test_deposit_to_another_address() { +// let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; +// let to: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" +// .parse() +// .unwrap(); +// let amount = parse_units("0.01", "ether").unwrap().into(); +// println!("Amount: {amount}"); + +// let request = DepositRequest::new(amount).to(to); + +// let l1_provider = eth_provider(); +// let l2_provider = era_provider(); +// let wallet = LocalWallet::from_str(private_key).unwrap(); +// let zk_wallet = ZKSWallet::new( +// wallet, +// None, +// Some(l2_provider.clone()), +// Some(l1_provider.clone()), +// ) +// .unwrap(); + +// let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); +// let l2_balance_before = era_provider().get_balance(to, None).await.unwrap(); +// println!("L1 balance before: {l1_balance_before}"); +// println!("L2 balance before: {l2_balance_before}"); + +// let tx_hash = zk_wallet.deposit(&request).await.unwrap(); +// let receipt = l1_provider +// .get_transaction_receipt(tx_hash) +// .await +// .unwrap() +// .unwrap(); +// assert_eq!(receipt.status.unwrap(), 1_u8.into()); + +// let _l2_receipt = l2_provider +// .get_transaction_receipt(receipt.transaction_hash) +// .await +// .unwrap(); + +// let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); +// let l2_balance_after = era_provider().get_balance(to, None).await.unwrap(); +// println!("L1 balance after: {l1_balance_after}"); +// println!("L2 balance after: {l2_balance_after}"); + +// assert!( +// l1_balance_after <= l1_balance_before - request.amount(), +// "Balance on L1 should be decreased" +// ); +// assert!( +// l2_balance_after >= l2_balance_before + request.amount(), +// "Balance on L2 should be increased" +// ); +// } + +// #[ignore = "FIXME Implement a fixture that deploys an ERC20 token"] +// #[tokio::test] +// async fn test_deposit_erc20_token() { +// let amount: U256 = 1_i32.into(); +// let private_key = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; +// let l1_provider = eth_provider(); +// let l2_provider = era_provider(); +// let wallet = LocalWallet::from_str(private_key).unwrap(); +// let zk_wallet = ZKSWallet::new( +// wallet, +// None, +// Some(l2_provider.clone()), +// Some(l1_provider.clone()), +// ) +// .unwrap(); + +// let token_l1_address: Address = "0xc8F8cE6491227a6a2Ab92e67a64011a4Eba1C6CF" +// .parse() +// .unwrap(); + +// let contract_l1 = ERC20Token::new(token_l1_address, Arc::new(l1_provider.clone())); + +// let balance_erc20_l1_before: U256 = contract_l1 +// .balance_of(zk_wallet.l1_address()) +// .call() +// .await +// .unwrap(); + +// let request = DepositRequest::new(amount).token(Some(token_l1_address)); + +// let l1_tx_hash = zk_wallet.deposit(&request).await.unwrap(); +// let l1_receipt = zk_wallet +// .get_eth_provider() +// .unwrap() +// .get_transaction_receipt(l1_tx_hash) +// .await +// .unwrap() +// .unwrap(); +// assert_eq!(l1_receipt.status.unwrap(), 1_i32.into()); + +// let balance_erc20_l1_after: U256 = contract_l1 +// .balance_of(zk_wallet.l1_address()) +// .call() +// .await +// .unwrap(); + +// assert_eq!(balance_erc20_l1_after, balance_erc20_l1_before - amount); +// // FIXME check balance on l2. +// } + +#[tokio::test] +async fn test_transfer_eip712() { + let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; + let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" + .parse() + .unwrap(); + let amount_to_transfer: U256 = 1_i32.into(); + + let era_provider = era_provider(); + let wallet = LocalWallet::from_str(sender_private_key) + .unwrap() + .with_chain_id(DEFAULT_ERA_CHAIN_ID); + let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + + let sender_balance_before = era_provider + .get_balance(zk_wallet.l2_address(), None) + .await + .unwrap(); + let receiver_balance_before = era_provider + .get_balance(receiver_address, None) + .await + .unwrap(); + + println!("Sender balance before: {sender_balance_before}"); + println!("Receiver balance before: {receiver_balance_before}"); + + let transfer_request = TransferRequest::new(amount_to_transfer) + .to(receiver_address) + .from(zk_wallet.l2_address()); + let tx_hash = zk_wallet + .transfer_eip712(&transfer_request, None) + .await + .unwrap(); + + let receipt = era_provider + .get_transaction_receipt(tx_hash) + .await + .unwrap() + .unwrap(); + assert_eq!(receipt.from, zk_wallet.l2_address()); + assert_eq!(receipt.to.unwrap(), receiver_address); + + let sender_balance_after = era_provider + .get_balance(zk_wallet.l2_address(), None) + .await + .unwrap(); + let receiver_balance_after = era_provider + .get_balance(receiver_address, None) + .await + .unwrap(); + + println!("Sender balance after: {sender_balance_after}"); + println!("Receiver balance after: {receiver_balance_after}"); + + assert_eq!( + sender_balance_after, + sender_balance_before + - (amount_to_transfer + + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) + ); + assert_eq!( + receiver_balance_after, + receiver_balance_before + amount_to_transfer + ); +} + +#[tokio::test] +async fn test_deploy_contract_with_constructor_arg_uint() { + let deployer_private_key = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; + let era_provider = era_provider(); + let wallet = LocalWallet::from_str(deployer_private_key) + .unwrap() + .with_chain_id(DEFAULT_ERA_CHAIN_ID); + let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + + let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + contract_path.push("src/abi/test_contracts/storage_combined.json"); + let contract: CompiledContract = + serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + + let deploy_request = + DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["10".to_owned()]) + .from(zk_wallet.l2_address()); + let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); + let deploy_result = era_provider.get_code(contract_address, None).await; + + assert!(deploy_result.is_ok()); +} + +#[tokio::test] +async fn test_deploy_contract_with_constructor_arg_string() { + let deployer_private_key = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; + let era_provider = era_provider(); + let wallet = LocalWallet::from_str(deployer_private_key) + .unwrap() + .with_chain_id(DEFAULT_ERA_CHAIN_ID); + let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + + let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + contract_path.push("src/abi/test_contracts/greeter_combined.json"); + let contract: CompiledContract = + serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + + let deploy_request = + DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["Hey".to_owned()]) + .from(zk_wallet.l2_address()); + let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); + let deploy_result = era_provider.get_code(contract_address, None).await; + + assert!(deploy_result.is_ok()); +} + +// #[tokio::test] +// async fn test_deploy_contract_with_import() { +// let deployer_private_key = +// "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; +// let era_provider = era_provider(); +// let wallet = LocalWallet::from_str(deployer_private_key) +// .unwrap() +// .with_chain_id(DEFAULT_ERA_CHAIN_ID); +// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + +// // Deploy imported contract first. +// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// contract_path.push("src/abi/test_contracts/counter_combined.json"); +// let counter_contract: CompiledContract = +// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// let deploy_request = +// DeployRequest::with(counter_contract.abi, counter_contract.bin.to_vec(), vec![]) +// .from(zk_wallet.l2_address()); +// let counter_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// let deploy_result = era_provider.get_code(counter_contract_address, None).await; + +// assert!(deploy_result.is_ok()); + +// // Deploy another contract that imports the previous one. +// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// contract_path.push("src/abi/test_contracts/import_combined.json"); + +// let import_contract: CompiledContract = +// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// let deploy_request = DeployRequest::with( +// import_contract.abi, +// import_contract.bin.to_vec(), +// vec![format!("{counter_contract_address:?}")], +// ) +// .from(zk_wallet.l2_address()); +// let import_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// let call_request = CallRequest::new( +// import_contract_address, +// "getCounterValue()(uint256)".to_owned(), +// ); +// let value = ZKMiddleware::call(&era_provider, &call_request) +// .await +// .unwrap(); + +// assert_eq!(value, U256::from(0_u64).into_tokens()); +// } + +#[tokio::test] +async fn test_withdraw_to_same_address() { + let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; + let wallet = LocalWallet::from_str(sender_private_key) + .unwrap() + .with_chain_id(DEFAULT_ERA_CHAIN_ID); + let zk_wallet = + ZKSWallet::new(wallet, None, Some(era_provider()), Some(eth_provider())).unwrap(); + + // See balances before withdraw + let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); + let l2_balance_before = zk_wallet.era_balance().await.unwrap(); + + println!("Balance on L1 before withdrawal: {l1_balance_before}"); + println!("Balance on L2 before withdrawal: {l2_balance_before}"); + + // Withdraw + let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); + + let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); + let tx_hash = zk_wallet.withdraw(&withdraw_request).await.unwrap(); + let tx_receipt = zk_wallet + .get_era_provider() + .unwrap() + .wait_for_finalize(tx_hash, None, None) + .await + .unwrap(); + assert_eq!( + 1, + tx_receipt.status.unwrap().as_u64(), + "Check that transaction in L2 is successful" + ); + + println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); + + let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); + let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); + + assert_eq!( + l2_balance_after_withdraw, + l2_balance_before + - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), + "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" + ); + + assert_eq!( + l1_balance_before, l1_balance_after_withdraw, + "Check that L1 balance has not changed" + ); + + let tx_finalize_hash = zk_wallet.finalize_withdraw(tx_hash).await.unwrap(); + + let tx_finalize_receipt = zk_wallet + .get_eth_provider() + .unwrap() + .get_transaction_receipt(tx_finalize_hash) + .await + .unwrap() + .unwrap(); + println!( + "L1 Transaction hash: {:?}", + tx_finalize_receipt.transaction_hash + ); + + assert_eq!( + 1, + tx_finalize_receipt.status.unwrap().as_u64(), + "Check that transaction in L1 is successful" + ); + + // See balances after withdraw + let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); + let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); + + println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); + println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); + + assert_eq!( + l2_balance_after_finalize, l2_balance_after_withdraw, + "Check that L2 balance after finalize has decreased by the used gas" + ); + + assert_ne!( + l1_balance_after_finalize, l1_balance_before, + "Check that L1 balance after finalize is not the same" + ); + assert_eq!( + l1_balance_after_finalize, + l1_balance_before + + (amount_to_withdraw + - tx_finalize_receipt.effective_gas_price.unwrap() + * tx_finalize_receipt.gas_used.unwrap()), + "Check that L1 balance after finalize has increased by the amount" + ); +} + +#[tokio::test] +async fn test_withdraw_to_other_address() { + let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; + let receiver_private_key = "0xe667e57a9b8aaa6709e51ff7d093f1c5b73b63f9987e4ab4aa9a5c699e024ee8"; + let l2_wallet = LocalWallet::from_str(sender_private_key) + .unwrap() + .with_chain_id(DEFAULT_ERA_CHAIN_ID); + + let l1_wallet = LocalWallet::from_str(receiver_private_key) + .unwrap() + .with_chain_id(utils::ETH_CHAIN_ID); + let zk_wallet = ZKSWallet::new( + l2_wallet, + Some(l1_wallet), + Some(era_provider()), + Some(eth_provider()), + ) + .unwrap(); + + // See balances before withdraw + let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); + let l2_balance_before = zk_wallet.era_balance().await.unwrap(); + + println!("Balance on L1 before withdrawal: {l1_balance_before}"); + println!("Balance on L2 before withdrawal: {l2_balance_before}"); + + // Withdraw + let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); + let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); + let tx_receipt = zk_wallet.withdraw(&withdraw_request).await.unwrap(); + let tx_receipt = zk_wallet + .get_era_provider() + .unwrap() + .wait_for_finalize(tx_receipt, None, None) + .await + .unwrap(); + assert_eq!( + 1, + tx_receipt.status.unwrap().as_u64(), + "Check that transaction in L2 is successful" + ); + + println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); + + let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); + let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); + + assert_eq!( + l2_balance_after_withdraw, + l2_balance_before + - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), + "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" + ); + + assert_eq!( + l1_balance_before, l1_balance_after_withdraw, + "Check that L1 balance has not changed" + ); + + let tx_finalize_hash = zk_wallet + .finalize_withdraw(tx_receipt.transaction_hash) + .await + .unwrap(); + + let tx_finalize_receipt = zk_wallet + .get_eth_provider() + .unwrap() + .get_transaction_receipt(tx_finalize_hash) + .await + .unwrap() + .unwrap(); + println!( + "L1 Transaction hash: {:?}", + tx_finalize_receipt.transaction_hash + ); + + assert_eq!( + 1, + tx_finalize_receipt.status.unwrap().as_u64(), + "Check that transaction in L1 is successful" + ); + + // See balances after withdraw + let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); + let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); + + println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); + println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); + + assert_eq!( + l2_balance_after_finalize, l2_balance_after_withdraw, + "Check that L2 balance after finalize has decreased by the used gas" + ); + + assert_ne!( + l1_balance_after_finalize, l1_balance_before, + "Check that L1 balance after finalize is not the same" + ); + assert_eq!( + l1_balance_after_finalize, + l1_balance_before + + (amount_to_withdraw + - tx_finalize_receipt.effective_gas_price.unwrap() + * tx_finalize_receipt.gas_used.unwrap()), + "Check that L1 balance after finalize has increased by the amount" + ); +} From dfd2c9d345ce9a006aabba30ccd296d42c1eb5f3 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:50:57 +0200 Subject: [PATCH 08/75] Update main contract's ABI --- src/contracts/main_contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/main_contract.rs b/src/contracts/main_contract.rs index ca8485a..e087492 100644 --- a/src/contracts/main_contract.rs +++ b/src/contracts/main_contract.rs @@ -10,7 +10,7 @@ use ethers::signers::Wallet; use ethers::types::{Address, Bytes, TransactionReceipt, U256}; use ethers_contract::{abigen, ContractError}; -abigen!(MainContract, "./src/abi/IZkSync.json"); +abigen!(MainContract, "abi/IZkSyncHyperchain.json"); // ╔══════════════════════════════════════════════════════════════════════════════════════════╗ // ║ Error enum: ║ From 9f81d742ab9b3cff5cd3ae6499a7072989d596f1 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:57:57 +0200 Subject: [PATCH 09/75] Replace ZKSProvider with ZKMiddleware --- src/{zks_provider/mod.rs => zk_middleware.rs} | 718 +++++++----------- src/zks_provider/types.rs | 188 ----- 2 files changed, 283 insertions(+), 623 deletions(-) rename src/{zks_provider/mod.rs => zk_middleware.rs} (53%) delete mode 100644 src/zks_provider/types.rs diff --git a/src/zks_provider/mod.rs b/src/zk_middleware.rs similarity index 53% rename from src/zks_provider/mod.rs rename to src/zk_middleware.rs index 5a95f60..ef5968b 100644 --- a/src/zks_provider/mod.rs +++ b/src/zk_middleware.rs @@ -1,102 +1,114 @@ use async_trait::async_trait; +use ethers_contract::providers::PendingTransaction; +use serde::Serialize; +use serde_json::json; +use std::{collections::HashMap, fmt::Debug, time::Duration}; +use tokio::time::Instant; + use ethers::{ - abi::{HumanReadableParser, Token, Tokenize}, - prelude::{ - k256::{ - ecdsa::{RecoveryId, Signature as RecoverableSignature}, - schnorr::signature::hazmat::PrehashSigner, - }, - SignerMiddleware, + abi::HumanReadableParser, + prelude::k256::{ + ecdsa::{RecoveryId, Signature as RecoverableSignature}, + schnorr::signature::hazmat::PrehashSigner, }, - providers::{JsonRpcClient, Middleware, Provider, ProviderError}, + providers::{JsonRpcClient, Middleware, MiddlewareError, ProviderError}, signers::{Signer, Wallet}, types::{ transaction::{eip2718::TypedTransaction, eip712::Eip712Error}, - Address, BlockNumber, Eip1559TransactionRequest, Signature, TransactionReceipt, TxHash, - H256, U256, U64, + Address, BlockNumber, Bytes, Eip1559TransactionRequest, Signature, TransactionReceipt, + TxHash, H256, U256, U64, }, }; -use ethers_contract::providers::PendingTransaction; -use serde::Serialize; -use serde_json::json; -use std::{collections::HashMap, fmt::Debug, time::Duration}; -use tokio::time::Instant; - -pub mod types; -use types::Fee; use crate::{ eip712::{Eip712Meta, Eip712Transaction, Eip712TransactionRequest}, - zks_utils::{self, DEFAULT_GAS, EIP712_TX_TYPE, MAX_FEE_PER_GAS, MAX_PRIORITY_FEE_PER_GAS}, - zks_wallet::{CallRequest, Overrides}, -}; - -use self::types::{ - BlockDetails, BlockRange, BridgeContracts, DebugTrace, L1BatchDetails, Proof, TokenInfo, - TracerConfig, Transaction, TransactionDetails, + types::zksync::{ + api::{ + BlockDetails, BridgeAddresses, DebugCall, L1BatchDetails, L2ToL1LogProof, + ResultDebugCall, TracerConfig, Transaction, TransactionDetailedResult, + TransactionDetails, + }, + fee::Fee, + web3_decl::Token, + EIP_712_TX_TYPE, + }, + utils, + zks_wallet::Overrides, }; /// This trait wraps every JSON-RPC call specified in zkSync Era's documentation /// https://era.zksync.io/docs/api/api.html#zksync-era-json-rpc-methods #[async_trait] -pub trait ZKSProvider { +pub trait ZKMiddleware { + /// Error type returned by most operations + type Error: MiddlewareError::Inner as ZKMiddleware>::Error>; + /// The JSON-RPC client type at the bottom of the stack type Provider: JsonRpcClient; - type ZKProvider: JsonRpcClient; + /// The next-lower middleware in the middleware stack + type Inner: Middleware; + + /// Convert a provider error into the associated error type by successively + /// converting it to every intermediate middleware error + fn convert_err(p: ProviderError) -> Self::Error { + Self::Error::from_provider_err(p) + } - async fn zk_estimate_gas(&self, transaction: T) -> Result + async fn zk_estimate_gas(&self, transaction: T) -> Result where T: Debug + Serialize + Send + Sync; /// Returns the fee for the transaction. - async fn estimate_fee(&self, transaction: T) -> Result + async fn estimate_fee(&self, transaction: T) -> Result where T: Debug + Serialize + Send + Sync; /// Returns an estimate of the gas required for a L1 to L2 transaction. - async fn estimate_gas_l1_to_l2(&self, transaction: T) -> Result + async fn estimate_gas_l1_to_l2(&self, transaction: T) -> Result where T: Debug + Serialize + Send + Sync; + /// Retrieves the bridge hub contract address. + async fn get_bridgehub_contract(&self) -> Result; + /// Returns all balances for confirmed tokens given by an account address. async fn get_all_account_balances( &self, address: Address, - ) -> Result, ProviderError>; + ) -> Result, Self::Error>; /// Returns additional zkSync-specific information about the L2 block. /// * `committed`: The batch is closed and the state transition it creates exists on layer 1. /// * `proven`: The batch proof has been created, submitted, and accepted on layer 1. /// * `executed`: The batch state transition has been executed on L1; meaning the root state has been updated. - async fn get_block_details(&self, block: T) -> Result, ProviderError> + async fn get_block_details(&self, block: T) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug; /// Returns L1/L2 addresses of default bridges. - async fn get_bridge_contracts(&self) -> Result; + async fn get_bridge_contracts(&self) -> Result; /// Returns bytecode of a transaction given by its hash. - async fn get_bytecode_by_hash(&self, hash: H256) -> Result>, ProviderError>; + async fn get_bytecode_by_hash(&self, hash: H256) -> Result>, Self::Error>; /// Returns [address, symbol, name, and decimal] information of all tokens within a range of ids given by parameters `from` and `limit`. /// /// **Confirmed** in the method name means the method returns any token bridged to zkSync via the official bridge. /// /// > This method is mainly used by the zkSync team as it relates to a database query where the primary keys relate to the given ids. - async fn get_confirmed_tokens( - &self, - from: u32, - limit: u8, - ) -> Result, ProviderError>; + async fn get_confirmed_tokens(&self, from: u32, limit: u8) -> Result, Self::Error>; /// Returns the range of blocks contained within a batch given by batch number. /// /// The range is given by beginning/end block numbers in hexadecimal. - async fn get_l1_batch_block_range(&self, batch: T) -> Result + async fn get_l1_batch_block_range( + &self, + batch: T, + ) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug; /// Returns data pertaining to a given batch. - async fn get_l1_batch_details(&self, batch: T) -> Result + async fn get_l1_batch_details(&self, batch: T) -> Result where T: Into + Send + Sync + Serialize + Debug; @@ -109,7 +121,7 @@ pub trait ZKSProvider { &self, tx_hash: H256, l2_to_l1_log_index: Option, - ) -> Result, ProviderError>; + ) -> Result, Self::Error>; /// Given a block, a sender, a message, and an optional message log index in the /// block containing the L1->L2 message, it returns the proof for the message sent @@ -120,53 +132,56 @@ pub trait ZKSProvider { sender: Address, msg: H256, l2_log_position: Option, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug; /// Returns the address of the zkSync Era contract. - async fn get_main_contract(&self) -> Result; + async fn get_main_contract(&self) -> Result; /// Returns data of transactions in a block. async fn get_raw_block_transactions( &self, block: T, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug; /// Returns the address of the [testnet paymaster](https://era.zksync.io/docs/dev/developer-guides/aa.html#testnet-paymaster): the paymaster that is available /// on testnets and enables paying fees in ERC-20 compatible tokens. - async fn get_testnet_paymaster(&self) -> Result; + async fn get_testnet_paymaster(&self) -> Result; /// Returns the price of a given token in USD. - async fn get_token_price(&self, address: Address) -> Result; + async fn get_token_price(&self, address: Address) -> Result; /// Returns data from a specific transaction given by the transaction hash. async fn get_transaction_details( &self, hash: H256, - ) -> Result, ProviderError>; + ) -> Result, Self::Error>; /// Returns the latest L1 batch number. - async fn get_l1_batch_number(&self) -> Result; + async fn get_l1_batch_number(&self) -> Result; /// Returns the chain id of the underlying L1. - async fn get_l1_chain_id(&self) -> Result; + async fn get_l1_chain_id(&self) -> Result; + + /// Retrieves the L1 base token address. + async fn get_base_token_l1_address(&self) -> Result; /// Returns debug trace of all executed calls contained in a block given by its L2 hash. async fn debug_trace_block_by_hash( &self, hash: H256, options: Option, - ) -> Result; + ) -> Result, Self::Error>; /// Returns debug trace of all executed calls contained in a block given by its L2 block number. async fn debug_trace_block_by_number( &self, block: T, options: Option, - ) -> Result + ) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug; @@ -176,7 +191,7 @@ pub trait ZKSProvider { request: R, block: Option, options: Option, - ) -> Result + ) -> Result where R: Debug + Serialize + Send + Sync, T: Into + Send + Sync + Serialize + Debug; @@ -186,7 +201,12 @@ pub trait ZKSProvider { &self, hash: H256, options: Option, - ) -> Result; + ) -> Result, Self::Error>; + + async fn send_raw_transaction_with_detailed_output( + &self, + tx: Bytes, + ) -> Result; async fn send_eip712( &self, @@ -195,7 +215,7 @@ pub trait ZKSProvider { function_signature: &str, function_parameters: Option>, overrides: Option, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync; @@ -206,7 +226,7 @@ pub trait ZKSProvider { function_signature: &str, function_parameters: Option>, overrides: Option, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync; @@ -215,98 +235,137 @@ pub trait ZKSProvider { transaction_receipt: TxHash, polling_time_in_seconds: Option, timeout_in_seconds: Option, - ) -> Result; - - async fn call(&self, request: &CallRequest) -> Result, ProviderError>; + ) -> Result; async fn send_transaction_eip712( &self, wallet: &Wallet, transaction: T, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where T: TryInto + Send + Sync + Debug, D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync; } #[async_trait] -impl ZKSProvider for SignerMiddleware { - type Provider = ::Provider; - type ZKProvider = ::ZKProvider; +impl ZKMiddleware for M +where + M: Middleware, +{ + type Error = M::Error; + type Provider = M::Provider; + type Inner = M::Inner; - async fn zk_estimate_gas(&self, transaction: T) -> Result + async fn zk_estimate_gas(&self, transaction: T) -> Result where T: Debug + Serialize + Send + Sync, { - ::zk_estimate_gas(self.inner(), transaction).await + self.provider() + .request("eth_estimateGas", [transaction]) + .await + .map_err(M::convert_err) } - async fn estimate_fee(&self, transaction: T) -> Result + async fn estimate_fee(&self, transaction: T) -> Result where T: Debug + Serialize + Send + Sync, { - self.inner().estimate_fee(transaction).await + self.provider() + .request("zks_estimateFee", [transaction]) + .await + .map_err(M::convert_err) } - async fn estimate_gas_l1_to_l2(&self, transaction: T) -> Result + async fn estimate_gas_l1_to_l2(&self, transaction: T) -> Result where T: Debug + Serialize + Send + Sync, { - self.inner().estimate_gas_l1_to_l2(transaction).await + self.provider() + .request("zks_estimateGasL1ToL2", [transaction]) + .await + .map_err(M::convert_err) + } + + async fn get_bridgehub_contract(&self) -> Result { + self.provider() + .request("zks_getBridgehubContract", ()) + .await + .map_err(M::convert_err) } async fn get_all_account_balances( &self, address: Address, - ) -> Result, ProviderError> { - self.inner().get_all_account_balances(address).await + ) -> Result, Self::Error> { + self.provider() + .request("zks_getAllAccountBalances", [address]) + .await + .map_err(M::convert_err) } - async fn get_block_details(&self, block: T) -> Result, ProviderError> + async fn get_block_details(&self, block: T) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug, { - self.inner().get_block_details(block).await + self.provider() + .request("zks_getBlockDetails", [block]) + .await + .map_err(M::convert_err) } - async fn get_bridge_contracts(&self) -> Result { - self.inner().get_bridge_contracts().await + async fn get_bridge_contracts(&self) -> Result { + self.provider() + .request("zks_getBridgeContracts", ()) + .await + .map_err(M::convert_err) } - async fn get_bytecode_by_hash(&self, hash: H256) -> Result>, ProviderError> { - self.inner().get_bytecode_by_hash(hash).await + async fn get_bytecode_by_hash(&self, hash: H256) -> Result>, Self::Error> { + self.provider() + .request("zks_getBytecodeByHash", [hash]) + .await + .map_err(M::convert_err) } - async fn get_confirmed_tokens( - &self, - from: u32, - limit: u8, - ) -> Result, ProviderError> { - self.inner().get_confirmed_tokens(from, limit).await + async fn get_confirmed_tokens(&self, from: u32, limit: u8) -> Result, Self::Error> { + self.provider() + .request("zks_getConfirmedTokens", [from, limit.into()]) + .await + .map_err(M::convert_err) } - async fn get_l1_batch_block_range(&self, batch_id: T) -> Result + async fn get_l1_batch_block_range(&self, batch: T) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug, { - self.inner().get_l1_batch_block_range(batch_id).await + self.provider() + .request("zks_getL1BatchBlockRange", [batch]) + .await + .map_err(M::convert_err) } - async fn get_l1_batch_details(&self, batch_id: T) -> Result + async fn get_l1_batch_details(&self, batch: T) -> Result where T: Into + Send + Sync + Serialize + Debug, { - self.inner().get_l1_batch_details(batch_id).await + self.provider() + .request("zks_getL1BatchDetails", [batch]) + .await + .map_err(M::convert_err) } async fn get_l2_to_l1_log_proof( &self, tx_hash: H256, l2_to_l1_log_index: Option, - ) -> Result, ProviderError> { - self.inner() - .get_l2_to_l1_log_proof(tx_hash, l2_to_l1_log_index) + ) -> Result, Self::Error> { + self.provider() + .request( + "zks_getL2ToL1LogProof", + json!([tx_hash, l2_to_l1_log_index]), + ) .await + .map_err(M::convert_err) } async fn get_l2_to_l1_msg_proof( @@ -315,357 +374,150 @@ impl ZKSProvider for SignerMiddleware, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug, { - self.inner() - .get_l2_to_l1_msg_proof(block, sender, msg, l2_log_position) + self.provider() + .request( + "zks_getL2ToL1MsgProof", + json!([block, sender, msg, l2_log_position]), + ) .await + .map_err(M::convert_err) } - async fn get_main_contract(&self) -> Result { - self.inner().get_main_contract().await + async fn get_main_contract(&self) -> Result { + self.provider() + .request("zks_getMainContract", ()) + .await + .map_err(M::convert_err) } - async fn get_raw_block_transactions( - &self, - block: T, - ) -> Result, ProviderError> + async fn get_raw_block_transactions(&self, block: T) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug, { - self.inner().get_raw_block_transactions(block).await + self.provider() + .request("zks_getRawBlockTransactions", [block]) + .await + .map_err(M::convert_err) } - async fn get_testnet_paymaster(&self) -> Result { - self.inner().get_testnet_paymaster().await + async fn get_testnet_paymaster(&self) -> Result { + self.provider() + .request("zks_getTestnetPaymaster", ()) + .await + .map_err(M::convert_err) } - async fn get_token_price(&self, address: Address) -> Result { - self.inner().get_token_price(address).await + async fn get_token_price(&self, address: Address) -> Result { + self.provider() + .request("zks_getTokenPrice", [address]) + .await + .map_err(M::convert_err) } async fn get_transaction_details( &self, hash: H256, - ) -> Result, ProviderError> { - self.inner().get_transaction_details(hash).await - } - - async fn get_l1_batch_number(&self) -> Result { - self.inner().get_l1_batch_number().await - } - - async fn get_l1_chain_id(&self) -> Result { - self.inner().get_l1_chain_id().await - } - - async fn debug_trace_block_by_hash( - &self, - hash: H256, - options: Option, - ) -> Result { - ZKSProvider::debug_trace_block_by_hash(self.inner(), hash, options).await - } - - async fn debug_trace_block_by_number( - &self, - block: T, - options: Option, - ) -> Result - where - T: Into + Send + Sync + Serialize + Debug, - { - ZKSProvider::debug_trace_block_by_number(self.inner(), block, options).await - } - - async fn debug_trace_call( - &self, - request: R, - block: Option, - options: Option, - ) -> Result - where - R: Debug + Serialize + Send + Sync, - T: Into + Send + Sync + Serialize + Debug, - { - ZKSProvider::debug_trace_call(self.inner(), request, block, options).await - } - - async fn debug_trace_transaction( - &self, - hash: H256, - options: Option, - ) -> Result { - ZKSProvider::debug_trace_transaction(self.inner(), hash, options).await - } - - async fn send_eip712( - &self, - wallet: &Wallet, - contract_address: Address, - function_signature: &str, - function_parameters: Option>, - overrides: Option, - ) -> Result, ProviderError> - where - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, - { - self.inner() - .send_eip712( - wallet, - contract_address, - function_signature, - function_parameters, - overrides, - ) + ) -> Result, Self::Error> { + self.provider() + .request("zks_getTransactionDetails", [hash]) .await + .map_err(M::convert_err) } - async fn send( - &self, - wallet: &Wallet, - contract_address: Address, - function_signature: &str, - function_parameters: Option>, - _overrides: Option, - ) -> Result, ProviderError> - where - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, - { - let tx = build_send_tx( - self, - wallet, - contract_address, - function_signature, - function_parameters, - _overrides, - ) - .await?; - self.send_transaction(tx, None) + async fn get_l1_batch_number(&self) -> Result { + self.provider() + .request("zks_L1BatchNumber", ()) .await - .map_err(|e| ProviderError::CustomError(format!("Error sending transaction: {e:?}"))) + .map_err(M::convert_err) } - async fn send_transaction_eip712( - &self, - wallet: &Wallet, - transaction: T, - ) -> Result, ProviderError> - where - T: TryInto + Sync + Send + Debug, - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, - { - self.inner() - .send_transaction_eip712(wallet, transaction) + async fn get_l1_chain_id(&self) -> Result { + self.provider() + .request("zks_L1ChainId", ()) .await + .map_err(M::convert_err) } - async fn wait_for_finalize( - &self, - transaction_receipt: TxHash, - polling_time_in_seconds: Option, - timeout_in_seconds: Option, - ) -> Result { - self.inner() - .wait_for_finalize( - transaction_receipt, - polling_time_in_seconds, - timeout_in_seconds, - ) + async fn get_base_token_l1_address(&self) -> Result { + self.provider() + .request("zks_getBaseTokenL1Address", ()) .await + .map_err(M::convert_err) } - async fn call(&self, request: &CallRequest) -> Result, ProviderError> { - ZKSProvider::call(self.inner(), request).await - } -} - -#[async_trait] -impl ZKSProvider for Provider

{ - type Provider = P; - type ZKProvider = P; - - async fn zk_estimate_gas(&self, transaction: T) -> Result - where - T: Debug + Serialize + Send + Sync, - { - self.request("eth_estimateGas", [transaction]).await - } - - async fn estimate_fee(&self, transaction: T) -> Result - where - T: Debug + Serialize + Send + Sync, - { - self.request("zks_estimateFee", [transaction]).await - } - - async fn estimate_gas_l1_to_l2(&self, transaction: T) -> Result - where - T: Debug + Serialize + Send + Sync, - { - self.request("zks_estimateGasL1ToL2", [transaction]).await - } - - async fn get_all_account_balances( - &self, - address: Address, - ) -> Result, ProviderError> { - self.request("zks_getAllAccountBalances", [address]).await - } - - async fn get_block_details(&self, block: T) -> Result, ProviderError> - where - T: Into + Send + Sync + Serialize + Debug, - { - self.request("zks_getBlockDetails", [block]).await - } - - async fn get_bridge_contracts(&self) -> Result { - self.request("zks_getBridgeContracts", ()).await - } - - async fn get_bytecode_by_hash(&self, hash: H256) -> Result>, ProviderError> { - self.request("zks_getBytecodeByHash", [hash]).await - } - - async fn get_confirmed_tokens( + async fn send_raw_transaction_with_detailed_output( &self, - from: u32, - limit: u8, - ) -> Result, ProviderError> { - self.request("zks_getConfirmedTokens", [from, limit.into()]) + tx: Bytes, + ) -> Result { + self.provider() + .request("zks_sendRawTransactionWithDetailedOutput", [tx]) .await - } - - async fn get_l1_batch_block_range(&self, batch: T) -> Result - where - T: Into + Send + Sync + Serialize + Debug, - { - self.request("zks_getL1BatchBlockRange", [batch]).await - } - - async fn get_l1_batch_details(&self, batch: T) -> Result - where - T: Into + Send + Sync + Serialize + Debug, - { - self.request("zks_getL1BatchDetails", [batch]).await - } - - async fn get_l2_to_l1_log_proof( - &self, - tx_hash: H256, - l2_to_l1_log_index: Option, - ) -> Result, ProviderError> { - self.request( - "zks_getL2ToL1LogProof", - json!([tx_hash, l2_to_l1_log_index]), - ) - .await - } - - async fn get_l2_to_l1_msg_proof( - &self, - block: T, - sender: Address, - msg: H256, - l2_log_position: Option, - ) -> Result, ProviderError> - where - T: Into + Send + Sync + Serialize + Debug, - { - self.request( - "zks_getL2ToL1MsgProof", - json!([block, sender, msg, l2_log_position]), - ) - .await - } - - async fn get_main_contract(&self) -> Result { - self.request("zks_getMainContract", ()).await - } - - async fn get_raw_block_transactions( - &self, - block: T, - ) -> Result, ProviderError> - where - T: Into + Send + Sync + Serialize + Debug, - { - self.request("zks_getRawBlockTransactions", [block]).await - } - - async fn get_testnet_paymaster(&self) -> Result { - self.request("zks_getTestnetPaymaster", ()).await - } - - async fn get_token_price(&self, address: Address) -> Result { - self.request("zks_getTokenPrice", [address]).await - } - - async fn get_transaction_details( - &self, - hash: H256, - ) -> Result, ProviderError> { - self.request("zks_getTransactionDetails", [hash]).await - } - - async fn get_l1_batch_number(&self) -> Result { - self.request("zks_L1BatchNumber", ()).await - } - - async fn get_l1_chain_id(&self) -> Result { - self.request("zks_L1ChainId", ()).await + .map_err(M::convert_err) } async fn debug_trace_block_by_hash( &self, hash: H256, options: Option, - ) -> Result { + ) -> Result, Self::Error> { let processable_response = self + .provider() .request::( "debug_traceBlockByHash", json!([hash, options]), ) - .await? + .await + .map_err(M::convert_err)? .get(0) .ok_or(ProviderError::CustomError( "error on debug_trace_block_by_hash".to_owned(), - ))? + )) + .map_err(M::convert_err)? .get("result") .ok_or(ProviderError::CustomError( "error on debug_trace_block_by_hash".to_owned(), - ))? + )) + .map_err(M::convert_err)? .clone(); - serde_json::from_value(processable_response).map_err(ProviderError::SerdeJson) + serde_json::from_value(processable_response) + .map_err(ProviderError::SerdeJson) + .map_err(M::convert_err) } async fn debug_trace_block_by_number( &self, block: T, options: Option, - ) -> Result + ) -> Result, Self::Error> where T: Into + Send + Sync + Serialize + Debug, { let processable_response = self + .provider() .request::( "debug_traceBlockByNumber", json!([block, options]), ) - .await? + .await + .map_err(M::convert_err)? .get(0) .ok_or(ProviderError::CustomError( "error on debug_trace_block_by_hash".to_owned(), - ))? + )) + .map_err(M::convert_err)? .get("result") .ok_or(ProviderError::CustomError( "error on debug_trace_block_by_hash".to_owned(), - ))? + )) + .map_err(M::convert_err)? .clone(); - serde_json::from_value(processable_response).map_err(ProviderError::SerdeJson) + serde_json::from_value(processable_response) + .map_err(ProviderError::SerdeJson) + .map_err(M::convert_err) } async fn debug_trace_call( @@ -673,36 +525,41 @@ impl ZKSProvider for Provider

{ request: R, block: Option, options: Option, - ) -> Result + ) -> Result where R: Debug + Serialize + Send + Sync, T: Into + Send + Sync + Serialize + Debug, { - self.request("debug_traceCall", json!([request, block, options])) + self.provider() + .request("debug_traceCall", json!([request, block, options])) .await + .map_err(M::convert_err) } async fn debug_trace_transaction( &self, hash: H256, options: Option, - ) -> Result { - self.request("debug_traceTransaction", json!([hash, options])) + ) -> Result, Self::Error> { + self.provider() + .request("debug_traceTransaction", json!([hash, options])) .await + .map_err(M::convert_err) } async fn send_transaction_eip712( &self, wallet: &Wallet, transaction: T, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where T: TryInto + Sync + Send + Debug, D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, { - let mut request: Eip712TransactionRequest = transaction.try_into().map_err(|_e| { - ProviderError::CustomError("error on send_transaction_eip712".to_owned()) - })?; + let mut request: Eip712TransactionRequest = transaction + .try_into() + .map_err(|_e| ProviderError::CustomError("error on send_transaction_eip712".to_owned())) + .map_err(M::convert_err)?; request = request .from(wallet.address()) @@ -720,17 +577,20 @@ impl ZKSProvider for Provider

{ let signable_data: Eip712Transaction = request .clone() .try_into() - .map_err(|e: Eip712Error| ProviderError::CustomError(e.to_string()))?; + .map_err(|e: Eip712Error| ProviderError::CustomError(e.to_string())) + .map_err(M::convert_err)?; let signature: Signature = wallet .sign_typed_data(&signable_data) .await - .map_err(|e| ProviderError::CustomError(format!("error signing transaction: {e}")))?; + .map_err(|e| ProviderError::CustomError(format!("error signing transaction: {e}"))) + .map_err(M::convert_err)?; request = request.custom_data(custom_data.custom_signature(signature.to_vec())); let encoded_rlp = &*request .rlp_signed(signature) - .map_err(|e| ProviderError::CustomError(format!("Error in the rlp encoding {e}")))?; + .map_err(|e| ProviderError::CustomError(format!("Error in the rlp encoding {e}"))) + .map_err(M::convert_err)?; - self.send_raw_transaction([&[EIP712_TX_TYPE], encoded_rlp].concat().into()) + self.send_raw_transaction([&[EIP_712_TX_TYPE], encoded_rlp].concat().into()) .await } @@ -741,14 +601,15 @@ impl ZKSProvider for Provider

{ function_signature: &str, function_parameters: Option>, overrides: Option, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, { - // Note: We couldn't implement ProviderError::LexerError because ethers-rs's LexerError is not exposed. + // Note: We couldn't implement Self::Error::LexerError because ethers-rs's LexerError is not exposed. // TODO check for ECADD precompile address to get the function signature. let function = HumanReadableParser::parse_function(function_signature) - .map_err(|e| ProviderError::CustomError(e.to_string()))?; + .map_err(|e| ProviderError::CustomError(e.to_string())) + .map_err(M::convert_err)?; let mut send_request = if let Some(overrides) = overrides { Eip712TransactionRequest::from_overrides(overrides) @@ -759,16 +620,18 @@ impl ZKSProvider for Provider

{ let function_args = if let Some(function_args) = function_parameters { function .decode_input( - &zks_utils::encode_args(&function, &function_args) - .map_err(|e| ProviderError::CustomError(e.to_string()))?, + &utils::encode_args(&function, &function_args) + .map_err(|e| ProviderError::CustomError(e.to_string())) + .map_err(M::convert_err)?, ) - .map_err(|e| ProviderError::CustomError(e.to_string()))? + .map_err(|e| ProviderError::CustomError(e.to_string())) + .map_err(M::convert_err)? } else { vec![] }; send_request = send_request - .r#type(EIP712_TX_TYPE) + .r#type(EIP_712_TX_TYPE) .from(wallet.address()) .to(contract_address) .chain_id(wallet.chain_id()) @@ -778,7 +641,8 @@ impl ZKSProvider for Provider

{ .data(if !function_args.is_empty() { function .encode_input(&function_args) - .map_err(|e| ProviderError::CustomError(e.to_string()))? + .map_err(|e| ProviderError::CustomError(e.to_string())) + .map_err(M::convert_err)? } else { function.short_signature().into() }); @@ -792,18 +656,21 @@ impl ZKSProvider for Provider

{ let signable_data: Eip712Transaction = send_request .clone() .try_into() - .map_err(|e: Eip712Error| ProviderError::CustomError(e.to_string()))?; + .map_err(|e: Eip712Error| ProviderError::CustomError(e.to_string())) + .map_err(M::convert_err)?; let signature: Signature = wallet .sign_typed_data(&signable_data) .await - .map_err(|e| ProviderError::CustomError(format!("error signing transaction: {e}")))?; + .map_err(|e| ProviderError::CustomError(format!("error signing transaction: {e}"))) + .map_err(M::convert_err)?; send_request = send_request.custom_data(Eip712Meta::new().custom_signature(signature.to_vec())); let encoded_rlp = &*send_request .rlp_signed(signature) - .map_err(|e| ProviderError::CustomError(format!("error encoding transaction: {e}")))?; - self.send_raw_transaction([&[EIP712_TX_TYPE], encoded_rlp].concat().into()) + .map_err(|e| ProviderError::CustomError(format!("error encoding transaction: {e}"))) + .map_err(M::convert_err)?; + self.send_raw_transaction([&[EIP_712_TX_TYPE], encoded_rlp].concat().into()) .await } @@ -814,7 +681,7 @@ impl ZKSProvider for Provider

{ function_signature: &str, function_parameters: Option>, _overrides: Option, - ) -> Result, ProviderError> + ) -> Result, Self::Error> where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, { @@ -826,7 +693,8 @@ impl ZKSProvider for Provider

{ function_parameters, _overrides, ) - .await?; + .await + .map_err(M::convert_err)?; self.send_transaction(tx, None).await } @@ -835,65 +703,45 @@ impl ZKSProvider for Provider

{ tx_hash: TxHash, polling_time_in_seconds: Option, timeout_in_seconds: Option, - ) -> Result { + ) -> Result { let polling_time_in_seconds = polling_time_in_seconds.unwrap_or(Duration::from_secs(2)); let mut timer = tokio::time::interval(polling_time_in_seconds); let start = Instant::now(); - let transaction_receipt = - self.get_transaction_receipt(tx_hash) - .await? - .ok_or(ProviderError::CustomError( - "No transaction receipt".to_owned(), - ))?; + let transaction_receipt = self + .get_transaction_receipt(tx_hash) + .await? + .ok_or(ProviderError::CustomError( + "No transaction receipt".to_owned(), + )) + .map_err(M::convert_err)?; loop { timer.tick().await; if let Some(timeout) = timeout_in_seconds { if start.elapsed() >= timeout { - return Err(ProviderError::CustomError( + return Err(M::convert_err(ProviderError::CustomError( "Error waiting for transaction to be included into the finalized block" .to_owned(), - )); + ))); } } // Wait for transaction to be included into the finalized block. - let latest_block = - self.get_block(BlockNumber::Finalized) - .await? - .ok_or(ProviderError::CustomError( - "Error getting finalized block".to_owned(), - ))?; + let latest_block = self + .get_block(BlockNumber::Finalized) + .await? + .ok_or(ProviderError::CustomError( + "Error getting finalized block".to_owned(), + )) + .map_err(M::convert_err)?; if transaction_receipt.block_number <= latest_block.number { return Ok(transaction_receipt); } } } - - async fn call(&self, request: &CallRequest) -> Result, ProviderError> { - let function = request - .get_parsed_function() - .map_err(|e| ProviderError::CustomError(format!("Failed to parse function: {e}")))?; - let request: Eip1559TransactionRequest = request - .clone() - .try_into() - .map_err(|e| ProviderError::CustomError(format!("Failed to convert request: {e}")))?; - let transaction: TypedTransaction = request.into(); - - let encoded_output = Middleware::call(self, &transaction, None).await?; - let decoded_output = function.decode_output(&encoded_output).map_err(|e| { - ProviderError::CustomError(format!("failed to decode output: {e}\n{encoded_output}")) - })?; - - Ok(if decoded_output.is_empty() { - encoded_output.into_tokens() - } else { - decoded_output - }) - } } async fn build_send_tx( @@ -913,7 +761,7 @@ where let function_args = if let Some(function_args) = function_parameters { function .decode_input( - &zks_utils::encode_args(&function, &function_args) + &utils::encode_args(&function, &function_args) .map_err(|e| ProviderError::CustomError(e.to_string()))?, ) .map_err(|e| ProviderError::CustomError(e.to_string()))? @@ -941,9 +789,9 @@ where }) .value(0_u8) //FIXME we should use default calculation for gas related fields. - .gas(DEFAULT_GAS) - .max_fee_per_gas(MAX_FEE_PER_GAS) - .max_priority_fee_per_gas(MAX_PRIORITY_FEE_PER_GAS); + .gas(utils::DEFAULT_GAS) + .max_fee_per_gas(utils::MAX_FEE_PER_GAS) + .max_priority_fee_per_gas(utils::MAX_PRIORITY_FEE_PER_GAS); Ok(send_request.into()) } diff --git a/src/zks_provider/types.rs b/src/zks_provider/types.rs deleted file mode 100644 index bd0524b..0000000 --- a/src/zks_provider/types.rs +++ /dev/null @@ -1,188 +0,0 @@ -use ethers::types::{Address, Bytes, H256, U256, U64}; -use serde::{Deserialize, Serialize}; -use std::collections::HashMap; - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct Fee { - pub gas_limit: U256, - pub gas_per_pubdata_limit: U256, - pub max_fee_per_gas: U256, - pub max_priority_fee_per_gas: U256, -} - -impl Copy for Fee {} - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct BlockDetails { - pub base_system_contracts_hashes: BaseSystemContractsHashes, - #[serde(skip_serializing_if = "Option::is_none")] - pub commit_tx_hash: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub committed_at: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub execute_tx_hash: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub executed_at: Option, - pub l1_batch_number: u128, - pub l1_gas_price: u128, - pub l1_tx_count: u128, - pub l2_fair_gas_price: u128, - pub l2_tx_count: u128, - pub number: u128, - pub operator_address: Address, - #[serde(skip_serializing_if = "Option::is_none")] - pub prove_tx_hash: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub proven_at: Option, - pub root_hash: H256, - pub status: String, - pub timestamp: u128, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct BaseSystemContractsHashes { - pub bootloader: H256, - pub default_aa: H256, -} - -impl Copy for BaseSystemContractsHashes {} - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct BridgeContracts { - pub l1_erc20_default_bridge: Address, - pub l2_erc20_default_bridge: Address, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct TokenInfo { - pub decimals: U64, - pub l1_address: Address, - pub l2_address: Address, - pub name: String, - pub symbol: String, -} - -pub type BlockRange = Vec; - -// TODO: Complete struct. -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct L1BatchDetails { - pub base_system_contracts_hashes: BaseSystemContractsHashes, - pub commit_tx_hash: H256, - pub committed_at: String, - pub execute_tx_hash: H256, - pub executed_at: String, - pub l1_gas_price: u128, - pub l1_tx_count: u128, - pub l2_fair_gas_price: u128, - pub l2_tx_count: u128, - pub number: u128, - pub prove_tx_hash: H256, - pub proven_at: String, - pub root_hash: H256, - pub status: String, - pub timestamp: u128, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Proof { - pub id: u64, - #[serde(rename = "proof")] - pub merkle_proof: Vec, - pub root: Bytes, -} - -// TODO: Complete struct. -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct Transaction { - pub common_data: CommonData, - pub execute: Execute, - pub received_timestamp_ms: u64, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct CommonData { - #[serde(rename = "L1")] - pub l1: L1, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct L1 { - pub canonical_tx_hash: H256, - pub deadline_block: u64, - pub eth_block: u64, - pub eth_hash: H256, - pub full_fee: U256, - pub gas_limit: U256, - pub gas_per_pubdata_limit: U256, - pub layer2_tip_fee: U256, - pub max_fee_per_gas: U256, - pub op_processing_type: String, - pub priority_queue_type: String, - pub refund_recipient: Address, - pub sender: Address, - pub serial_id: u64, - pub to_mint: U256, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Execute { - pub calldata: Bytes, - pub contract_address: Address, - pub factory_deps: Vec>, - pub value: U256, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct TransactionDetails { - pub eth_commit_tx_hash: H256, - pub eth_execute_tx_hash: H256, - pub eth_prove_tx_hash: H256, - pub fee: U256, - pub initiator_address: Address, - pub is_l1_originated: bool, - pub received_at: String, - pub status: String, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct TracerConfig { - #[serde(skip_serializing_if = "Option::is_none")] - pub disable_storage: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub disable_stack: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub enable_memory: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub enable_return_data: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub tracer: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub tracer_config: Option>, -} - -// TODO: Check correct types for the ones using serde_json::Value. -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct DebugTrace { - calls: Vec, - error: Option, - from: Address, - gas: U256, - gas_used: U256, - input: Bytes, - output: Bytes, - revert_reason: Option, - to: Address, - r#type: String, - value: U256, -} From 00c30d3d1a6139084b12f788b40997245f7e833b Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 12:58:52 +0200 Subject: [PATCH 10/75] Remove old wallet impl --- src/zks_wallet/DepositERC20GasLimit.json | 42 -- src/zks_wallet/errors.rs | 68 -- src/zks_wallet/mod.rs | 16 - src/zks_wallet/requests/call_request.rs | 81 --- src/zks_wallet/requests/deploy_request.rs | 37 - src/zks_wallet/requests/deposit_request.rs | 103 --- src/zks_wallet/requests/mod.rs | 5 - src/zks_wallet/requests/transfer_request.rs | 43 -- src/zks_wallet/requests/withdraw_request.rs | 30 - src/zks_wallet/wallet.rs | 704 -------------------- 10 files changed, 1129 deletions(-) delete mode 100644 src/zks_wallet/DepositERC20GasLimit.json delete mode 100644 src/zks_wallet/errors.rs delete mode 100644 src/zks_wallet/mod.rs delete mode 100644 src/zks_wallet/requests/call_request.rs delete mode 100644 src/zks_wallet/requests/deploy_request.rs delete mode 100644 src/zks_wallet/requests/deposit_request.rs delete mode 100644 src/zks_wallet/requests/mod.rs delete mode 100644 src/zks_wallet/requests/transfer_request.rs delete mode 100644 src/zks_wallet/requests/withdraw_request.rs delete mode 100644 src/zks_wallet/wallet.rs diff --git a/src/zks_wallet/DepositERC20GasLimit.json b/src/zks_wallet/DepositERC20GasLimit.json deleted file mode 100644 index 8116e44..0000000 --- a/src/zks_wallet/DepositERC20GasLimit.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "0x0000000000095413afc295d19edeb1ad7b71c952": 140000, - "0xeb4c2781e4eba804ce9a9803c67d0893436bb27d": 160000, - "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd": 140000, - "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac": 140000, - "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984": 150000, - "0x9ba00d6856a4edf4665bca2c2309936572473b7e": 270000, - "0x8daebade922df735c38c80c7ebd708af50815faa": 140000, - "0x0d8775f648430679a709e98d2b0cb6250d2887ef": 140000, - "0xdac17f958d2ee523a2206206994597c13d831ec7": 140000, - "0x6de037ef9ad2725eb40118bb1702ebb27e4aeb24": 150000, - "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd": 180000, - "0x0f5d2fb29fb7d3cfee444a200298f468908cc942": 140000, - "0x514910771af9ca656af840dff83e8264ecf986ca": 140000, - "0x1985365e9f78359a9b6ad760e32412f4a445e862": 180000, - "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599": 140000, - "0xe41d2489571d322189246dafa5ebde1f4699f498": 140000, - "0x6b175474e89094c44da98b954eedeac495271d0f": 140000, - "0xaaaebe6fe48e54f431b0c390cfaf0b017d09d42d": 150000, - "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39": 140000, - "0x65ece136b89ebaa72a7f7aa815674946e44ca3f9": 140000, - "0x0000000000085d4780b73119b644ae5ecd22b376": 150000, - "0xdb25f211ab05b1c97d595516f45794528a807ad8": 180000, - "0x408e41876cccdc0f92210600ef50372656052a38": 140000, - "0x15a2b3cfafd696e1c783fe99eed168b78a3a371e": 160000, - "0x38e4adb44ef08f22f5b5b76a8f0c2d0dcbe7dca1": 160000, - "0x3108ccfd96816f9e663baa0e8c5951d229e8c6da": 140000, - "0x56d811088235f11c8920698a204a5010a788f4b3": 240000, - "0x57ab1ec28d129707052df4df418d58a2d46d5f51": 220000, - "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2": 140000, - "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": 150000, - "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f": 200000, - "0x744d70fdbe2ba4cf95131626614a1763df805b9e": 230000, - "0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e": 140000, - "0x4c7065bca76fe44afb0d16c2441b1e6e163354e2": 250000, - "0xdd974d5c2e2928dea5f71b9825b8b646686bd200": 140000, - "0x80fb784b7ed66730e8b1dbd9820afd29931aab03": 140000, - "0xd56dac73a4d6766464b38ec6d91eb45ce7457c44": 140000, - "0x4fabb145d64652a948d72533023f6e7a623c7c53": 150000, - "0x38a2fdc11f526ddd5a607c1f251c065f40fbf2f7": 140000, - "0x7dd9c5cba05e151c895fde1cf355c9a1d5da6429": 140000 -} diff --git a/src/zks_wallet/errors.rs b/src/zks_wallet/errors.rs deleted file mode 100644 index 317e456..0000000 --- a/src/zks_wallet/errors.rs +++ /dev/null @@ -1,68 +0,0 @@ -use ethers::{ - abi::{Error, ParseError}, - prelude::{ - k256::{ - ecdsa::{RecoveryId, Signature as RecoverableSignature}, - schnorr::signature::hazmat::PrehashSigner, - }, - signer::SignerMiddlewareError, - AbiError, ContractError, SignerMiddleware, - }, - providers::{Middleware, ProviderError}, - signers::{Wallet, WalletError}, - types::transaction::eip712::Eip712Error, -}; - -use crate::contracts::main_contract::MainContractError; - -#[derive(thiserror::Error, Debug)] -pub enum ZKSWalletError -where - M: Middleware, - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Sync + Send, -{ - #[error("Provider error: {0}")] - ProviderError(#[from] ProviderError), - #[error("Middleware error: {0}")] - MiddlewareError(#[from] SignerMiddlewareError>), - #[error("Wallet error: {0}")] - EthWalletError(#[from] WalletError), - #[error("ABI error: {0}")] - AbiError(#[from] AbiError), - #[error("EIP712 error: {0}")] - Eip712Error(#[from] Eip712Error), - #[error("No L1 Ethereum provider")] - NoL1ProviderError(), - #[error("No L2 Ethereum provider")] - NoL2ProviderError(), - #[error("Contract error: {0}")] - ContractError(#[from] ContractError), - #[error("Contract error: {0}")] - RequestConversionError(#[from] ZKRequestError), - #[error("{0}")] - CustomError(String), - #[error("Main contract error: {0}")] - MainContractError(#[from] MainContractError), -} - -impl From>>> for ZKSWalletError -where - M: Middleware, - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Sync + Send, -{ - fn from(value: ContractError>>) -> Self { - Self::CustomError(format!("{value:?}")) - } -} - -#[derive(thiserror::Error, Debug)] -pub enum ZKRequestError { - #[error("Error parsing function: {0}")] - ParseFunctionError(#[from] ParseError), - #[error("ABI error: {0}")] - AbiError(#[from] AbiError), - #[error("Encoding or decoding error: {0}")] - Error(#[from] Error), - #[error("{0}")] - CustomError(String), -} diff --git a/src/zks_wallet/mod.rs b/src/zks_wallet/mod.rs deleted file mode 100644 index f408b6c..0000000 --- a/src/zks_wallet/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -mod errors; -pub use errors::{ZKRequestError, ZKSWalletError}; - -mod requests; -pub use requests::{ - call_request::CallRequest, deploy_request::DeployRequest, deposit_request::DepositRequest, - transfer_request::TransferRequest, withdraw_request::WithdrawRequest, -}; - -mod wallet; -pub use wallet::ZKSWallet; - -use ethers::types::U256; -pub struct Overrides { - pub value: Option, -} diff --git a/src/zks_wallet/requests/call_request.rs b/src/zks_wallet/requests/call_request.rs deleted file mode 100644 index 90e5985..0000000 --- a/src/zks_wallet/requests/call_request.rs +++ /dev/null @@ -1,81 +0,0 @@ -use ethers::{ - abi::{encode, Function, HumanReadableParser, ParseError}, - types::{Address, Eip1559TransactionRequest}, -}; -use std::fmt::Debug; - -use crate::{ - zks_utils::{self, is_precompile}, - zks_wallet::errors::ZKRequestError, -}; - -#[derive(Clone, Debug)] -pub struct CallRequest { - pub to: Address, - pub function_signature: String, - pub function_parameters: Option>, -} - -impl CallRequest { - pub fn new(to: Address, function_signature: String) -> Self { - Self { - to, - function_signature, - function_parameters: None, - } - } - - pub fn function_parameters(mut self, function_parameters: Vec) -> Self { - self.function_parameters = Some(function_parameters); - self - } - - pub fn to(mut self, to: Address) -> Self { - self.to = to; - self - } - - pub fn function_signature(mut self, function_signature: String) -> Self { - self.function_signature = function_signature; - self - } - - pub fn get_parsed_function(&self) -> Result { - if self.to == zks_utils::ECADD_PRECOMPILE_ADDRESS { - Ok(zks_utils::ec_add_function()) - } else if self.to == zks_utils::ECMUL_PRECOMPILE_ADDRESS { - Ok(zks_utils::ec_mul_function()) - } else if self.to == zks_utils::MODEXP_PRECOMPILE_ADDRESS { - Ok(zks_utils::mod_exp_function()) - } else { - HumanReadableParser::parse_function(&self.function_signature) - .map_err(ParseError::LexerError) - } - } -} - -impl TryFrom for Eip1559TransactionRequest { - type Error = ZKRequestError; - - fn try_from(request: CallRequest) -> Result { - let function = request.get_parsed_function()?; - let function_args = if let Some(function_args) = request.function_parameters { - function.decode_input(&zks_utils::encode_args(&function, &function_args)?)? - } else { - vec![] - }; - - let data = match (!function_args.is_empty(), is_precompile(request.to)) { - // The contract to call is a precompile with arguments. - (true, true) => encode(&function_args), - // The contract to call is a regular contract with arguments. - (true, false) => function.encode_input(&function_args)?, - // The contract to call is a precompile without arguments. - (false, true) => Default::default(), - // The contract to call is a regular contract without arguments. - (false, false) => function.short_signature().into(), - }; - - Ok(Eip1559TransactionRequest::new().to(request.to).data(data)) - } -} diff --git a/src/zks_wallet/requests/deploy_request.rs b/src/zks_wallet/requests/deploy_request.rs deleted file mode 100644 index 26bb6db..0000000 --- a/src/zks_wallet/requests/deploy_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -use ethers::{abi::Abi, types::Address}; -use std::fmt::Debug; - -#[derive(Clone, Debug)] -pub struct DeployRequest { - pub contract_abi: Abi, - pub contract_bytecode: Vec, - pub constructor_parameters: Vec, - pub from: Address, - pub factory_deps: Option>>, -} - -impl DeployRequest { - pub fn with( - contract_abi: Abi, - contract_bytecode: Vec, - constructor_parameters: Vec, - ) -> Self { - Self { - contract_abi, - contract_bytecode, - constructor_parameters, - from: Default::default(), - factory_deps: None, - } - } - - pub fn from(mut self, from: Address) -> Self { - self.from = from; - self - } - - pub fn factory_deps(mut self, factory_deps: Vec>) -> Self { - self.factory_deps = Some(factory_deps); - self - } -} diff --git a/src/zks_wallet/requests/deposit_request.rs b/src/zks_wallet/requests/deposit_request.rs deleted file mode 100644 index aefe22f..0000000 --- a/src/zks_wallet/requests/deposit_request.rs +++ /dev/null @@ -1,103 +0,0 @@ -use crate::types::{Address, U256}; - -use crate::zks_utils::{ - DEPOSIT_GAS_PER_PUBDATA_LIMIT, ETHER_L1_ADDRESS, RECOMMENDED_DEPOSIT_L1_GAS_LIMIT, - RECOMMENDED_DEPOSIT_L2_GAS_LIMIT, -}; - -fn default_gas_limit() -> U256 { - RECOMMENDED_DEPOSIT_L1_GAS_LIMIT.into() -} - -fn default_l2_gas_limit() -> U256 { - RECOMMENDED_DEPOSIT_L2_GAS_LIMIT.into() -} - -fn default_gas_per_pubdata_byte() -> U256 { - DEPOSIT_GAS_PER_PUBDATA_LIMIT.into() -} - -#[derive(Clone, Debug)] -pub struct DepositRequest { - pub amount: U256, - pub to: Option

, - pub l2_gas_limit: U256, - pub gas_per_pubdata_byte: U256, - pub operator_tip: U256, - pub gas_price: Option, - pub gas_limit: U256, - pub token: Address, - pub bridge_address: Option
, -} - -impl DepositRequest { - pub fn new(amount: U256) -> Self { - Self { - amount, - to: None, - l2_gas_limit: default_l2_gas_limit(), - gas_per_pubdata_byte: default_gas_per_pubdata_byte(), - operator_tip: 0_i32.into(), - gas_price: None, - gas_limit: default_gas_limit(), - token: ETHER_L1_ADDRESS, - bridge_address: None, - } - } - - pub fn amount(&self) -> &U256 { - &self.amount - } - - pub fn to(mut self, address: Address) -> Self { - self.to = Some(address); - self - } - - pub fn l2_gas_limit(mut self, value: Option) -> Self { - self.l2_gas_limit = match value { - Some(l2_gas_limit) => l2_gas_limit, - None => default_l2_gas_limit(), - }; - self - } - - pub fn gas_per_pubdata_byte(mut self, value: Option) -> Self { - self.gas_per_pubdata_byte = match value { - Some(gas_per_pubdata_byte) => gas_per_pubdata_byte, - None => default_gas_per_pubdata_byte(), - }; - self - } - - pub fn operator_tip(mut self, operator_tip: U256) -> Self { - self.operator_tip = operator_tip; - self - } - - pub fn gas_price(mut self, value: Option) -> Self { - self.gas_price = value; - self - } - - pub fn gas_limit(mut self, value: Option) -> Self { - self.gas_limit = match value { - Some(gas_limit) => gas_limit, - _ => default_gas_limit(), - }; - self - } - - pub fn token(mut self, token: Option
) -> Self { - self.token = match token { - Some(address) => address, - _ => ETHER_L1_ADDRESS, - }; - self - } - - pub fn bridge_address(mut self, bridge_address: Option
) -> Self { - self.bridge_address = bridge_address; - self - } -} diff --git a/src/zks_wallet/requests/mod.rs b/src/zks_wallet/requests/mod.rs deleted file mode 100644 index f19ae5b..0000000 --- a/src/zks_wallet/requests/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod call_request; -pub mod deploy_request; -pub mod deposit_request; -pub mod transfer_request; -pub mod withdraw_request; diff --git a/src/zks_wallet/requests/transfer_request.rs b/src/zks_wallet/requests/transfer_request.rs deleted file mode 100644 index 7f8ffe9..0000000 --- a/src/zks_wallet/requests/transfer_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -use ethers::types::{Address, Eip1559TransactionRequest, U256}; -use std::fmt::Debug; - -#[derive(Clone, Debug)] -pub struct TransferRequest { - pub amount: U256, - pub to: Address, - pub from: Address, -} - -impl TransferRequest { - pub fn new(amount: U256) -> Self { - Self { - amount, - to: Default::default(), - from: Default::default(), - } - } - - pub fn from(mut self, from: Address) -> Self { - self.from = from; - self - } - - pub fn to(mut self, to: Address) -> Self { - self.to = to; - self - } - - pub fn amount(mut self, amount: U256) -> Self { - self.amount = amount; - self - } -} - -impl From for Eip1559TransactionRequest { - fn from(request: TransferRequest) -> Eip1559TransactionRequest { - Eip1559TransactionRequest::new() - .to(request.to) - .value(request.amount) - .from(request.from) - } -} diff --git a/src/zks_wallet/requests/withdraw_request.rs b/src/zks_wallet/requests/withdraw_request.rs deleted file mode 100644 index f126efb..0000000 --- a/src/zks_wallet/requests/withdraw_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -use std::fmt::Debug; - -use ethers::types::{Address, U256}; - -#[derive(Clone, Debug)] -pub struct WithdrawRequest { - pub amount: U256, - pub to: Address, - pub from: Address, -} - -impl WithdrawRequest { - pub fn new(amount: U256) -> Self { - Self { - amount, - to: Default::default(), - from: Default::default(), - } - } - - pub fn to(mut self, to: Address) -> Self { - self.to = to; - self - } - - pub fn from(mut self, from: Address) -> Self { - self.from = from; - self - } -} diff --git a/src/zks_wallet/wallet.rs b/src/zks_wallet/wallet.rs deleted file mode 100644 index 51b4393..0000000 --- a/src/zks_wallet/wallet.rs +++ /dev/null @@ -1,704 +0,0 @@ -use super::ZKSWalletError; -use super::{ - requests::transfer_request::TransferRequest, DeployRequest, DepositRequest, WithdrawRequest, -}; -use crate::zks_utils::{ - DEFAULT_ERC20_DEPOSIT_GAS_LIMIT, DEPOSIT_GAS_PER_PUBDATA_LIMIT, ERA_MAINNET_CHAIN_ID, -}; -use crate::{ - abi, - contracts::main_contract::{MainContract, MainContractInstance}, - eip712::Eip712Transaction, - eip712::{hash_bytecode, Eip712Meta, Eip712TransactionRequest}, - types::TransactionReceipt, - zks_provider::ZKSProvider, - zks_utils::{self, CONTRACT_DEPLOYER_ADDR, EIP712_TX_TYPE, ETHER_L1_ADDRESS, ETH_CHAIN_ID}, -}; -use ethers::{ - abi::{decode, Abi, ParamType, Tokenizable}, - prelude::{ - encode_function_data, - k256::{ - ecdsa::{RecoveryId, Signature as RecoverableSignature}, - schnorr::signature::hazmat::PrehashSigner, - }, - MiddlewareBuilder, SignerMiddleware, - }, - providers::Middleware, - signers::{Signer, Wallet}, - types::{ - transaction::eip2718::TypedTransaction, Address, Bytes, Eip1559TransactionRequest, Log, - Signature, H160, H256, U256, - }, -}; -use lazy_static::lazy_static; -use serde_json::{Map, Value}; -use std::collections::HashMap; -use std::{fs::File, io::BufReader, path::PathBuf, str::FromStr, sync::Arc}; -use zksync_web3_rs::core::abi::Tokenize; - -const RAW_ERC20_DEPOSIT_GAS_LIMIT: &str = include_str!("DepositERC20GasLimit.json"); - -lazy_static! { - static ref ERC20_DEPOSIT_GAS_LIMITS: HashMap = { - #![allow(clippy::expect_used)] - let mut m = HashMap::new(); - let raw: Map = serde_json::from_str(RAW_ERC20_DEPOSIT_GAS_LIMIT) - .expect("Failed to parse DepositERC20GasLimit.json"); - for (address, value) in raw.iter() { - m.insert( - address.to_owned(), - value - .as_u64() - .expect("Failed to ERC20 deposit gas limit for address {address:?}"), - ); - } - m - }; -} - -#[derive(Clone, Debug)] -pub struct ZKSWallet -where - M: Middleware + Clone, - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Clone, -{ - /// Eth provider - pub eth_provider: Option>>>, - pub era_provider: Option>>>, - pub l2_wallet: Wallet, - pub l1_wallet: Wallet, -} - -impl ZKSWallet -where - M: Middleware + 'static + Clone, - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Sync + Send + Clone, -{ - pub fn new( - l2_wallet: Wallet, - l1_wallet: Option>, - era_provider: Option, - eth_provider: Option, - ) -> Result> { - let l1_wallet = match l1_wallet { - Some(wallet) => wallet, - None => l2_wallet.clone().with_chain_id(ETH_CHAIN_ID), - }; - Ok(Self { - l2_wallet: l2_wallet.clone(), - l1_wallet: l1_wallet.clone(), - era_provider: era_provider.map(|p| p.with_signer(l2_wallet).into()), - eth_provider: eth_provider.map(|p| p.with_signer(l1_wallet).into()), - }) - } - - pub fn connect_eth_provider(mut self, eth_provider: M) -> Self { - self.eth_provider = Some(eth_provider.with_signer(self.l1_wallet.clone()).into()); - self - } - - pub fn connect_era_provider(mut self, era_provider: M) -> Self { - self.era_provider = Some(era_provider.with_signer(self.l2_wallet.clone()).into()); - self - } - - pub fn connect_eth_signer(mut self, eth_signer: SignerMiddleware>) -> Self { - self.eth_provider = Some(eth_signer.into()); - self - } - - pub fn connect_era_signer(mut self, era_signer: SignerMiddleware>) -> Self { - self.era_provider = Some(era_signer.into()); - self - } - - // pub fn connect_eth(&mut self, host: &str, port: u16) { - // self.eth_provider = Provider::try_from(format!("http://{host}:{port}")).ok().map(|p| p.with_signer(self.wallet)); - // } - - // pub fn connect_era(&mut self, host: &str, port: u16) { - // self.era_provider = Provider::try_from(format!("http://{host}:{port}")).ok().map(|p| p.with_signer(self.wallet)); - // } - - pub fn l2_address(&self) -> Address { - self.l2_wallet.address() - } - - pub fn l1_address(&self) -> Address { - self.l1_wallet.address() - } - - pub fn l2_chain_id(&self) -> u64 { - self.l2_wallet.chain_id() - } - - pub fn l1_chain_id(&self) -> u64 { - self.l1_wallet.chain_id() - } - - pub fn get_eth_provider( - &self, - ) -> Result>>, ZKSWalletError> { - match &self.eth_provider { - Some(eth_provider) => Ok(Arc::clone(eth_provider)), - None => Err(ZKSWalletError::NoL1ProviderError()), - } - } - - pub fn get_era_provider( - &self, - ) -> Result>>, ZKSWalletError> { - match &self.era_provider { - Some(era_provider) => Ok(Arc::clone(era_provider)), - None => Err(ZKSWalletError::NoL2ProviderError()), - } - } - - pub async fn eth_balance(&self) -> Result> - where - M: ZKSProvider, - { - match &self.eth_provider { - // TODO: Should we have a balance_on_block method? - Some(eth_provider) => Ok(eth_provider.get_balance(self.l1_address(), None).await?), - None => Err(ZKSWalletError::CustomError("no eth provider".to_owned())), - } - } - - pub async fn era_balance(&self) -> Result> - where - M: ZKSProvider, - { - match &self.era_provider { - // TODO: Should we have a balance_on_block method? - Some(era_provider) => Ok(era_provider.get_balance(self.l2_address(), None).await?), - None => Err(ZKSWalletError::CustomError("no era provider".to_owned())), - } - } - - pub async fn transfer( - &self, - request: &TransferRequest, - // TODO: Support multiple-token transfers. - _token: Option
, - ) -> Result> - where - M: ZKSProvider, - { - let era_provider = self.get_era_provider()?; - - let mut transfer_request: Eip1559TransactionRequest = request.clone().into(); - - let fee = era_provider.estimate_fee(transfer_request.clone()).await?; - transfer_request = transfer_request.max_priority_fee_per_gas(fee.max_priority_fee_per_gas); - transfer_request = transfer_request.max_fee_per_gas(fee.max_fee_per_gas); - - let transaction: TypedTransaction = transfer_request.into(); - - // TODO: add block as an override. - let transaction_receipt = era_provider - .send_transaction(transaction, None) - .await? - .await? - .ok_or(ZKSWalletError::CustomError( - "No transaction receipt".to_owned(), - ))?; - - Ok(transaction_receipt.transaction_hash) - } - - pub async fn transfer_eip712( - &self, - request: &TransferRequest, - // TODO: Support multiple-token transfers. - _token: Option
, - ) -> Result> - where - M: ZKSProvider, - { - let era_provider = self.get_era_provider()?; - - let transaction_receipt = era_provider - .send_transaction_eip712(&self.l2_wallet, request.clone()) - .await? - .await? - .ok_or(ZKSWalletError::CustomError( - "No transaction receipt".to_owned(), - ))?; - - Ok(transaction_receipt.transaction_hash) - } - - pub async fn deposit(&self, request: &DepositRequest) -> Result> - where - M: ZKSProvider, - { - let to = request.to.unwrap_or(self.l2_address()); - let call_data = Bytes::default(); - let l2_gas_limit: U256 = request.l2_gas_limit; - let l2_value = request.amount; - let gas_per_pubdata_byte: U256 = request.gas_per_pubdata_byte; - let gas_price = request - .gas_price - .unwrap_or(self.get_eth_provider()?.get_gas_price().await?); - let gas_limit: U256 = request.gas_limit; - let operator_tip: U256 = request.operator_tip; - let base_cost = self - .get_base_cost(gas_limit, gas_per_pubdata_byte, gas_price) - .await?; - let l1_value = base_cost + operator_tip + request.amount; - // let factory_deps = []; - let refund_recipient = self.l1_address(); - // FIXME check base cost - - let receipt = if request.token == ETHER_L1_ADDRESS { - let main_contract_address = self.get_era_provider()?.get_main_contract().await?; - let main_contract = - MainContractInstance::new(main_contract_address, self.get_eth_provider()?); - - main_contract - .request_l2_transaction( - to, - l2_value, - call_data, - l2_gas_limit, - gas_per_pubdata_byte, - Default::default(), - refund_recipient, - gas_price, - gas_limit, - l1_value, - ) - .await? - } else { - self.deposit_erc20_token( - request.token, - request.amount().to_owned(), - to, - operator_tip, - request.bridge_address, - None, - Some(gas_price), - ) - .await? - }; - - Ok(receipt.transaction_hash) - } - - async fn deposit_erc20_token( - &self, - l1_token_address: Address, - amount: U256, - to: Address, - operator_tip: U256, - bridge_address: Option
, - max_fee_per_gas: Option, - gas_price: Option, - ) -> Result> - where - M: ZKSProvider, - { - let eth_provider = self.get_eth_provider()?; - let era_provider = self.get_era_provider()?; - - let gas_limit: U256 = { - let address_str = format!("{l1_token_address:?}"); - let is_mainnet = - self.get_era_provider()?.get_chainid().await? == ERA_MAINNET_CHAIN_ID.into(); - if is_mainnet { - (*ERC20_DEPOSIT_GAS_LIMITS) - .get(&address_str) - .unwrap_or(&DEFAULT_ERC20_DEPOSIT_GAS_LIMIT) - .to_owned() - } else { - DEFAULT_ERC20_DEPOSIT_GAS_LIMIT - } - } - .into(); - - // If the user has already provided max_fee_per_gas or gas_price, we will use - // it to calculate the base cost for the transaction - let gas_price = if let Some(max_fee_per_gas) = max_fee_per_gas { - max_fee_per_gas - } else if let Some(gas_price) = gas_price { - gas_price - } else { - era_provider.get_gas_price().await? - }; - - let l2_gas_limit = U256::from(3_000_000_u32); - - let base_cost: U256 = self - .get_base_cost( - l2_gas_limit, - DEPOSIT_GAS_PER_PUBDATA_LIMIT.into(), - gas_price, - ) - .await?; - - // ERC20 token, `msg.value` is used only for the fee. - let value = base_cost + operator_tip; - - let data: Bytes = { - let bridge_contract = abi::l1_bridge_contract(); - - #[allow(clippy::expect_used)] - let contract_function = bridge_contract - .function("deposit") - .expect("failed to get deposit function parameters"); - - let params = ( - to, - l1_token_address, - amount, - l2_gas_limit, - U256::from(DEPOSIT_GAS_PER_PUBDATA_LIMIT), - ); - - #[allow(clippy::expect_used)] - contract_function - .encode_input(¶ms.into_tokens()) - .expect("failed to encode deposit function parameters") - .into() - }; - - let chain_id = eth_provider.get_chainid().await?.as_u64(); - - let bridge_address: Address = match bridge_address { - Some(address) => address, - None => { - let bridge_contracts = era_provider.get_bridge_contracts().await?; - bridge_contracts.l1_erc20_default_bridge - } - }; - - let deposit_transaction = Eip1559TransactionRequest { - from: Some(self.get_eth_provider()?.address()), - to: Some(bridge_address.into()), - gas: Some(gas_limit), - value: Some(value), - data: Some(data), - nonce: None, - access_list: Default::default(), - max_priority_fee_per_gas: None, // FIXME - max_fee_per_gas: None, // FIXME - chain_id: Some(chain_id.into()), - }; - - let _approve_tx_receipt = self - .approve_erc20(bridge_address, amount, l1_token_address) - .await?; - let pending_transaction = eth_provider - .send_transaction(deposit_transaction, None) - .await?; - - pending_transaction - .await? - .ok_or(ZKSWalletError::CustomError( - "no transaction receipt".to_owned(), - )) - } - - async fn approve_erc20( - &self, - bridge: Address, - amount: U256, - token: Address, - ) -> Result> - where - M: ZKSProvider, - { - let provider = self.get_eth_provider()?; - let function_signature = - "function approve(address spender,uint256 amount) public virtual returns (bool)"; - let parameters = [format!("{bridge:?}"), format!("{amount:?}")]; - let response = provider - .send( - &self.l1_wallet, - token, - function_signature, - Some(parameters.into()), - None, - ) - .await?; - - response.await?.ok_or(ZKSWalletError::CustomError( - "No transaction receipt for erc20 approval".to_owned(), - )) - } - - async fn get_base_cost( - &self, - gas_limit: U256, - gas_per_pubdata_byte: U256, - gas_price: U256, - ) -> Result> - where - M: ZKSProvider, - { - let main_contract_address = self.get_era_provider()?.get_main_contract().await?; - let main_contract = MainContract::new(main_contract_address, self.get_eth_provider()?); - let base_cost: U256 = main_contract - .l_2_transaction_base_cost(gas_price, gas_limit, gas_per_pubdata_byte) - .call() - .await?; - - Ok(base_cost) - } - - pub async fn deploy_from_bytecode( - &self, - contract_bytecode: &[u8], - contract_dependencies: Option>>, - // TODO: accept constructor parameters. - _constructor_parameters: Option, - ) -> Result> - where - M: ZKSProvider, - T: Tokenizable, - { - let era_provider = self.get_era_provider()?; - - let custom_data = Eip712Meta::new().factory_deps({ - let mut factory_deps = Vec::new(); - if let Some(contract_dependencies) = contract_dependencies { - factory_deps.extend(contract_dependencies); - } - factory_deps.push(contract_bytecode.to_vec()); - factory_deps - }); - - let mut contract_deployer_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_deployer_path.push("src/abi/ContractDeployer.json"); - let mut deploy_request = Eip712TransactionRequest::new() - .r#type(EIP712_TX_TYPE) - .from(self.l2_address()) - .to(Address::from_str(CONTRACT_DEPLOYER_ADDR).map_err(|e| { - ZKSWalletError::CustomError(format!("invalid contract deployer address: {e}")) - })?) - .chain_id(self.l2_chain_id()) - .nonce( - era_provider - .get_transaction_count(self.l2_address(), None) - .await?, - ) - .gas_price(era_provider.get_gas_price().await?) - .max_fee_per_gas(era_provider.get_gas_price().await?) - .data({ - let contract_deployer = Abi::load(BufReader::new( - File::open(contract_deployer_path).map_err(|e| { - ZKSWalletError::CustomError(format!( - "failed to open ContractDeployer abi: {e}" - )) - })?, - )) - .map_err(|e| { - ZKSWalletError::CustomError(format!("failed to load ContractDeployer abi: {e}")) - })?; - let create = contract_deployer.function("create").map_err(|e| { - ZKSWalletError::CustomError(format!("failed to get create function: {e}")) - })?; - // TODO: User could provide this instead of defaulting. - let salt = [0_u8; 32]; - let bytecode_hash = hash_bytecode(contract_bytecode)?; - let call_data = Bytes::default(); - - encode_function_data(create, (salt, bytecode_hash, call_data))? - }) - .custom_data(custom_data.clone()); - - let fee = era_provider.estimate_fee(deploy_request.clone()).await?; - deploy_request = deploy_request - .max_priority_fee_per_gas(fee.max_priority_fee_per_gas) - .max_fee_per_gas(fee.max_fee_per_gas) - .gas_limit(fee.gas_limit); - - let signable_data: Eip712Transaction = deploy_request.clone().try_into()?; - let signature: Signature = self.l2_wallet.sign_typed_data(&signable_data).await?; - deploy_request = - deploy_request.custom_data(custom_data.custom_signature(signature.to_vec())); - - let encoded_rlp = &*deploy_request.rlp_signed(signature)?; - let pending_transaction = era_provider - .send_raw_transaction([&[EIP712_TX_TYPE], encoded_rlp].concat().into()) - .await?; - - // TODO: Should we wait here for the transaction to be confirmed on-chain? - - let transaction_receipt = pending_transaction - .await? - .ok_or(ZKSWalletError::CustomError( - "no transaction receipt".to_owned(), - ))?; - - let contract_address = - transaction_receipt - .contract_address - .ok_or(ZKSWalletError::CustomError( - "no contract address".to_owned(), - ))?; - - Ok(contract_address) - } - - pub async fn deploy(&self, request: &DeployRequest) -> Result> - where - M: ZKSProvider, - { - let era_provider = self.get_era_provider()?; - - let eip712_request: Eip712TransactionRequest = request.clone().try_into()?; - - let transaction_receipt = era_provider - .send_transaction_eip712(&self.l2_wallet, eip712_request) - .await? - .await? - .ok_or(ZKSWalletError::CustomError( - "No transaction receipt".to_owned(), - ))?; - - transaction_receipt - .contract_address - .ok_or(ZKSWalletError::CustomError( - "No contract address".to_owned(), - )) - } - - pub async fn withdraw(&self, request: &WithdrawRequest) -> Result> - where - M: ZKSProvider, - { - let era_provider = self.get_era_provider()?; - let transaction_receipt = era_provider - .send_transaction_eip712(&self.l2_wallet, request.clone()) - .await? - .await? - .ok_or(ZKSWalletError::CustomError( - "No transaction receipt".to_owned(), - ))?; - - Ok(transaction_receipt.transaction_hash) - } - - pub async fn finalize_withdraw(&self, tx_hash: H256) -> Result> - where - M: ZKSProvider, - { - let era_provider = self.get_era_provider()?; - let eth_provider = self.get_eth_provider()?; - - let withdrawal_receipt = era_provider.get_transaction_receipt(tx_hash).await?.ok_or( - ZKSWalletError::CustomError("Error getting transaction receipt of withdraw".to_owned()), - )?; - - let messenger_contract_address = Address::from_str(zks_utils::CONTRACTS_L1_MESSENGER_ADDR) - .map_err(|error| { - ZKSWalletError::CustomError(format!("failed to parse contract address: {error}")) - })?; - - let logs: Vec = withdrawal_receipt - .logs - .into_iter() - .filter(|log| { - //log.topics[0] == topic && - log.address == messenger_contract_address - }) - .collect(); - - // Get all the parameters needed to call the finalizeWithdrawal function on the main contract contract. - let (_, l2_to_l1_log_index) = serde_json::from_value::>( - withdrawal_receipt - .other - .get("l2ToL1Logs") - .ok_or(ZKSWalletError::CustomError( - "Field not present in receipt".to_owned(), - ))? - .clone(), - ) - .map_err(|err| { - ZKSWalletError::CustomError(format!("Error getting logs in receipt: {err:?}")) - })? - .iter() - .zip(0_u64..) - .find(|(log, _)| { - if let Some(sender) = log.get("sender") { - sender == zks_utils::CONTRACTS_L1_MESSENGER_ADDR - } else { - false - } - }) - .ok_or(ZKSWalletError::CustomError( - "Error getting log index parameter".to_owned(), - ))?; - - let filtered_log = logs - .get(0) - .ok_or(ZKSWalletError::CustomError( - "Error getting log in receipt".to_owned(), - ))? - .clone(); - let proof = era_provider - .get_l2_to_l1_log_proof(tx_hash, Some(l2_to_l1_log_index)) - .await? - .ok_or(ZKSWalletError::CustomError( - "Error getting proof parameter".to_owned(), - ))?; - let main_contract = era_provider.get_main_contract().await?; - let merkle_proof: Vec = proof.merkle_proof; - let l1_batch_number = era_provider.get_l1_batch_number().await?; - let l2_message_index = U256::from(proof.id); - - let l2_tx_number_in_block: String = serde_json::from_value::( - withdrawal_receipt - .other - .get("l1BatchTxIndex") - .ok_or(ZKSWalletError::CustomError( - "Field not present in receipt".to_owned(), - ))? - .clone(), - ) - .map_err(|err| ZKSWalletError::CustomError(format!("Failed to deserialize field {err}")))?; - - let message: Bytes = decode(&[ParamType::Bytes], &filtered_log.data) - .map_err(|e| ZKSWalletError::CustomError(format!("failed to decode log data: {e}")))? - .get(0) - .ok_or(ZKSWalletError::CustomError( - "Message not found in decoded data".to_owned(), - ))? - .clone() - .into_bytes() - .ok_or(ZKSWalletError::CustomError( - "Could not convert message to bytes".to_owned(), - ))? - .into(); - - let parameters = [ - format!("{l1_batch_number:?}"), - format!("{l2_message_index:?}"), - l2_tx_number_in_block, - hex::encode(&message), - format!("{merkle_proof:?}") - .replace('"', "") - .replace(' ', ""), - ]; - - let function_signature = "function finalizeEthWithdrawal(uint256 _l2BlockNumber,uint256 _l2MessageIndex,uint16 _l2TxNumberInBlock,bytes calldata _message,bytes32[] calldata _merkleProof) external"; - let transaction_receipt = eth_provider - .send( - &self.l1_wallet, - main_contract, - function_signature, - Some(parameters.into()), - None, - ) - .await? - .await? - .ok_or(ZKSWalletError::CustomError( - "No transaction receipt".to_owned(), - ))?; - - Ok(transaction_receipt.transaction_hash) - } -} From e37aeee3553c3da14b00c11597576f4006f55ad7 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:05:23 +0200 Subject: [PATCH 11/75] Add L1TxOverrides type --- src/types.rs | 38 ++++++++++++++++++++++++++++++++++++++ src/zk_wallet.rs | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 src/zk_wallet.rs diff --git a/src/types.rs b/src/types.rs index dcb8252..ad0a8f3 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,3 +1,5 @@ +use ::ethers::{abi::Address, types::U256}; + pub mod zksync { pub use zksync_system_constants::*; pub use zksync_types::*; @@ -7,3 +9,39 @@ pub mod zksync { pub mod ethers { pub use ethers::types::*; } + +#[derive(Debug, Clone, Default)] +pub struct L1TxOverrides { + pub from: Option
, + pub value: Option, + pub gas_price: Option, + pub gas: Option, + pub nonce: Option, +} + +impl L1TxOverrides { + pub fn from(mut self, from: Address) -> Self { + self.from = Some(from); + self + } + + pub fn value(mut self, value: U256) -> Self { + self.value = Some(value); + self + } + + pub fn gas_price(mut self, gas_price: U256) -> Self { + self.gas_price = Some(gas_price); + self + } + + pub fn gas(mut self, gas: U256) -> Self { + self.gas = Some(gas); + self + } + + pub fn nonce(mut self, nonce: U256) -> Self { + self.nonce = Some(nonce); + self + } +} diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs new file mode 100644 index 0000000..5511a72 --- /dev/null +++ b/src/zk_wallet.rs @@ -0,0 +1,46 @@ +use ethers::{ + abi::{Address, Hash}, + providers::{Middleware, MiddlewareError}, + signers::Signer, + types::U256, +}; + +use crate::ZKMiddleware; + +#[async_trait::async_trait] +pub trait ZKWallet { + type L1Error: MiddlewareError< + Inner = <::Inner as Middleware>::Error, + >; + type L2Error: MiddlewareError< + Inner = <::Inner as ZKMiddleware>::Error, + >; + type L1Signer: Middleware + Signer; + type L2Signer: ZKMiddleware + Signer; + + async fn deposit(&self, amount: U256) -> Result; + + async fn finalize_deposit(&self) -> Result; + + async fn withdraw(&self, amount: U256) -> Result<(), Self::L2Error>; + + async fn finalize_withdraw(&self) -> Result; + + async fn transfer(&self, to: Address, amount: U256) -> Result; + + /* L1 Signer Getters */ + + async fn l1_nonce(&self) -> Result; + + async fn l1_balance(&self) -> Result; + + async fn l1_address(&self) -> Result; + + /* L2 Signer Getters */ + + async fn l2_nonce(&self) -> Result; + + async fn l2_balance(&self) -> Result; + + async fn l2_address(&self) -> Result; +} From 2e39ce780a76b7af2e663496456c89555a693d59 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:05:51 +0200 Subject: [PATCH 12/75] Update lib.rs --- src/lib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0e7c5b2..311ec0e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,12 +48,13 @@ pub mod utils; pub mod contracts; pub mod eip712; -pub mod zks_wallet; -pub use zks_wallet::{ZKSWallet, ZKSWalletError}; +pub mod deposit; + +pub mod zk_middleware; +pub mod zk_wallet; +pub use zk_middleware::ZKMiddleware; // For macro expansions only, not public API. #[allow(unused_extern_crates)] -extern crate self as zksync_web3_rs; -#[cfg(test)] -mod tests; +extern crate self as zksync_ethers_rs; From 5a89ebcb41884958abdc8db418e17f5c07c8a818 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:06:08 +0200 Subject: [PATCH 13/75] Update zk_middleware imports --- src/zk_middleware.rs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/zk_middleware.rs b/src/zk_middleware.rs index ef5968b..f011579 100644 --- a/src/zk_middleware.rs +++ b/src/zk_middleware.rs @@ -22,18 +22,20 @@ use ethers::{ use crate::{ eip712::{Eip712Meta, Eip712Transaction, Eip712TransactionRequest}, - types::zksync::{ - api::{ - BlockDetails, BridgeAddresses, DebugCall, L1BatchDetails, L2ToL1LogProof, - ResultDebugCall, TracerConfig, Transaction, TransactionDetailedResult, - TransactionDetails, + types::{ + zksync::{ + api::{ + BlockDetails, BridgeAddresses, DebugCall, L1BatchDetails, L2ToL1LogProof, + ResultDebugCall, TracerConfig, Transaction, TransactionDetailedResult, + TransactionDetails, + }, + fee::Fee, + web3_decl::Token, + EIP_712_TX_TYPE, }, - fee::Fee, - web3_decl::Token, - EIP_712_TX_TYPE, + L1TxOverrides, }, utils, - zks_wallet::Overrides, }; /// This trait wraps every JSON-RPC call specified in zkSync Era's documentation @@ -214,7 +216,7 @@ pub trait ZKMiddleware { contract_address: Address, function_signature: &str, function_parameters: Option>, - overrides: Option, + overrides: Option, ) -> Result, Self::Error> where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync; @@ -225,7 +227,7 @@ pub trait ZKMiddleware { contract_address: Address, function_signature: &str, function_parameters: Option>, - overrides: Option, + overrides: Option, ) -> Result, Self::Error> where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync; @@ -600,7 +602,7 @@ where contract_address: Address, function_signature: &str, function_parameters: Option>, - overrides: Option, + overrides: Option, ) -> Result, Self::Error> where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, @@ -680,7 +682,7 @@ where contract_address: Address, function_signature: &str, function_parameters: Option>, - _overrides: Option, + _overrides: Option, ) -> Result, Self::Error> where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, @@ -750,7 +752,7 @@ async fn build_send_tx( contract_address: Address, function_signature: &str, function_parameters: Option>, - _overrides: Option, + _overrides: Option, ) -> Result where D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, From f5f7958fb2e5289ee245971f3a7b5e9dc6209099 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:06:16 +0200 Subject: [PATCH 14/75] Add Bridgehub impl --- src/contracts/bridgehub.rs | 134 +++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 src/contracts/bridgehub.rs diff --git a/src/contracts/bridgehub.rs b/src/contracts/bridgehub.rs new file mode 100644 index 0000000..99524fc --- /dev/null +++ b/src/contracts/bridgehub.rs @@ -0,0 +1,134 @@ +use ethers::types::{Address, Bytes, U256}; +use ethers_contract::abigen; + +abigen!(Bridgehub, "abi/IBridgehub.json"); + +/// struct L2TransactionRequestDirect { +/// uint256 chainId; +/// uint256 mintValue; +/// address l2Contract; +/// uint256 l2Value; +/// bytes l2Calldata; +/// uint256 l2GasLimit; +/// uint256 l2GasPerPubdataByteLimit; +/// bytes[] factoryDeps; +/// address refundRecipient; +/// } +impl L2TransactionRequestDirect { + pub fn new() -> Self { + Self::default() + } + + pub fn chain_id(mut self, chain_id: impl Into) -> Self { + self.chain_id = chain_id.into(); + self + } + + pub fn mint_value(mut self, mint_value: impl Into) -> Self { + self.mint_value = mint_value.into(); + self + } + + pub fn l2_contract(mut self, l2_contract: impl Into
) -> Self { + self.l_2_contract = l2_contract.into(); + self + } + + pub fn l2_value(mut self, l2_value: impl Into) -> Self { + self.l_2_value = l2_value.into(); + self + } + + pub fn l2_calldata(mut self, l2_calldata: impl Into) -> Self { + self.l_2_calldata = l2_calldata.into(); + self + } + + pub fn l2_gas_limit(mut self, l2_gas_limit: impl Into) -> Self { + self.l_2_gas_limit = l2_gas_limit.into(); + self + } + + pub fn l2_gas_per_pubdata_byte_limit( + mut self, + l2_gas_per_pubdata_byte_limit: impl Into, + ) -> Self { + self.l_2_gas_per_pubdata_byte_limit = l2_gas_per_pubdata_byte_limit.into(); + self + } + + pub fn factory_deps(mut self, factory_deps: Vec) -> Self { + self.factory_deps = factory_deps; + self + } + + pub fn refund_recipient(mut self, refund_recipient: impl Into
) -> Self { + self.refund_recipient = refund_recipient.into(); + self + } +} + +/// struct L2TransactionRequestTwoBridgesOuter { +/// uint256 chainId; +/// uint256 mintValue; +/// uint256 l2Value; +/// uint256 l2GasLimit; +/// uint256 l2GasPerPubdataByteLimit; +/// address refundRecipient; +/// address secondBridgeAddress; +/// uint256 secondBridgeValue; +/// bytes secondBridgeCalldata; +/// } +impl L2TransactionRequestTwoBridgesOuter { + pub fn new() -> Self { + Self::default() + } + + pub fn chain_id(mut self, chain_id: impl Into) -> Self { + self.chain_id = chain_id.into(); + self + } + + pub fn mint_value(mut self, mint_value: impl Into) -> Self { + self.mint_value = mint_value.into(); + self + } + + pub fn l2_value(mut self, l2_value: impl Into) -> Self { + self.l_2_value = l2_value.into(); + self + } + + pub fn l2_gas_limit(mut self, l2_gas_limit: impl Into) -> Self { + self.l_2_gas_limit = l2_gas_limit.into(); + self + } + + pub fn l2_gas_per_pubdata_byte_limit( + mut self, + l2_gas_per_pubdata_byte_limit: impl Into, + ) -> Self { + self.l_2_gas_per_pubdata_byte_limit = l2_gas_per_pubdata_byte_limit.into(); + self + } + + pub fn refund_recipient(mut self, refund_recipient: Address) -> Self { + self.refund_recipient = refund_recipient; + self + } + + pub fn second_bridge_address(mut self, address: impl Into
) -> Self { + self.second_bridge_address = address.into(); + self + } + + pub fn second_bridge_value(mut self, value: impl Into) -> Self { + self.second_bridge_value = value.into(); + self + } + + pub fn second_bridge_calldata(mut self, calldata: impl Into) -> Self { + self.second_bridge_calldata = calldata.into(); + self + } +} From a4f6255d327aa0a39b095d1543ac9df95cb18d0b Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:06:23 +0200 Subject: [PATCH 15/75] Add ERC20 impl --- src/contracts/erc20.rs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/contracts/erc20.rs diff --git a/src/contracts/erc20.rs b/src/contracts/erc20.rs new file mode 100644 index 0000000..8c58c91 --- /dev/null +++ b/src/contracts/erc20.rs @@ -0,0 +1,3 @@ +use ethers_contract::abigen; + +abigen!(ERC20, "abi/IERC20.json"); From 2367f4160aab4c67bd8563898a2e1b84ad4016be Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:06:31 +0200 Subject: [PATCH 16/75] Add L1SharedBridge impl --- src/contracts/l1_shared_bridge.rs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/contracts/l1_shared_bridge.rs diff --git a/src/contracts/l1_shared_bridge.rs b/src/contracts/l1_shared_bridge.rs new file mode 100644 index 0000000..e4fd38f --- /dev/null +++ b/src/contracts/l1_shared_bridge.rs @@ -0,0 +1,3 @@ +use ethers_contract::abigen; + +abigen!(L1SharedBridge, "abi/IL1SharedBridge.json"); From ee2db5329cf5eb89d6c591cd895e71d804b886f8 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:06:44 +0200 Subject: [PATCH 17/75] Declare contract modules --- src/contracts/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/contracts/mod.rs b/src/contracts/mod.rs index 6949dcf..d67abc5 100644 --- a/src/contracts/mod.rs +++ b/src/contracts/mod.rs @@ -1,2 +1,4 @@ -pub mod l1_bridge_contract; +pub mod bridgehub; +pub mod erc20; +pub mod l1_shared_bridge; pub mod main_contract; From 7edd3caef917a466c3f54e81f869cc45f7265781 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:06:57 +0200 Subject: [PATCH 18/75] Add deposit new middle-level implementation --- src/deposit.rs | 423 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 423 insertions(+) create mode 100644 src/deposit.rs diff --git a/src/deposit.rs b/src/deposit.rs new file mode 100644 index 0000000..0b57624 --- /dev/null +++ b/src/deposit.rs @@ -0,0 +1,423 @@ +// FIXME: Remove this after finishing the implementation. +#![allow(clippy::unwrap_used)] + +use std::sync::Arc; + +use ethers::{ + abi::{Address, Tokenizable}, + middleware::SignerMiddleware, + providers::Middleware, + signers::Signer, + types::U256, +}; + +use crate::{ + contracts::{ + bridgehub::{Bridgehub, L2TransactionRequestDirect, L2TransactionRequestTwoBridgesOuter}, + erc20::ERC20, + }, + eip712::Eip712TransactionRequest, + types::L1TxOverrides, + utils, ZKMiddleware, +}; + +pub async fn deposit( + amount: U256, + token: impl Into
, + from: Arc>, + to: Address, + refund_recipient: Address, + l2_provider: L2Provider, +) -> ethers::types::TransactionReceipt +where + M: Middleware, + S: Signer, + L2Provider: ZKMiddleware + Middleware, +{ + // The type is converted to avoid adding Copy as a constraint bound (Address is Copy). + let token: Address = token.into(); + + let bridgehub_address = l2_provider.get_bridgehub_contract().await.unwrap(); + let bridgehub = Bridgehub::new( + bridgehub_address, + Arc::>::clone(&from), + ); + + let zk_chain_id = l2_provider.get_chainid().await.unwrap(); + let zk_chain_base_token: Address = bridgehub.base_token(zk_chain_id).call().await.unwrap(); + + let token_to_deposit_is_eth = token == utils::L2_ETH_TOKEN_ADDRESS; + let token_to_deposit_is_zk_chain_base_token = token == zk_chain_base_token; + + match ( + token_to_deposit_is_eth, + token_to_deposit_is_zk_chain_base_token, + ) { + // Depositing ETH to an ETH based ZKChain. + (true, true) => { + deposit_eth_to_eth_based_zk_chain( + amount, + from, + to, + refund_recipient, + zk_chain_id, + l2_provider, + bridgehub, + ) + .await + } + // Depositing ETH to a ZKChain whose base token is not ETH. + (true, false) => todo!(), + // Depositing an ERC20 to a ZKChain whose base token is the same ERC20. + (false, true) => todo!(), + // We are depositing an ERC20 to a ZKChain where: + // 1. ETH is the base token. + // 2. An ERC20 different than the deposited is the base token. + (false, false) => { + let erc20 = ERC20::new(token, Arc::>::clone(&from)); + deposit_non_base_erc20_token( + amount, + token, + from, + to, + refund_recipient, + l2_provider, + bridgehub, + erc20, + ) + .await + } + } +} + +/// Deposit ETH to a ZKChain whose base token is ETH. +pub async fn deposit_eth_to_eth_based_zk_chain( + amount: U256, + from: Arc>, + to: Address, + refund_recipient: Address, + zk_chain_id: U256, + l2_provider: L2Provider, + bridgehub: Bridgehub>, +) -> ethers::types::TransactionReceipt +where + M: Middleware, + S: Signer, + L2Provider: ZKMiddleware + Middleware, +{ + let from_addr = from.address(); + + // The amount of gas required for executing an L2 tx via L1. + let estimate_l1_to_l2_gas = l2_provider + .estimate_gas_l1_to_l2( + Eip712TransactionRequest::new() + .chain_id(zk_chain_id) + .from(from_addr) + .to(to), + ) + .await + .unwrap(); + let l2_gas_per_pubdata_byte_limit = U256::from(utils::REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT); + let l2_costs = { + let operator_tip = U256::zero(); + let base_cost: U256 = bridgehub + .l_2_transaction_base_cost( + zk_chain_id, + from.get_gas_price().await.unwrap(), + estimate_l1_to_l2_gas, + l2_gas_per_pubdata_byte_limit, + ) + .call() + .await + .unwrap(); + base_cost + operator_tip + amount + }; + + // There's no need to override l2_calldata for depositing ETH into an + // ETH based chain. + // + // l2_contract and refund_recipient could be overridden in the future. + // You might want to deposit ETH into a different account or contract, + // or you might want to refund the deposit to a different account or + // L1 contract. + // + // factory_deps is empty for depositing ETH into an ETH based chain. + let request = L2TransactionRequestDirect::new() + .chain_id(zk_chain_id) + .mint_value(l2_costs) + .l2_contract(to) + .l2_value(amount) + .l2_calldata(vec![]) + .l2_gas_limit(estimate_l1_to_l2_gas) + .l2_gas_per_pubdata_byte_limit(l2_gas_per_pubdata_byte_limit) + .factory_deps(vec![]) + .refund_recipient(refund_recipient); + + // NOTE: In ETH deposits, the amount of ETH to be deposited into the + // ETH based chain should be part of the `value` field of the L1 tx + // which essentially is the call to the `requestL2TransactionDirect`. + let overrides = L1TxOverrides::default() + .from(from_addr) + .value(l2_costs) + .gas_price(from.get_gas_price().await.unwrap()) + .gas(estimate_l1_to_l2_gas) + .nonce(from.get_transaction_count(from_addr, None).await.unwrap()); + + deposit_with_l2_transaction_direct_request(bridgehub, request, overrides).await +} + +pub async fn deposit_with_l2_transaction_direct_request( + bridgehub: Bridgehub>, + request: L2TransactionRequestDirect, + overrides: L1TxOverrides, +) -> ethers::types::TransactionReceipt +where + M: Middleware, + S: Signer, +{ + bridgehub + .request_l2_transaction_direct(request) + .from(overrides.from.unwrap_or_default()) + .value(overrides.value.unwrap_or_default()) + .gas_price(overrides.gas_price.unwrap_or_default()) + .gas(overrides.gas.unwrap_or_default()) + .nonce(overrides.nonce.unwrap_or_default()) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap() +} + +/// Deposits ERC20 tokens into a ZKChain where the base token +/// is either ETH or a different ERC20 than the deposited. +pub async fn deposit_non_base_erc20_token( + amount: U256, + token: Address, + from: Arc>, + to: Address, + refund_recipient: Address, + l2_provider: L2Provider, + bridgehub: Bridgehub>, + erc20: ERC20>, +) -> ethers::types::TransactionReceipt +where + M: Middleware, + S: Signer, + L2Provider: ZKMiddleware + Middleware, +{ + let zk_chain_id = l2_provider.get_chainid().await.unwrap(); + // The amount of gas required for executing an L2 tx via L1. + let estimate_gas_for_l1_to_l2_tx = l2_provider + .estimate_gas_l1_to_l2( + Eip712TransactionRequest::new() + .chain_id(zk_chain_id) + .from(from.address()) + .to(to), + ) + .await + .unwrap(); + let l2_gas_per_pubdata_byte_limit = U256::from(utils::REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT); + let operator_tip = U256::zero(); + let base_cost = l2_tx_base_cost( + &bridgehub, + zk_chain_id, + from.get_gas_price().await.unwrap(), + estimate_gas_for_l1_to_l2_tx, + l2_gas_per_pubdata_byte_limit, + ) + .await; + let l2_costs = base_cost + operator_tip; + + let l1_shared_bridge_address = l2_provider + .get_bridge_contracts() + .await + .unwrap() + .l1_shared_default_bridge + .unwrap(); + + let calldata = ethers::abi::encode(&[token.into_token(), amount.into_token(), to.into_token()]); + + let request: L2TransactionRequestTwoBridgesOuter = L2TransactionRequestTwoBridgesOuter::new() + .chain_id(zk_chain_id) + .mint_value(l2_costs) + .l2_value(U256::zero()) + .l2_gas_limit(estimate_gas_for_l1_to_l2_tx) + .l2_gas_per_pubdata_byte_limit(l2_gas_per_pubdata_byte_limit) + .refund_recipient(refund_recipient) + .second_bridge_address(l1_shared_bridge_address) + .second_bridge_value(U256::zero()) + .second_bridge_calldata(calldata); + + let allowance: U256 = erc20 + .allowance(from.address(), l1_shared_bridge_address) + .call() + .await + .unwrap(); + // ERC20 approval needs to be done before getting the nonce for the + // overrides. + if allowance < amount { + erc20 + .approve(l1_shared_bridge_address, amount) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap(); + } + + let nonce = from + .get_transaction_count(from.address(), None) + .await + .unwrap(); + let l1_gas_price = from.get_gas_price().await.unwrap(); + // The value should be overridden in the case where the base token is ETH. + let value = bridgehub + .base_token(zk_chain_id) + .call() + .await + .unwrap() + .eq(&utils::L2_ETH_TOKEN_ADDRESS) + .then_some(l2_costs) + .unwrap_or_default(); + + let overrides = L1TxOverrides::default() + .from(from.address()) + .gas_price(l1_gas_price) + .gas(estimate_gas_for_l1_to_l2_tx) + .nonce(nonce) + .value(value); + + deposit_with_l2_transaction_two_bridges_request(bridgehub, request, overrides).await +} + +async fn deposit_with_l2_transaction_two_bridges_request( + bridgehub: Bridgehub>, + request: L2TransactionRequestTwoBridgesOuter, + overrides: L1TxOverrides, +) -> ethers::types::TransactionReceipt +where + M: Middleware, + S: Signer, +{ + bridgehub + .request_l2_transaction_two_bridges(request) + .from(overrides.from.unwrap_or_default()) + .value(overrides.value.unwrap_or_default()) + .gas_price(overrides.gas_price.unwrap_or_default()) + .gas(overrides.gas.unwrap_or_default()) + .nonce(overrides.nonce.unwrap_or_default()) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap() +} + +pub async fn l2_tx_base_cost( + bridgehub: &Bridgehub>, + zk_chain_id: U256, + l1_gas_price: U256, + estimate_gas_for_l1_to_l2_tx: U256, + l2_gas_per_pubdata_byte_limit: U256, +) -> U256 +where + M: Middleware, + S: Signer, +{ + bridgehub + .l_2_transaction_base_cost( + zk_chain_id, + l1_gas_price, + estimate_gas_for_l1_to_l2_tx, + l2_gas_per_pubdata_byte_limit, + ) + .call() + .await + .unwrap() +} + +#[cfg(test)] +mod deposit_tests { + use super::deposit; + use crate::utils::L2_ETH_TOKEN_ADDRESS; + use ethers::{ + abi::Address, + middleware::SignerMiddleware, + providers::{Http, Middleware, Provider, ProviderExt}, + signers::{LocalWallet, Signer}, + types::U256, + }; + use std::{str::FromStr, sync::Arc}; + + #[tokio::test] + async fn deposit_eth_to_eth_based_zk_chain() { + let l1_provider = Provider::::connect("http://eth-sepolia").await; + let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); + let from = Arc::new(SignerMiddleware::, LocalWallet>::new( + l1_provider, + LocalWallet::from_str( + "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", + ) + .unwrap() + .with_chain_id(l1_chain_id), + )); + let to = from.address(); + let refund_recipient = from.address(); + let l2_provider = + Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; + let amount: U256 = ethers::utils::parse_units("0.01", "ether").unwrap().into(); + + let receipt = deposit( + amount, + L2_ETH_TOKEN_ADDRESS, + from, + to, + refund_recipient, + l2_provider, + ) + .await; + + println!( + "https://sepolia.etherscan.io/tx/{:?}", + receipt.transaction_hash + ); + } + + #[tokio::test] + async fn deposit_erc20_to_eth_based_zk_chain() { + let l1_provider = Provider::::connect("http://eth-sepolia").await; + let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); + let from = Arc::new(SignerMiddleware::, LocalWallet>::new( + l1_provider, + LocalWallet::from_str( + "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", + ) + .unwrap() + .with_chain_id(l1_chain_id), + )); + let to = from.address(); + let refund_recipient = from.address(); + let l2_provider = + Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; + let amount: U256 = ethers::utils::parse_units("0.1", "ether").unwrap().into(); + + let receipt = deposit( + amount, + Address::from_str("0x7209EaD3dfe1c3a517B6b730C00bea1E7f319260").unwrap(), + from, + to, + refund_recipient, + l2_provider, + ) + .await; + + println!( + "https://sepolia.etherscan.io/tx/{:?}", + receipt.transaction_hash + ); + } +} From 4466bd74ed52274ca1d955e180268bfdde17bbec Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:07:03 +0200 Subject: [PATCH 19/75] Update Cargo.lock --- Cargo.lock | 3221 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 2869 insertions(+), 352 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b136ec..8fa3cee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,15 @@ dependencies = [ "regex", ] +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -38,6 +47,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" version = "0.3.2" @@ -47,17 +65,32 @@ dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", - "anstyle-wincon", + "anstyle-wincon 1.0.1", "colorchoice", "is-terminal", "utf8parse", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon 3.0.3", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" @@ -87,6 +120,22 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + [[package]] name = "arrayvec" version = "0.7.2" @@ -102,6 +151,17 @@ dependencies = [ "term", ] +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + [[package]] name = "async-trait" version = "0.1.68" @@ -110,7 +170,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", ] [[package]] @@ -124,6 +184,17 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "auto_impl" version = "1.1.0" @@ -142,6 +213,72 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base16ct" version = "0.2.0" @@ -160,6 +297,12 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -172,6 +315,26 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + +[[package]] +name = "bigdecimal" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "bincode" version = "1.3.3" @@ -202,6 +365,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + [[package]] name = "bitvec" version = "0.17.4" @@ -224,6 +393,23 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e#1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -271,34 +457,13 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" dependencies = [ "serde", ] -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "camino" version = "1.1.4" @@ -333,12 +498,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -dependencies = [ - "jobserver", -] +checksum = "066fce287b1d4eafef758e89e09d724a24808a9196fe9756b8ca90e86d0719a2" [[package]] name = "cfg-if" @@ -352,8 +514,14 @@ version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ + "iana-time-zone", + "js-sys", "num-integer", "num-traits", + "serde", + "time 0.1.45", + "wasm-bindgen", + "winapi", ] [[package]] @@ -366,6 +534,23 @@ dependencies = [ "inout", ] +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive 3.2.25", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + [[package]] name = "clap" version = "4.3.0" @@ -373,7 +558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" dependencies = [ "clap_builder", - "clap_derive", + "clap_derive 4.3.0", "once_cell", ] @@ -383,23 +568,45 @@ version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" dependencies = [ - "anstream", + "anstream 0.3.2", "anstyle", - "bitflags", - "clap_lex", + "bitflags 1.3.2", + "clap_lex 0.5.0", "strsim", ] +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck 0.4.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "clap_derive" version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", ] [[package]] @@ -420,10 +627,10 @@ dependencies = [ "digest 0.10.7", "getrandom", "hmac", - "k256", + "k256 0.13.1", "lazy_static", "serde", - "sha2 0.10.6", + "sha2 0.10.8", "thiserror", ] @@ -440,7 +647,7 @@ dependencies = [ "once_cell", "pbkdf2 0.12.1", "rand", - "sha2 0.10.6", + "sha2 0.10.8", "thiserror", ] @@ -459,8 +666,8 @@ dependencies = [ "ripemd", "serde", "serde_derive", - "sha2 0.10.6", - "sha3", + "sha2 0.10.8", + "sha3 0.10.8", "thiserror", ] @@ -470,6 +677,58 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "compile-fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bed69047ed42e52c7e38d6421eeb8ceefb4f2a2b52eed59137f7bad7908f6800" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "regex", + "terminal_size", + "unicode-width", + "winapi", +] + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "const-oid" version = "0.9.2" @@ -477,10 +736,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" [[package]] -name = "constant_time_eq" -version = "0.1.5" +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" @@ -491,15 +760,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossbeam-channel" version = "0.5.8" @@ -549,6 +809,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + [[package]] name = "crypto-bigint" version = "0.5.2" @@ -581,21 +853,85 @@ dependencies = [ ] [[package]] -name = "data-encoding" -version = "2.4.0" +name = "darling" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] [[package]] -name = "der" -version = "0.7.6" +name = "darling_core" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56acb310e15652100da43d130af8d97b509e95af61aab1c5a7939ef24337ee17" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ - "const-oid", + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "serde", + "uuid 1.10.0", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "der" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56acb310e15652100da43d130af8d97b509e95af61aab1c5a7939ef24337ee17" +dependencies = [ + "const-oid", "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -607,6 +943,39 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.70", + "unicode-xid", +] + +[[package]] +name = "dialoguer" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9dd058f8b65922819fabb4a41e7d1964e56344042c26efbccd465202c23fa0c" +dependencies = [ + "console 0.14.1", + "lazy_static", + "tempfile", + "zeroize", +] + [[package]] name = "diff" version = "0.1.13" @@ -655,24 +1024,42 @@ dependencies = [ "winapi", ] +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + [[package]] name = "dunce" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + [[package]] name = "ecdsa" version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" dependencies = [ - "der", + "der 0.7.6", "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", + "elliptic-curve 0.13.5", + "rfc6979 0.4.0", + "signature 2.1.0", + "spki 0.7.2", ] [[package]] @@ -681,25 +1068,54 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array", + "group 0.12.1", + "pkcs8 0.9.0", + "rand_core", + "sec1 0.3.0", + "subtle", + "zeroize", +] + [[package]] name = "elliptic-curve" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.2.0", + "crypto-bigint 0.5.2", "digest 0.10.7", - "ff", + "ff 0.13.0", "generic-array", - "group", - "pkcs8", + "group 0.13.0", + "pkcs8 0.10.2", "rand_core", - "sec1", + "sec1 0.7.2", "subtle", "zeroize", ] +[[package]] +name = "elsa" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98e71ae4df57d214182a2e5cb90230c0192c6ddfcaa05c36453d46a54713e10" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "ena" version = "0.14.2" @@ -709,6 +1125,12 @@ dependencies = [ "log", ] +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encoding_rs" version = "0.8.32" @@ -727,28 +1149,53 @@ dependencies = [ "base64 0.13.1", "bytes", "hex", - "k256", + "k256 0.13.1", "log", "rand", "rlp", "serde", - "sha3", + "sha3 0.10.8", "zeroize", ] +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ + "anstream 0.6.14", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] +[[package]] +name = "envy" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" +dependencies = [ + "serde", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -786,10 +1233,10 @@ dependencies = [ "scrypt", "serde", "serde_json", - "sha2 0.10.6", - "sha3", + "sha2 0.10.8", + "sha3 0.10.8", "thiserror", - "uuid", + "uuid 0.8.2", ] [[package]] @@ -804,7 +1251,7 @@ dependencies = [ "regex", "serde", "serde_json", - "sha3", + "sha3 0.10.8", "thiserror", "uint", ] @@ -906,7 +1353,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.16", + "syn 2.0.70", "toml", "walkdir", ] @@ -924,7 +1371,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.16", + "syn 2.0.70", ] [[package]] @@ -937,12 +1384,12 @@ dependencies = [ "bytes", "cargo_metadata", "chrono", - "elliptic-curve", + "elliptic-curve 0.13.5", "ethabi", "generic-array", "hex", - "k256", - "num_enum", + "k256 0.13.1", + "num_enum 0.6.1", "once_cell", "open-fastrlp", "rand", @@ -950,7 +1397,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.16", + "syn 2.0.70", "tempfile", "thiserror", "tiny-keccak", @@ -1045,12 +1492,12 @@ dependencies = [ "async-trait", "coins-bip32", "coins-bip39", - "elliptic-curve", + "elliptic-curve 0.13.5", "eth-keystore", "ethers-core", "hex", "rand", - "sha2 0.10.6", + "sha2 0.10.8", "thiserror", "tracing", ] @@ -1086,6 +1533,27 @@ dependencies = [ "yansi", ] +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "eyre" version = "0.6.8" @@ -1105,6 +1573,16 @@ dependencies = [ "instant", ] +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "ff" version = "0.13.0" @@ -1115,6 +1593,18 @@ dependencies = [ "subtle", ] +[[package]] +name = "findshlibs" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" +dependencies = [ + "cc", + "lazy_static", + "libc", + "winapi", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1134,26 +1624,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] -name = "flate2" -version = "1.0.26" +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "crc32fast", - "miniz_oxide", + "foreign-types-shared", ] [[package]] -name = "fnv" -version = "1.0.7" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1240,7 +1735,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", ] [[package]] @@ -1305,23 +1800,50 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + [[package]] name = "glob" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "gloo-net" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "http", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "gloo-timers" version = "0.2.6" @@ -1334,13 +1856,37 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gloo-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.0", "rand_core", "subtle", ] @@ -1357,7 +1903,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -1370,6 +1916,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "hashers" version = "1.0.1" @@ -1385,6 +1937,21 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.2.6" @@ -1424,6 +1991,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + [[package]] name = "http" version = "0.2.9" @@ -1481,7 +2059,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1496,28 +2074,84 @@ checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ "http", "hyper", - "rustls", + "log", + "rustls 0.21.1", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.0", ] [[package]] -name = "idna" -version = "0.3.0" +name = "hyper-timeout" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", ] [[package]] -name = "impl-codec" -version = "0.6.0" +name = "hyper-tls" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "parity-scale-codec", + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", ] [[package]] @@ -1562,7 +2196,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", +] + +[[package]] +name = "indicatif" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +dependencies = [ + "console 0.15.8", + "lazy_static", + "number_prefix", + "regex", ] [[package]] @@ -1612,6 +2268,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -1628,21 +2290,159 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] -name = "jobserver" -version = "0.1.26" +name = "js-sys" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ - "libc", + "wasm-bindgen", ] [[package]] -name = "js-sys" -version = "0.3.63" +name = "jsonrpsee" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "9579d0ca9fb30da026bac2f0f7d9576ec93489aeb7cd4971dd5b4617d82c79b2" dependencies = [ - "wasm-bindgen", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-http-client", + "jsonrpsee-proc-macros", + "jsonrpsee-types", + "jsonrpsee-wasm-client", + "jsonrpsee-ws-client", + "tracing", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9f9ed46590a8d5681975f126e22531698211b926129a40a2db47cbca429220" +dependencies = [ + "futures-channel", + "futures-util", + "gloo-net", + "http", + "jsonrpsee-core", + "pin-project", + "rustls-native-certs 0.7.1", + "rustls-pki-types", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.25.0", + "tokio-util", + "tracing", + "url", + "webpki-roots 0.26.3", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "776d009e2f591b78c038e0d053a796f94575d66ca4e77dd84bfc5e81419e436c" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-timer", + "futures-util", + "hyper", + "jsonrpsee-types", + "pin-project", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "wasm-bindgen-futures", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b7de9f3219d95985eb77fd03194d7c1b56c19bce1abfcc9d07462574b15572" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls", + "jsonrpsee-core", + "jsonrpsee-types", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d94b7505034e2737e688e1153bf81e6f93ad296695c43958d6da2e4321f0a990" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3266dfb045c9174b24c77c2dfe0084914bb23a6b2597d70c9dc6018392e1cd1b" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "jsonrpsee-wasm-client" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f36d27503d0efc0355c1630b74ecfb367050847bf7241a0ed75fab6dfa96c0" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "073c077471e89c4b511fa88b3df9a0f0abdf4a0a2e6683dd2ab36893af87bb2d" +dependencies = [ + "http", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", + "url", +] + +[[package]] +name = "k256" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +dependencies = [ + "cfg-if", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", ] [[package]] @@ -1652,11 +2452,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.7", + "elliptic-curve 0.13.5", "once_cell", - "sha2 0.10.6", - "signature", + "sha2 0.10.8", + "signature 2.1.0", ] [[package]] @@ -1704,9 +2504,29 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "linkme" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "ccb76662d78edc9f9bf56360d6919bdacc8b7761227727e5082f128eeb90bbf5" +dependencies = [ + "linkme-impl", +] + +[[package]] +name = "linkme-impl" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dccda732e04fa3baf2e17cf835bfe2601c7c2edafd64417c627dabae3a8cda" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.70", +] [[package]] name = "linux-raw-sys" @@ -1726,13 +2546,63 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "logos" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" dependencies = [ - "cfg-if", + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax 0.6.29", + "syn 2.0.70", +] + +[[package]] +name = "logos-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +dependencies = [ + "logos-codegen", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", ] +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "md-5" version = "0.10.5" @@ -1743,139 +2613,482 @@ dependencies = [ ] [[package]] -name = "memchr" -version = "2.5.0" +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miette" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +dependencies = [ + "miette-derive", + "once_cell", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive 0.7.2", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types", + "open-fastrlp-derive", +] + +[[package]] +name = "open-fastrlp-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "openssl" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] [[package]] -name = "memoffset" -version = "0.8.0" +name = "openssl-macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "autocfg", + "proc-macro2", + "quote", + "syn 2.0.70", ] [[package]] -name = "mime" -version = "0.3.17" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "miniz_oxide" -version = "0.7.1" +name = "openssl-sys" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ - "adler", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] -name = "mio" -version = "0.8.6" +name = "opentelemetry" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "9591d937bc0e6d2feb6f71a559540ab300ea49955229c347a517a28d27784c54" dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.45.0", + "opentelemetry_api", + "opentelemetry_sdk", ] [[package]] -name = "new_debug_unreachable" -version = "1.0.4" +name = "opentelemetry-http" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "c7594ec0e11d8e33faf03530a4c49af7064ebba81c1480e01be67d90b356508b" +dependencies = [ + "async-trait", + "bytes", + "http", + "opentelemetry_api", + "reqwest", +] [[package]] -name = "num-integer" -version = "0.1.45" +name = "opentelemetry-otlp" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" dependencies = [ - "autocfg", - "num-traits", + "async-trait", + "futures-core", + "http", + "opentelemetry-http", + "opentelemetry-proto", + "opentelemetry-semantic-conventions", + "opentelemetry_api", + "opentelemetry_sdk", + "prost 0.11.9", + "reqwest", + "thiserror", + "tokio", + "tonic", ] [[package]] -name = "num-traits" -version = "0.2.15" +name = "opentelemetry-proto" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" dependencies = [ - "autocfg", + "opentelemetry_api", + "opentelemetry_sdk", + "prost 0.11.9", + "tonic", ] [[package]] -name = "num_cpus" -version = "1.15.0" +name = "opentelemetry-semantic-conventions" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" dependencies = [ - "hermit-abi 0.2.6", - "libc", + "opentelemetry", ] [[package]] -name = "num_enum" -version = "0.6.1" +name = "opentelemetry_api" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" dependencies = [ - "num_enum_derive", + "futures-channel", + "futures-util", + "indexmap 1.9.3", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", + "urlencoding", ] [[package]] -name = "num_enum_derive" -version = "0.6.1" +name = "opentelemetry_sdk" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.16", + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "once_cell", + "opentelemetry_api", + "ordered-float 3.9.2", + "percent-encoding", + "rand", + "regex", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", ] [[package]] -name = "once_cell" -version = "1.17.1" +name = "ordered-float" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "ordered-float" +version = "3.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" +dependencies = [ + "num-traits", +] [[package]] -name = "open-fastrlp" -version = "0.1.4" +name = "os_info" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", + "log", + "serde", + "windows-sys 0.52.0", ] [[package]] -name = "open-fastrlp-derive" +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" -dependencies = [ - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parity-scale-codec" @@ -1897,12 +3110,18 @@ version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.12.1" @@ -1926,17 +3145,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - [[package]] name = "path-slash" version = "0.2.1" @@ -1950,9 +3158,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", - "hmac", - "password-hash", - "sha2 0.10.6", ] [[package]] @@ -1967,9 +3172,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" @@ -1978,7 +3183,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -2059,14 +3264,14 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2074,14 +3279,24 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.6", + "spki 0.7.2", ] [[package]] @@ -2090,6 +3305,12 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2104,12 +3325,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.5" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617feabb81566b593beb4886fb8c1f38064169dae4dccad0e3220160c3b37203" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.16", + "syn 2.0.70", ] [[package]] @@ -2133,7 +3354,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.9", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] @@ -2162,18 +3393,169 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.58" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus-client" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" +dependencies = [ + "dtoa", + "itoa", + "parking_lot", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive 0.12.6", +] + +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.4.1", + "itertools", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost 0.12.6", + "prost-types", + "regex", + "syn 2.0.70", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "prost-reflect" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057237efdb71cf4b3f9396302a3d6599a92fa94063ba537b66130980ea9909f3" +dependencies = [ + "base64 0.21.1", + "logos", + "miette", + "once_cell", + "prost 0.12.6", + "prost-types", + "serde", + "serde-value", +] + +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost 0.12.6", +] + +[[package]] +name = "protox" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bb76c5f6221de491fe2c8f39b106330bbd9762c6511119c07940e10eb9ff11" +dependencies = [ + "bytes", + "miette", + "prost 0.12.6", + "prost-reflect", + "prost-types", + "protox-parse", + "thiserror", +] + +[[package]] +name = "protox-parse" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4581f441c58863525a3e6bec7b8de98188cf75239a56c725a3e7288450a33f" +dependencies = [ + "logos", + "miette", + "prost-types", + "thiserror", +] + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + [[package]] name = "quote" -version = "1.0.27" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2248,7 +3630,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2257,7 +3639,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2282,6 +3664,15 @@ dependencies = [ "regex-syntax 0.7.1", ] +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -2310,20 +3701,23 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile", + "rustls 0.21.1", + "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls", + "tokio-native-tls", + "tokio-rustls 0.24.0", "tower-service", "url", "wasm-bindgen", @@ -2333,6 +3727,17 @@ dependencies = [ "winreg", ] +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac", + "zeroize", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -2352,12 +3757,27 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -2389,6 +3809,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -2410,7 +3842,7 @@ version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", @@ -2425,11 +3857,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" dependencies = [ "log", - "ring", - "rustls-webpki", + "ring 0.16.20", + "rustls-webpki 0.100.1", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.5", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile 1.0.2", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.2" @@ -2439,14 +3910,41 @@ dependencies = [ "base64 0.21.1", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.100.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", ] [[package]] @@ -2486,7 +3984,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b569c32c806ec3abdf3b5869fb8bf1e0d275a7c1c9b0b05603d9464632649edf" dependencies = [ "cfg-if", - "derive_more", + "derive_more 0.99.17", "parity-scale-codec", "scale-info-derive", ] @@ -2497,12 +3995,21 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53012eae69e5aa5c14671942a5dd47de59d4cdcff8532a6dd0e081faf1119482" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -2518,7 +4025,7 @@ dependencies = [ "hmac", "pbkdf2 0.11.0", "salsa20", - "sha2 0.10.6", + "sha2 0.10.8", ] [[package]] @@ -2527,8 +4034,22 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", ] [[package]] @@ -2537,14 +4058,64 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" dependencies = [ - "base16ct", - "der", + "base16ct 0.2.0", + "der 0.7.6", "generic-array", - "pkcs8", + "pkcs8 0.10.2", "subtle", "zeroize", ] +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.17" @@ -2566,24 +4137,142 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" +[[package]] +name = "sentry" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce4b57f1b521f674df7a1d200be8ff5d74e3712020ee25b553146657b5377d5" +dependencies = [ + "httpdate", + "native-tls", + "reqwest", + "sentry-backtrace", + "sentry-contexts", + "sentry-core", + "sentry-debug-images", + "sentry-panic", + "sentry-tracing", + "tokio", + "ureq", +] + +[[package]] +name = "sentry-backtrace" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cc8d4e04a73de8f718dc703943666d03f25d3e9e4d0fb271ca0b8c76dfa00e" +dependencies = [ + "backtrace", + "once_cell", + "regex", + "sentry-core", +] + +[[package]] +name = "sentry-contexts" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6436c1bad22cdeb02179ea8ef116ffc217797c028927def303bc593d9320c0d1" +dependencies = [ + "hostname", + "libc", + "os_info", + "rustc_version", + "sentry-core", + "uname", +] + +[[package]] +name = "sentry-core" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901f761681f97db3db836ef9e094acdd8756c40215326c194201941947164ef1" +dependencies = [ + "once_cell", + "rand", + "sentry-types", + "serde", + "serde_json", +] + +[[package]] +name = "sentry-debug-images" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afdb263e73d22f39946f6022ed455b7561b22ff5553aca9be3c6a047fa39c328" +dependencies = [ + "findshlibs", + "once_cell", + "sentry-core", +] + +[[package]] +name = "sentry-panic" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fbf1c163f8b6a9d05912e1b272afa27c652e8b47ea60cb9a57ad5e481eea99" +dependencies = [ + "sentry-backtrace", + "sentry-core", +] + +[[package]] +name = "sentry-tracing" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82eabcab0a047040befd44599a1da73d3adb228ff53b5ed9795ae04535577704" +dependencies = [ + "sentry-backtrace", + "sentry-core", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sentry-types" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da956cca56e0101998c8688bc65ce1a96f00673a0e58e663664023d4c7911e82" +dependencies = [ + "debugid", + "hex", + "rand", + "serde", + "serde_json", + "thiserror", + "time 0.3.36", + "url", + "uuid 1.10.0", +] + [[package]] name = "serde" -version = "1.0.163" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float 2.10.1", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", ] [[package]] @@ -2618,6 +4307,54 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "sha1" version = "0.10.5" @@ -2645,14 +4382,33 @@ dependencies = [ [[package]] name = "sha2" version = "0.10.6" +source = "git+https://github.com/RustCrypto/hashes.git?rev=1731ced4a116d61ba9dc6ee6d0f38fb8102e357a#1731ced4a116d61ba9dc6ee6d0f38fb8102e357a" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", "digest 0.10.7", ] +[[package]] +name = "sha3" +version = "0.10.6" +source = "git+https://github.com/RustCrypto/hashes.git?rev=7a187e934c1f6c68e4b4e5cf37541b7a0d64d303#7a187e934c1f6c68e4b4e5cf37541b7a0d64d303" +dependencies = [ + "digest 0.10.7", + "keccak", +] + [[package]] name = "sha3" version = "0.10.8" @@ -2663,6 +4419,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -2672,6 +4437,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + [[package]] name = "signature" version = "2.1.0" @@ -2707,10 +4482,35 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" name = "socket2" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ - "libc", - "winapi", + "base64 0.13.1", + "bytes", + "futures", + "httparse", + "log", + "rand", + "sha-1", ] [[package]] @@ -2733,6 +4533,22 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + [[package]] name = "spki" version = "0.7.2" @@ -2740,9 +4556,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der", + "der 0.7.6", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -2783,7 +4605,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -2798,22 +4620,32 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "svm-rs" -version = "0.2.23" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a04fc4f5cd35c700153b233f5575ccb3237e0f941fa5049d9e98254d10bf2fe" +checksum = "a7caafeac3fe8a93a9f2d1d1f80d14123b0dfbae8491be3c26bb8c44aed5d9ea" dependencies = [ + "anyhow", + "cfg-if", + "clap 3.2.25", + "console 0.14.1", + "dialoguer", "fs2", "hex", "home", + "indicatif", + "itertools", "once_cell", + "rand", "reqwest", "semver", "serde", "serde_json", - "sha2 0.10.6", + "sha2 0.9.9", + "tempfile", "thiserror", + "tokio", + "tracing", "url", - "zip", ] [[package]] @@ -2829,15 +4661,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.16" +version = "2.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "tap" version = "1.0.1" @@ -2877,41 +4715,93 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", ] [[package]] name = "time" -version = "0.3.21" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", "serde", "time-core", + "time-macros", ] [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] [[package]] name = "tiny-keccak" @@ -2939,31 +4829,52 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.1" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", "num_cpus", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", ] [[package]] @@ -2972,7 +4883,29 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" dependencies = [ - "rustls", + "rustls 0.21.1", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", "tokio", ] @@ -2984,9 +4917,9 @@ checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.21.1", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.0", "tungstenite", "webpki-roots 0.23.1", ] @@ -2999,6 +4932,7 @@ checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -3014,14 +4948,14 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.9", ] [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] @@ -3032,13 +4966,78 @@ version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f" dependencies = [ - "indexmap", + "indexmap 1.9.3", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.4.6", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "tonic" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +dependencies = [ + "async-trait", + "axum", + "base64 0.21.1", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.11.9", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", ] +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -3052,6 +5051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3065,7 +5065,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", ] [[package]] @@ -3075,6 +5075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", + "valuable", ] [[package]] @@ -3087,6 +5088,76 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" +dependencies = [ + "once_cell", + "opentelemetry", + "opentelemetry_sdk", + "smallvec", + "tracing", + "tracing-core", + "tracing-log 0.1.4", + "tracing-subscriber", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "time 0.3.36", + "tracing", + "tracing-core", + "tracing-log 0.2.0", + "tracing-serde", +] + [[package]] name = "try-lock" version = "0.2.4" @@ -3106,7 +5177,7 @@ dependencies = [ "httparse", "log", "rand", - "rustls", + "rustls 0.21.1", "sha1", "thiserror", "url", @@ -3132,6 +5203,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "uname" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b72f89f0ca32e4db1c04e2a72f5345d59796d4866a1ee0609084569f73683dc8" +dependencies = [ + "libc", +] + [[package]] name = "unicode-bidi" version = "0.3.13" @@ -3153,29 +5233,67 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + [[package]] name = "unicode-xid" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unsafe-libyaml" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72139d247e5f97a3eff96229a7ae85ead5328a39efe76f8bf5a06313d505b6ea" +dependencies = [ + "base64 0.22.1", + "log", + "native-tls", + "once_cell", + "url", +] + [[package]] name = "url" -version = "2.3.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf-8" version = "0.7.6" @@ -3192,11 +5310,32 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", - "serde", -] +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "serde", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" @@ -3204,6 +5343,46 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vise" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +dependencies = [ + "compile-fmt", + "elsa", + "linkme", + "once_cell", + "prometheus-client", + "vise-macros", +] + +[[package]] +name = "vise-macros" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "vlog" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "chrono", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "sentry", + "serde", + "serde_json", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", +] + [[package]] name = "walkdir" version = "2.3.3" @@ -3224,6 +5403,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -3251,7 +5436,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", "wasm-bindgen-shared", ] @@ -3285,7 +5470,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.70", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3312,8 +5497,8 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -3331,7 +5516,16 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" dependencies = [ - "rustls-webpki", + "rustls-webpki 0.100.1", +] + +[[package]] +name = "webpki-roots" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", ] [[package]] @@ -3365,6 +5559,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -3383,6 +5586,15 @@ dependencies = [ "windows-targets 0.48.0", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -3413,6 +5625,22 @@ dependencies = [ "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -3425,6 +5653,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -3437,6 +5671,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -3449,6 +5689,18 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -3461,6 +5713,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -3473,6 +5731,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -3485,6 +5749,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -3497,6 +5767,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "winnow" version = "0.4.6" @@ -3506,6 +5782,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" @@ -3556,31 +5841,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" [[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +name = "zk_evm" +version = "1.3.3" +source = "git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2#fbee20f5bac7d6ca3e22ae69b2077c510a07de4e" dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd", + "anyhow", + "lazy_static", + "num", + "serde", + "serde_json", + "static_assertions", + "zk_evm_abstractions", + "zkevm_opcode_defs", +] + +[[package]] +name = "zk_evm_abstractions" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git#32dd320953841aa78579d9da08abbc70bcaed175" +dependencies = [ + "anyhow", + "num_enum 0.6.1", + "serde", + "static_assertions", + "zkevm_opcode_defs", +] + +[[package]] +name = "zkevm_opcode_defs" +version = "1.3.2" +source = "git+https://github.com/matter-labs/era-zkevm_opcode_defs.git?branch=v1.3.2#dffacadeccdfdbff4bc124d44c595c4a6eae5013" +dependencies = [ + "bitflags 2.6.0", + "blake2 0.10.6 (git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e)", + "ethereum-types", + "k256 0.11.6", + "lazy_static", + "sha2 0.10.6", + "sha3 0.10.6", ] [[package]] -name = "zksync-web3-rs" +name = "zksync-ethers-rs" version = "0.1.1" dependencies = [ "async-trait", - "clap", + "clap 4.3.0", + "colored", "env_logger", "ethers", "ethers-contract", @@ -3589,37 +5896,247 @@ dependencies = [ "log", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.8", "thiserror", "tokio", + "zksync_system_constants", + "zksync_types", + "zksync_web3_decl", ] [[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +name = "zksync_basic_types" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "anyhow", + "chrono", + "ethabi", + "hex", + "num_enum 0.7.2", + "serde", + "serde_json", + "serde_with", + "strum", + "thiserror", + "tiny-keccak", + "url", +] + +[[package]] +name = "zksync_concurrency" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" dependencies = [ - "zstd-safe", + "anyhow", + "once_cell", + "pin-project", + "rand", + "sha3 0.10.8", + "thiserror", + "time 0.3.36", + "tokio", + "tracing", + "tracing-subscriber", + "vise", ] [[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +name = "zksync_config" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" dependencies = [ - "libc", - "zstd-sys", + "anyhow", + "rand", + "secrecy", + "serde", + "zksync_basic_types", + "zksync_consensus_utils", + "zksync_crypto_primitives", ] [[package]] -name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +name = "zksync_consensus_utils" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" dependencies = [ - "cc", - "libc", - "pkg-config", + "rand", + "thiserror", + "zksync_concurrency", +] + +[[package]] +name = "zksync_contracts" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "envy", + "ethabi", + "hex", + "once_cell", + "serde", + "serde_json", + "zksync_utils", +] + +[[package]] +name = "zksync_crypto" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", + "hex", + "once_cell", + "serde", + "sha2 0.10.8", + "thiserror", + "zksync_basic_types", +] + +[[package]] +name = "zksync_crypto_primitives" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "anyhow", + "hex", + "rand", + "secp256k1", + "serde", + "serde_json", + "thiserror", + "zksync_basic_types", + "zksync_utils", +] + +[[package]] +name = "zksync_mini_merkle_tree" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "once_cell", + "zksync_basic_types", + "zksync_crypto", +] + +[[package]] +name = "zksync_protobuf" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +dependencies = [ + "anyhow", + "bit-vec", + "once_cell", + "prost 0.12.6", + "prost-reflect", + "quick-protobuf", + "rand", + "serde", + "serde_json", + "serde_yaml", + "zksync_concurrency", + "zksync_consensus_utils", + "zksync_protobuf_build", +] + +[[package]] +name = "zksync_protobuf_build" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +dependencies = [ + "anyhow", + "heck 0.5.0", + "prettyplease", + "proc-macro2", + "prost-build", + "prost-reflect", + "protox", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "zksync_system_constants" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "once_cell", + "zksync_basic_types", + "zksync_utils", +] + +[[package]] +name = "zksync_types" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "anyhow", + "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono", + "derive_more 1.0.0-beta.6", + "hex", + "itertools", + "num", + "num_enum 0.7.2", + "once_cell", + "prost 0.12.6", + "rlp", + "secp256k1", + "serde", + "serde_json", + "strum", + "thiserror", + "zksync_basic_types", + "zksync_config", + "zksync_contracts", + "zksync_crypto_primitives", + "zksync_mini_merkle_tree", + "zksync_protobuf", + "zksync_protobuf_build", + "zksync_system_constants", + "zksync_utils", +] + +[[package]] +name = "zksync_utils" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "anyhow", + "bigdecimal", + "futures", + "hex", + "itertools", + "num", + "once_cell", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "vlog", + "zk_evm", + "zksync_basic_types", +] + +[[package]] +name = "zksync_web3_decl" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +dependencies = [ + "anyhow", + "async-trait", + "futures", + "jsonrpsee", + "pin-project-lite", + "rlp", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "vise", + "zksync_config", + "zksync_types", ] From 879a286796df64c773bff7c7b308cbe230a33b8f Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:12:27 +0200 Subject: [PATCH 20/75] Comment deprecated tests --- tests/lib.rs | 4 +- tests/provider_tests.rs | 885 ---------------------------- tests/wallet_tests.rs | 1070 +++++++++++++++++----------------- tests/zk_middleware_tests.rs | 883 ++++++++++++++++++++++++++++ 4 files changed, 1420 insertions(+), 1422 deletions(-) delete mode 100644 tests/provider_tests.rs create mode 100644 tests/zk_middleware_tests.rs diff --git a/tests/lib.rs b/tests/lib.rs index 56aea6e..c0d188f 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -1,3 +1,3 @@ -mod provider_tests; -mod utils; +pub mod utils; mod wallet_tests; +pub mod zk_middleware_tests; diff --git a/tests/provider_tests.rs b/tests/provider_tests.rs deleted file mode 100644 index bd383d8..0000000 --- a/tests/provider_tests.rs +++ /dev/null @@ -1,885 +0,0 @@ -use ethers::{ - abi::Tokenize, - providers::Middleware, - types::{Address, Bytes, H256, U256}, -}; -use serde::{Deserialize, Serialize}; -use std::{fs::File, path::PathBuf, str::FromStr}; -use zksync_ethers_rs::{ - types::zksync::api::{CallTracerConfig, SupportedTracers, TracerConfig}, - zk_middleware::ZKMiddleware, - zks_wallet::{DeployRequest, TransferRequest, ZKSWallet}, -}; - -#[tokio::test] -async fn test_provider_estimate_fee() { - let provider = era_provider(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let transaction = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); - - assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); - assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); - assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); - assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); -} - -#[tokio::test] -async fn test_provider_get_testnet_paymaster() { - let provider = era_provider(); - - assert!(provider.get_testnet_paymaster().await.is_ok()); -} - -#[tokio::test] -async fn test_provider_estimate_gas_l1_to_l2() { - let provider = era_provider(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let transaction = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); - - assert_eq!(estimated_fee, U256::from(36_768_868_u64)); -} - -#[tokio::test] -// TODO: This test is flacky. It could fail in the future. -async fn test_provider_get_all_account_balances() { - let provider = era_provider(); - let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" - .parse() - .unwrap(); - let balance = provider.get_balance(address, None).await.unwrap(); - - let balances = provider.get_all_account_balances(address).await.unwrap(); - - assert_eq!( - balances - .get( - &"0x0000000000000000000000000000000000000000" - .parse::
() - .unwrap() - ) - .unwrap() - .clone(), - balance - ); -} - -#[tokio::test] -async fn test_provider_get_block_details() { - let provider = era_provider(); - let existing_block = 1_u64; - let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; - - let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); - let non_existing_block_details = provider - .get_block_details(non_existing_block.as_u32()) - .await - .unwrap(); - - assert!(existing_block_details.is_some()); - assert!(non_existing_block_details.is_none()) -} - -#[tokio::test] -async fn test_provider_get_bridge_contracts() { - let provider = era_provider(); - - assert!(provider.get_bridge_contracts().await.is_ok()); -} - -#[tokio::test] -async fn test_provider_get_bytecode_by_hash() { - let provider = era_provider(); - let invalid_hash = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" - .parse() - .unwrap(); - let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); - let valid_hash = test_block.base.root_hash.unwrap(); - - assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); - assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); -} - -#[ignore] -#[tokio::test] -async fn test_provider_get_confirmed_tokens() { - let provider = era_provider(); - let from = 0; - let limit = 10; - - assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); -} - -// TODO: This test is flacky. It could fail in the future. -#[tokio::test] -async fn test_provider_get_l1_batch_block_range() { - let provider = era_provider(); - let batch = 1_u64; - - assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); -} - -#[tokio::test] -async fn test_provider_get_l1_batch_details() { - let provider = era_provider(); - let batch = 1_u64; - - assert!(provider.get_l1_batch_details(batch).await.is_ok()); -} - -#[tokio::test] -async fn test_provider_get_l2_to_l1_log_proof() { - let provider = era_provider(); - let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" - .parse() - .unwrap(); - - assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); -} - -// #[tokio::test] -// async fn test_provider_get_l2_to_l1_msg_proof() { -// let provider = local_provider(); -// let block = 2; -// let sender = /* create an address object */; -// let msg = /* create a hash object */; - -// assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); -// } - -#[tokio::test] -async fn test_provider_get_main_contract() { - let provider = era_provider(); - - assert!(provider.get_main_contract().await.is_ok()); -} - -// TODO: This test is flacky. It could fail in the future. We should create a -// transaction, send it, and the assert that the details match. -#[tokio::test] -async fn test_provider_get_raw_block_transactions() { - let provider = era_provider(); - let block = 1_u64; - - assert!(provider.get_raw_block_transactions(block).await.is_ok()); -} - -#[tokio::test] -async fn test_provider_get_token_price() { - let provider = era_provider(); - let address: Address = "0x0000000000000000000000000000000000000000" - .parse() - .unwrap(); - - assert!(provider.get_token_price(address).await.is_ok()); -} - -// TODO: This test is flacky. It could fail in the future. We should create a -// transaction, send it, and the assert that the details match. -#[tokio::test] -async fn test_provider_get_transaction_details() { - let provider = era_provider(); - let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); - let hash = test_block.base.root_hash.unwrap(); - - assert!(provider.get_transaction_details(hash).await.is_ok()); -} - -#[tokio::test] -async fn test_provider_get_l1_batch_number() { - let provider = era_provider(); - - assert!(provider.get_l1_batch_number().await.is_ok()); -} - -#[tokio::test] -async fn test_provider_get_l1_chain_id() { - let provider = era_provider(); - - assert!(provider.get_l1_chain_id().await.is_ok()); -} - -#[tokio::test] -async fn test_provider_debug_trace_block_by_hash() { - let provider = era_provider(); - let block_number = provider.get_block_number().await.unwrap() - 1_u64; - let test_block = provider - .get_block_details(block_number.as_u32()) - .await - .unwrap() - .unwrap(); - let hash_block = test_block.base.root_hash.unwrap(); - - let options = Some(TracerConfig { - tracer: SupportedTracers::CallTracer, - tracer_config: CallTracerConfig { - only_top_call: true, - }, - }); - - assert!( - ZKMiddleware::debug_trace_block_by_hash(&provider, hash_block, None) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_block_by_hash(&provider, hash_block, options) - .await - .is_ok() - ); -} - -#[tokio::test] -async fn test_provider_debug_trace_block_by_number() { - let provider = era_provider(); - let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; - let non_existing_block_number = existing_block_number + 100_u64; - let options = Some(TracerConfig { - tracer: SupportedTracers::CallTracer, - tracer_config: CallTracerConfig { - only_top_call: true, - }, - }); - - assert!( - ZKMiddleware::debug_trace_block_by_number(&provider, existing_block_number, None) - .await - .is_ok() - ); - assert!(ZKMiddleware::debug_trace_block_by_number( - &provider, - existing_block_number, - options.clone() - ) - .await - .is_ok()); - assert!( - ZKMiddleware::debug_trace_block_by_number(&provider, non_existing_block_number, None) - .await - .is_err() - ); - assert!(ZKMiddleware::debug_trace_block_by_number( - &provider, - non_existing_block_number, - options - ) - .await - .is_err()); -} - -#[tokio::test] -async fn test_provider_debug_trace_call() { - let provider = era_provider(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let request = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let block = provider.get_block_number().await.ok(); - let options = Some(TracerConfig { - tracer: SupportedTracers::CallTracer, - tracer_config: CallTracerConfig { - only_top_call: true, - }, - }); - - println!( - "{:?}", - ZKMiddleware::debug_trace_call::<&TestTransaction, u64>(&provider, &request, None, None) - .await - ); - - assert!(ZKMiddleware::debug_trace_call::<&TestTransaction, u64>( - &provider, &request, None, None - ) - .await - .is_ok()); - assert!( - ZKMiddleware::debug_trace_call(&provider, &request, block, None) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_call(&provider, &request, block, options.clone()) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_call::<_, u64>(&provider, request, None, options) - .await - .is_ok() - ); -} - -// TODO: This test is flacky. It could fail in the future. -#[tokio::test] -async fn test_provider_debug_trace_transaction() { - let era_provider = era_provider(); - let zk_wallet = ZKSWallet::new(local_wallet(), None, Some(era_provider.clone()), None).unwrap(); - - let transfer_request = TransferRequest::new(1_u64.into()) - .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) - .from(zk_wallet.l2_address()); - let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); - let invalid_transaction_hash: H256 = - "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" - .parse() - .unwrap(); - - let options = Some(TracerConfig { - tracer: SupportedTracers::CallTracer, - tracer_config: CallTracerConfig { - only_top_call: true, - }, - }); - - assert!( - ZKMiddleware::debug_trace_transaction(&era_provider, transaction_hash, None) - .await - .is_ok() - ); - assert!(ZKMiddleware::debug_trace_transaction( - &era_provider, - transaction_hash, - options.clone() - ) - .await - .is_ok()); - assert!( - ZKMiddleware::debug_trace_transaction(&era_provider, invalid_transaction_hash, None) - .await - .is_err() - ); - assert!(ZKMiddleware::debug_trace_transaction( - &era_provider, - invalid_transaction_hash, - options - ) - .await - .is_err()); -} - -#[tokio::test] -async fn test_signer_estimate_fee() { - let provider = era_signer(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let transaction = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); - - assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); - assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); - assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); - assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); -} - -#[tokio::test] -async fn test_signer_get_testnet_paymaster() { - let provider = era_signer(); - - assert!(provider.get_testnet_paymaster().await.is_ok()); -} - -#[tokio::test] -async fn test_signer_estimate_gas_l1_to_l2() { - let provider = era_signer(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let transaction = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); - - assert_eq!(estimated_fee, U256::from(36_768_868_u32)); -} - -#[tokio::test] -// TODO: This test is flacky. It could fail in the future. -async fn test_signer_get_all_account_balances() { - let provider = era_signer(); - let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" - .parse() - .unwrap(); - let balance = provider.get_balance(address, None).await.unwrap(); - - let balances = provider.get_all_account_balances(address).await.unwrap(); - - assert_eq!( - balances - .get( - &"0x0000000000000000000000000000000000000000" - .parse::
() - .unwrap() - ) - .unwrap() - .clone(), - balance - ); -} - -#[tokio::test] -async fn test_signer_get_block_details() { - let provider = era_signer(); - let existing_block = 1_u64; - let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; - - let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); - let non_existing_block_details = provider - .get_block_details(non_existing_block.as_u32()) - .await - .unwrap(); - - assert!(existing_block_details.is_some()); - assert!(non_existing_block_details.is_none()) -} - -#[tokio::test] -async fn test_signer_get_bridge_contracts() { - let provider = era_signer(); - - assert!(provider.get_bridge_contracts().await.is_ok()); -} - -#[tokio::test] -async fn test_signer_get_bytecode_by_hash() { - let provider = era_signer(); - let invalid_hash = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" - .parse() - .unwrap(); - let valid_hash: H256 = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" - .parse() - .unwrap(); - - assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); - assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); -} - -#[ignore] -#[tokio::test] -async fn test_signer_get_confirmed_tokens() { - let provider = era_signer(); - let from = 0; - let limit = 10; - - assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); -} - -// TODO: This test is flacky. It could fail in the future. -#[tokio::test] -async fn test_signer_get_l1_batch_block_range() { - let provider = era_signer(); - let batch = 1_u64; - - assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); -} - -#[tokio::test] -async fn test_signer_get_l1_batch_details() { - let provider = era_signer(); - let batch = 1_u64; - - assert!(provider.get_l1_batch_details(batch).await.is_ok()); -} - -#[tokio::test] -async fn test_signer_get_l2_to_l1_log_proof() { - let provider = era_signer(); - let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" - .parse() - .unwrap(); - - assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); -} - -// #[tokio::test] -// async fn test_signer_get_l2_to_l1_msg_proof() { -// let provider = local_signer(); -// let block = 2; -// let sender = /* create an address object */; -// let msg = /* create a hash object */; - -// assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); -// } - -#[tokio::test] -async fn test_signer_get_main_contract() { - let provider = era_signer(); - - assert!(provider.get_main_contract().await.is_ok()); -} - -// TODO: This test is flacky. It could fail in the future. We should create a -// transaction, send it, and the assert that the details match. -#[tokio::test] -async fn test_signer_get_raw_block_transactions() { - let provider = era_signer(); - let block = 1_u64; - - assert!(provider.get_raw_block_transactions(block).await.is_ok()); -} - -#[tokio::test] -async fn test_signer_get_token_price() { - let provider = era_signer(); - let address: Address = "0x0000000000000000000000000000000000000000" - .parse() - .unwrap(); - - assert!(provider.get_token_price(address).await.is_ok()); -} - -// TODO: This test is flacky. It could fail in the future. We should create a -// transaction, send it, and the assert that the details match. -#[tokio::test] -async fn test_signer_get_transaction_details() { - let provider = era_signer(); - let hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" - .parse() - .unwrap(); - - assert!(provider.get_transaction_details(hash).await.is_ok()); -} - -#[tokio::test] -async fn test_signer_get_l1_batch_number() { - let provider = era_signer(); - - assert!(provider.get_l1_batch_number().await.is_ok()); -} - -#[tokio::test] -async fn test_signer_get_l1_chain_id() { - let provider = era_signer(); - - assert!(provider.get_l1_chain_id().await.is_ok()); -} - -#[tokio::test] -async fn test_signer_debug_trace_block_by_hash() { - let provider = era_signer(); - let block_number = provider.get_block_number().await.unwrap() - 1_u64; - let test_block = provider - .get_block_details(block_number.as_u32()) - .await - .unwrap() - .unwrap(); - let hash = test_block.base.root_hash.unwrap(); - - let options = Some(TracerConfig { - tracer: SupportedTracers::CallTracer, - tracer_config: CallTracerConfig { - only_top_call: true, - }, - }); - - assert!( - ZKMiddleware::debug_trace_block_by_hash(&provider, hash, None) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_block_by_hash(&provider, hash, options) - .await - .is_ok() - ); -} - -#[tokio::test] -async fn test_signer_debug_trace_block_by_number() { - let provider = era_signer(); - let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; - let non_existing_block_number = existing_block_number + 100_u64; - let options = Some(TracerConfig { - tracer: SupportedTracers::CallTracer, - tracer_config: CallTracerConfig { - only_top_call: true, - }, - }); - - assert!( - ZKMiddleware::debug_trace_block_by_number(&provider, existing_block_number, None) - .await - .is_ok() - ); - assert!(ZKMiddleware::debug_trace_block_by_number( - &provider, - existing_block_number, - options.clone() - ) - .await - .is_ok()); - assert!( - ZKMiddleware::debug_trace_block_by_number(&provider, non_existing_block_number, None) - .await - .is_err() - ); - assert!(ZKMiddleware::debug_trace_block_by_number( - &provider, - non_existing_block_number, - options - ) - .await - .is_err()); -} - -#[tokio::test] -async fn test_signer_debug_trace_call() { - let provider = era_signer(); - #[derive(Serialize, Deserialize, Debug)] - struct TestTransaction { - from: String, - to: String, - data: String, - } - - let request = TestTransaction { - from: "0x1111111111111111111111111111111111111111".to_owned(), - to: "0x2222222222222222222222222222222222222222".to_owned(), - data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), - }; - - let block = provider.get_block_number().await.ok(); - let options = Some(TracerConfig { - tracer: SupportedTracers::CallTracer, - tracer_config: CallTracerConfig { - only_top_call: true, - }, - }); - - assert!( - ZKMiddleware::debug_trace_call::<_, u64>(&provider, &request, None, None) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_call(&provider, &request, block, None) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_call(&provider, &request, block, options.clone()) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_call::<_, u64>(&provider, request, None, options) - .await - .is_ok() - ); -} - -#[tokio::test] -async fn test_signer_debug_trace_transaction() { - let era_signer = era_signer(); - let zk_wallet = ZKSWallet::new(local_wallet(), None, Some(era_signer.clone()), None).unwrap(); - - let transfer_request = TransferRequest::new(1_u64.into()) - .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) - .from(zk_wallet.l2_address()); - let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); - let invalid_transaction_hash: H256 = - "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" - .parse() - .unwrap(); - - let options = Some(TracerConfig { - tracer: SupportedTracers::CallTracer, - tracer_config: CallTracerConfig { - only_top_call: true, - }, - }); - - assert!( - ZKMiddleware::debug_trace_transaction(&era_signer, transaction_hash, None) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_transaction(&era_signer, transaction_hash, options) - .await - .is_ok() - ); - assert!( - ZKMiddleware::debug_trace_transaction(&era_signer, invalid_transaction_hash, None) - .await - .is_err() - ); -} - -#[ignore = "Deprecated"] -#[tokio::test] -async fn test_send_function_with_arguments() { - // Deploying a test contract - let era_provider = era_provider(); - let wallet = local_wallet(); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/storage_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = - DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["0".to_owned()]) - .from(zk_wallet.l2_address()); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let call_request = CallRequest::new(contract_address, "getValue()(uint256)".to_owned()); - let initial_value = ZKMiddleware::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!(initial_value, U256::from(0_i32).into_tokens()); - - let value_to_set = String::from("10"); - era_provider - .send_eip712( - &zk_wallet.l2_wallet, - contract_address, - "setValue(uint256)", - Some([value_to_set.clone()].into()), - None, - ) - .await - .unwrap() - .await - .unwrap() - .unwrap(); - let set_value = ZKMiddleware::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!( - set_value, - U256::from(value_to_set.parse::().unwrap()).into_tokens() - ); - - era_provider - .send_eip712( - &zk_wallet.l2_wallet, - contract_address, - "incrementValue()", - None, - None, - ) - .await - .unwrap() - .await - .unwrap() - .unwrap(); - let incremented_value = ZKMiddleware::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!( - incremented_value, - (value_to_set.parse::().unwrap() + 1_u64).into_tokens() - ); -} - -#[ignore = "Deprecated"] -#[tokio::test] -async fn test_call_view_function_with_no_parameters() { - // Deploying a test contract - let era_provider = era_provider(); - let wallet = local_wallet(); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/basic_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let call_request = CallRequest::new(contract_address, "str_out()(string)".to_owned()); - let output = ZKMiddleware::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!(output, String::from("Hello World!").into_tokens()); -} - -#[ignore = "Deprecated"] -#[tokio::test] -async fn test_call_view_function_with_arguments() { - // Deploying a test contract - let era_provider = era_provider(); - let wallet = local_wallet(); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/basic_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]) - .from(zk_wallet.l2_address()); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let call_request = CallRequest::new(contract_address, "plus_one(uint256)".to_owned()) - .function_parameters(vec!["1".to_owned()]); - let no_return_type_output = ZKMiddleware::call(&era_provider, &call_request) - .await - .unwrap(); - - let call_request = call_request.function_signature("plus_one(uint256)(uint256)".to_owned()); - let known_return_type_output = ZKMiddleware::call(&era_provider, &call_request) - .await - .unwrap(); - - assert_eq!( - no_return_type_output, - Bytes::from([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2 - ]) - .into_tokens() - ); - assert_eq!(known_return_type_output, U256::from(2_u64).into_tokens()); -} diff --git a/tests/wallet_tests.rs b/tests/wallet_tests.rs index b9f1b04..8627beb 100644 --- a/tests/wallet_tests.rs +++ b/tests/wallet_tests.rs @@ -1,605 +1,605 @@ -use crate::zk_middleware::ZKMiddleware; -use crate::zks_wallet::{DeployRequest, TransferRequest, WithdrawRequest, ZKSWallet}; -use ethers::contract::abigen; -use ethers::providers::Middleware; -use ethers::signers::{LocalWallet, Signer}; -use ethers::types::Address; -use ethers::types::U256; -use ethers::utils::parse_units; -use std::fs::File; -use std::path::PathBuf; -use std::str::FromStr; -use zksync_types::DEFAULT_ERA_CHAIN_ID; - -abigen!( - ERC20Token, - r#"[ - balanceOf(address)(uint256) - ]"# -); - -#[tokio::test] -async fn test_transfer() { - let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" - .parse() - .unwrap(); - let amount_to_transfer: U256 = 1_i32.into(); - - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(sender_private_key) - .unwrap() - .with_chain_id(DEFAULT_ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let sender_balance_before = era_provider - .get_balance(zk_wallet.l2_address(), None) - .await - .unwrap(); - let receiver_balance_before = era_provider - .get_balance(receiver_address, None) - .await - .unwrap(); - - println!("Sender balance before: {sender_balance_before}"); - println!("Receiver balance before: {receiver_balance_before}"); - - let request = TransferRequest::new(amount_to_transfer) - .to(receiver_address) - .from(zk_wallet.l2_address()); - let tx_hash = zk_wallet.transfer(&request, None).await.unwrap(); - - let receipt = era_provider - .get_transaction_receipt(tx_hash) - .await - .unwrap() - .unwrap(); - - assert_eq!(receipt.from, zk_wallet.l2_address()); - assert_eq!(receipt.to.unwrap(), receiver_address); - - let sender_balance_after = era_provider - .get_balance(zk_wallet.l2_address(), None) - .await - .unwrap(); - let receiver_balance_after = era_provider - .get_balance(receiver_address, None) - .await - .unwrap(); - - println!("Sender balance after: {sender_balance_after}"); - println!("Receiver balance after: {receiver_balance_after}"); - - assert_eq!( - sender_balance_after, - sender_balance_before - - (amount_to_transfer - + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) - ); - assert_eq!( - receiver_balance_after, - receiver_balance_before + amount_to_transfer - ); -} +// use crate::zk_middleware::ZKMiddleware; +// use crate::zks_wallet::{DeployRequest, TransferRequest, WithdrawRequest, ZKSWallet}; +// use ethers::contract::abigen; +// use ethers::providers::Middleware; +// use ethers::signers::{LocalWallet, Signer}; +// use ethers::types::Address; +// use ethers::types::U256; +// use ethers::utils::parse_units; +// use std::fs::File; +// use std::path::PathBuf; +// use std::str::FromStr; +// use zksync_types::DEFAULT_ERA_CHAIN_ID; + +// abigen!( +// ERC20Token, +// r#"[ +// balanceOf(address)(uint256) +// ]"# +// ); // #[tokio::test] -// async fn test_deposit() { -// let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; -// let request = DepositRequest::new(parse_units("0.01", "ether").unwrap().into()); -// println!("Amount: {}", request.amount); - -// let l1_provider = eth_provider(); -// let l2_provider = era_provider(); -// let wallet = LocalWallet::from_str(private_key) +// async fn test_transfer() { +// let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; +// let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" +// .parse() +// .unwrap(); +// let amount_to_transfer: U256 = 1_i32.into(); + +// let era_provider = era_provider(); +// let wallet = LocalWallet::from_str(sender_private_key) // .unwrap() // .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// let zk_wallet = ZKSWallet::new( -// wallet, -// None, -// Some(l2_provider.clone()), -// Some(l1_provider.clone()), -// ) -// .unwrap(); +// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); -// let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); -// let l2_balance_before = zk_wallet.era_balance().await.unwrap(); -// println!("L1 balance before: {l1_balance_before}"); -// println!("L2 balance before: {l2_balance_before}"); +// let sender_balance_before = era_provider +// .get_balance(zk_wallet.l2_address(), None) +// .await +// .unwrap(); +// let receiver_balance_before = era_provider +// .get_balance(receiver_address, None) +// .await +// .unwrap(); -// let tx_hash = zk_wallet.deposit(&request).await.unwrap(); -// let receipt = l1_provider +// println!("Sender balance before: {sender_balance_before}"); +// println!("Receiver balance before: {receiver_balance_before}"); + +// let request = TransferRequest::new(amount_to_transfer) +// .to(receiver_address) +// .from(zk_wallet.l2_address()); +// let tx_hash = zk_wallet.transfer(&request, None).await.unwrap(); + +// let receipt = era_provider // .get_transaction_receipt(tx_hash) // .await // .unwrap() // .unwrap(); -// assert_eq!(receipt.status.unwrap(), 1_u8.into()); -// let _l2_receipt = l2_provider -// .get_transaction_receipt(receipt.transaction_hash) +// assert_eq!(receipt.from, zk_wallet.l2_address()); +// assert_eq!(receipt.to.unwrap(), receiver_address); + +// let sender_balance_after = era_provider +// .get_balance(zk_wallet.l2_address(), None) +// .await +// .unwrap(); +// let receiver_balance_after = era_provider +// .get_balance(receiver_address, None) // .await // .unwrap(); -// let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); -// let l2_balance_after = zk_wallet.era_balance().await.unwrap(); -// println!("L1 balance after: {l1_balance_after}"); -// println!("L2 balance after: {l2_balance_after}"); +// println!("Sender balance after: {sender_balance_after}"); +// println!("Receiver balance after: {receiver_balance_after}"); -// assert!( -// l1_balance_after <= l1_balance_before - request.amount(), -// "Balance on L1 should be decreased" +// assert_eq!( +// sender_balance_after, +// sender_balance_before +// - (amount_to_transfer +// + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) // ); -// assert!( -// l2_balance_after >= l2_balance_before + request.amount(), -// "Balance on L2 should be increased" +// assert_eq!( +// receiver_balance_after, +// receiver_balance_before + amount_to_transfer // ); // } +// // #[tokio::test] +// // async fn test_deposit() { +// // let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; +// // let request = DepositRequest::new(parse_units("0.01", "ether").unwrap().into()); +// // println!("Amount: {}", request.amount); + +// // let l1_provider = eth_provider(); +// // let l2_provider = era_provider(); +// // let wallet = LocalWallet::from_str(private_key) +// // .unwrap() +// // .with_chain_id(DEFAULT_ERA_CHAIN_ID); +// // let zk_wallet = ZKSWallet::new( +// // wallet, +// // None, +// // Some(l2_provider.clone()), +// // Some(l1_provider.clone()), +// // ) +// // .unwrap(); + +// // let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); +// // let l2_balance_before = zk_wallet.era_balance().await.unwrap(); +// // println!("L1 balance before: {l1_balance_before}"); +// // println!("L2 balance before: {l2_balance_before}"); + +// // let tx_hash = zk_wallet.deposit(&request).await.unwrap(); +// // let receipt = l1_provider +// // .get_transaction_receipt(tx_hash) +// // .await +// // .unwrap() +// // .unwrap(); +// // assert_eq!(receipt.status.unwrap(), 1_u8.into()); + +// // let _l2_receipt = l2_provider +// // .get_transaction_receipt(receipt.transaction_hash) +// // .await +// // .unwrap(); + +// // let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); +// // let l2_balance_after = zk_wallet.era_balance().await.unwrap(); +// // println!("L1 balance after: {l1_balance_after}"); +// // println!("L2 balance after: {l2_balance_after}"); + +// // assert!( +// // l1_balance_after <= l1_balance_before - request.amount(), +// // "Balance on L1 should be decreased" +// // ); +// // assert!( +// // l2_balance_after >= l2_balance_before + request.amount(), +// // "Balance on L2 should be increased" +// // ); +// // } + +// // #[tokio::test] +// // async fn test_deposit_to_another_address() { +// // let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; +// // let to: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" +// // .parse() +// // .unwrap(); +// // let amount = parse_units("0.01", "ether").unwrap().into(); +// // println!("Amount: {amount}"); + +// // let request = DepositRequest::new(amount).to(to); + +// // let l1_provider = eth_provider(); +// // let l2_provider = era_provider(); +// // let wallet = LocalWallet::from_str(private_key).unwrap(); +// // let zk_wallet = ZKSWallet::new( +// // wallet, +// // None, +// // Some(l2_provider.clone()), +// // Some(l1_provider.clone()), +// // ) +// // .unwrap(); + +// // let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); +// // let l2_balance_before = era_provider().get_balance(to, None).await.unwrap(); +// // println!("L1 balance before: {l1_balance_before}"); +// // println!("L2 balance before: {l2_balance_before}"); + +// // let tx_hash = zk_wallet.deposit(&request).await.unwrap(); +// // let receipt = l1_provider +// // .get_transaction_receipt(tx_hash) +// // .await +// // .unwrap() +// // .unwrap(); +// // assert_eq!(receipt.status.unwrap(), 1_u8.into()); + +// // let _l2_receipt = l2_provider +// // .get_transaction_receipt(receipt.transaction_hash) +// // .await +// // .unwrap(); + +// // let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); +// // let l2_balance_after = era_provider().get_balance(to, None).await.unwrap(); +// // println!("L1 balance after: {l1_balance_after}"); +// // println!("L2 balance after: {l2_balance_after}"); + +// // assert!( +// // l1_balance_after <= l1_balance_before - request.amount(), +// // "Balance on L1 should be decreased" +// // ); +// // assert!( +// // l2_balance_after >= l2_balance_before + request.amount(), +// // "Balance on L2 should be increased" +// // ); +// // } + +// // #[ignore = "FIXME Implement a fixture that deploys an ERC20 token"] +// // #[tokio::test] +// // async fn test_deposit_erc20_token() { +// // let amount: U256 = 1_i32.into(); +// // let private_key = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; +// // let l1_provider = eth_provider(); +// // let l2_provider = era_provider(); +// // let wallet = LocalWallet::from_str(private_key).unwrap(); +// // let zk_wallet = ZKSWallet::new( +// // wallet, +// // None, +// // Some(l2_provider.clone()), +// // Some(l1_provider.clone()), +// // ) +// // .unwrap(); + +// // let token_l1_address: Address = "0xc8F8cE6491227a6a2Ab92e67a64011a4Eba1C6CF" +// // .parse() +// // .unwrap(); + +// // let contract_l1 = ERC20Token::new(token_l1_address, Arc::new(l1_provider.clone())); + +// // let balance_erc20_l1_before: U256 = contract_l1 +// // .balance_of(zk_wallet.l1_address()) +// // .call() +// // .await +// // .unwrap(); + +// // let request = DepositRequest::new(amount).token(Some(token_l1_address)); + +// // let l1_tx_hash = zk_wallet.deposit(&request).await.unwrap(); +// // let l1_receipt = zk_wallet +// // .get_eth_provider() +// // .unwrap() +// // .get_transaction_receipt(l1_tx_hash) +// // .await +// // .unwrap() +// // .unwrap(); +// // assert_eq!(l1_receipt.status.unwrap(), 1_i32.into()); + +// // let balance_erc20_l1_after: U256 = contract_l1 +// // .balance_of(zk_wallet.l1_address()) +// // .call() +// // .await +// // .unwrap(); + +// // assert_eq!(balance_erc20_l1_after, balance_erc20_l1_before - amount); +// // // FIXME check balance on l2. +// // } + // #[tokio::test] -// async fn test_deposit_to_another_address() { -// let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; -// let to: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" +// async fn test_transfer_eip712() { +// let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; +// let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" // .parse() // .unwrap(); -// let amount = parse_units("0.01", "ether").unwrap().into(); -// println!("Amount: {amount}"); +// let amount_to_transfer: U256 = 1_i32.into(); -// let request = DepositRequest::new(amount).to(to); +// let era_provider = era_provider(); +// let wallet = LocalWallet::from_str(sender_private_key) +// .unwrap() +// .with_chain_id(DEFAULT_ERA_CHAIN_ID); +// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); -// let l1_provider = eth_provider(); -// let l2_provider = era_provider(); -// let wallet = LocalWallet::from_str(private_key).unwrap(); -// let zk_wallet = ZKSWallet::new( -// wallet, -// None, -// Some(l2_provider.clone()), -// Some(l1_provider.clone()), -// ) -// .unwrap(); +// let sender_balance_before = era_provider +// .get_balance(zk_wallet.l2_address(), None) +// .await +// .unwrap(); +// let receiver_balance_before = era_provider +// .get_balance(receiver_address, None) +// .await +// .unwrap(); -// let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); -// let l2_balance_before = era_provider().get_balance(to, None).await.unwrap(); -// println!("L1 balance before: {l1_balance_before}"); -// println!("L2 balance before: {l2_balance_before}"); +// println!("Sender balance before: {sender_balance_before}"); +// println!("Receiver balance before: {receiver_balance_before}"); + +// let transfer_request = TransferRequest::new(amount_to_transfer) +// .to(receiver_address) +// .from(zk_wallet.l2_address()); +// let tx_hash = zk_wallet +// .transfer_eip712(&transfer_request, None) +// .await +// .unwrap(); -// let tx_hash = zk_wallet.deposit(&request).await.unwrap(); -// let receipt = l1_provider +// let receipt = era_provider // .get_transaction_receipt(tx_hash) // .await // .unwrap() // .unwrap(); -// assert_eq!(receipt.status.unwrap(), 1_u8.into()); +// assert_eq!(receipt.from, zk_wallet.l2_address()); +// assert_eq!(receipt.to.unwrap(), receiver_address); -// let _l2_receipt = l2_provider -// .get_transaction_receipt(receipt.transaction_hash) +// let sender_balance_after = era_provider +// .get_balance(zk_wallet.l2_address(), None) +// .await +// .unwrap(); +// let receiver_balance_after = era_provider +// .get_balance(receiver_address, None) // .await // .unwrap(); -// let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); -// let l2_balance_after = era_provider().get_balance(to, None).await.unwrap(); -// println!("L1 balance after: {l1_balance_after}"); -// println!("L2 balance after: {l2_balance_after}"); +// println!("Sender balance after: {sender_balance_after}"); +// println!("Receiver balance after: {receiver_balance_after}"); -// assert!( -// l1_balance_after <= l1_balance_before - request.amount(), -// "Balance on L1 should be decreased" +// assert_eq!( +// sender_balance_after, +// sender_balance_before +// - (amount_to_transfer +// + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) // ); -// assert!( -// l2_balance_after >= l2_balance_before + request.amount(), -// "Balance on L2 should be increased" +// assert_eq!( +// receiver_balance_after, +// receiver_balance_before + amount_to_transfer // ); // } -// #[ignore = "FIXME Implement a fixture that deploys an ERC20 token"] // #[tokio::test] -// async fn test_deposit_erc20_token() { -// let amount: U256 = 1_i32.into(); -// let private_key = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; -// let l1_provider = eth_provider(); -// let l2_provider = era_provider(); -// let wallet = LocalWallet::from_str(private_key).unwrap(); -// let zk_wallet = ZKSWallet::new( -// wallet, -// None, -// Some(l2_provider.clone()), -// Some(l1_provider.clone()), -// ) -// .unwrap(); +// async fn test_deploy_contract_with_constructor_arg_uint() { +// let deployer_private_key = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; +// let era_provider = era_provider(); +// let wallet = LocalWallet::from_str(deployer_private_key) +// .unwrap() +// .with_chain_id(DEFAULT_ERA_CHAIN_ID); +// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); -// let token_l1_address: Address = "0xc8F8cE6491227a6a2Ab92e67a64011a4Eba1C6CF" -// .parse() -// .unwrap(); +// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// contract_path.push("src/abi/test_contracts/storage_combined.json"); +// let contract: CompiledContract = +// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// let deploy_request = +// DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["10".to_owned()]) +// .from(zk_wallet.l2_address()); +// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// let deploy_result = era_provider.get_code(contract_address, None).await; + +// assert!(deploy_result.is_ok()); +// } + +// #[tokio::test] +// async fn test_deploy_contract_with_constructor_arg_string() { +// let deployer_private_key = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; +// let era_provider = era_provider(); +// let wallet = LocalWallet::from_str(deployer_private_key) +// .unwrap() +// .with_chain_id(DEFAULT_ERA_CHAIN_ID); +// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + +// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// contract_path.push("src/abi/test_contracts/greeter_combined.json"); +// let contract: CompiledContract = +// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// let deploy_request = +// DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["Hey".to_owned()]) +// .from(zk_wallet.l2_address()); +// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// let deploy_result = era_provider.get_code(contract_address, None).await; + +// assert!(deploy_result.is_ok()); +// } + +// // #[tokio::test] +// // async fn test_deploy_contract_with_import() { +// // let deployer_private_key = +// // "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; +// // let era_provider = era_provider(); +// // let wallet = LocalWallet::from_str(deployer_private_key) +// // .unwrap() +// // .with_chain_id(DEFAULT_ERA_CHAIN_ID); +// // let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + +// // // Deploy imported contract first. +// // let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// // contract_path.push("src/abi/test_contracts/counter_combined.json"); +// // let counter_contract: CompiledContract = +// // serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// // let deploy_request = +// // DeployRequest::with(counter_contract.abi, counter_contract.bin.to_vec(), vec![]) +// // .from(zk_wallet.l2_address()); +// // let counter_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// // let deploy_result = era_provider.get_code(counter_contract_address, None).await; + +// // assert!(deploy_result.is_ok()); + +// // // Deploy another contract that imports the previous one. +// // let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// // contract_path.push("src/abi/test_contracts/import_combined.json"); + +// // let import_contract: CompiledContract = +// // serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// // let deploy_request = DeployRequest::with( +// // import_contract.abi, +// // import_contract.bin.to_vec(), +// // vec![format!("{counter_contract_address:?}")], +// // ) +// // .from(zk_wallet.l2_address()); +// // let import_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// // let call_request = CallRequest::new( +// // import_contract_address, +// // "getCounterValue()(uint256)".to_owned(), +// // ); +// // let value = ZKMiddleware::call(&era_provider, &call_request) +// // .await +// // .unwrap(); + +// // assert_eq!(value, U256::from(0_u64).into_tokens()); +// // } + +// #[tokio::test] +// async fn test_withdraw_to_same_address() { +// let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; +// let wallet = LocalWallet::from_str(sender_private_key) +// .unwrap() +// .with_chain_id(DEFAULT_ERA_CHAIN_ID); +// let zk_wallet = +// ZKSWallet::new(wallet, None, Some(era_provider()), Some(eth_provider())).unwrap(); + +// // See balances before withdraw +// let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); +// let l2_balance_before = zk_wallet.era_balance().await.unwrap(); -// let contract_l1 = ERC20Token::new(token_l1_address, Arc::new(l1_provider.clone())); +// println!("Balance on L1 before withdrawal: {l1_balance_before}"); +// println!("Balance on L2 before withdrawal: {l2_balance_before}"); -// let balance_erc20_l1_before: U256 = contract_l1 -// .balance_of(zk_wallet.l1_address()) -// .call() +// // Withdraw +// let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); + +// let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); +// let tx_hash = zk_wallet.withdraw(&withdraw_request).await.unwrap(); +// let tx_receipt = zk_wallet +// .get_era_provider() +// .unwrap() +// .wait_for_finalize(tx_hash, None, None) // .await // .unwrap(); +// assert_eq!( +// 1, +// tx_receipt.status.unwrap().as_u64(), +// "Check that transaction in L2 is successful" +// ); + +// println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); + +// let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); +// let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); + +// assert_eq!( +// l2_balance_after_withdraw, +// l2_balance_before +// - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), +// "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" +// ); + +// assert_eq!( +// l1_balance_before, l1_balance_after_withdraw, +// "Check that L1 balance has not changed" +// ); -// let request = DepositRequest::new(amount).token(Some(token_l1_address)); +// let tx_finalize_hash = zk_wallet.finalize_withdraw(tx_hash).await.unwrap(); -// let l1_tx_hash = zk_wallet.deposit(&request).await.unwrap(); -// let l1_receipt = zk_wallet +// let tx_finalize_receipt = zk_wallet // .get_eth_provider() // .unwrap() -// .get_transaction_receipt(l1_tx_hash) +// .get_transaction_receipt(tx_finalize_hash) // .await // .unwrap() // .unwrap(); -// assert_eq!(l1_receipt.status.unwrap(), 1_i32.into()); +// println!( +// "L1 Transaction hash: {:?}", +// tx_finalize_receipt.transaction_hash +// ); -// let balance_erc20_l1_after: U256 = contract_l1 -// .balance_of(zk_wallet.l1_address()) -// .call() -// .await -// .unwrap(); +// assert_eq!( +// 1, +// tx_finalize_receipt.status.unwrap().as_u64(), +// "Check that transaction in L1 is successful" +// ); -// assert_eq!(balance_erc20_l1_after, balance_erc20_l1_before - amount); -// // FIXME check balance on l2. -// } +// // See balances after withdraw +// let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); +// let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); -#[tokio::test] -async fn test_transfer_eip712() { - let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" - .parse() - .unwrap(); - let amount_to_transfer: U256 = 1_i32.into(); - - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(sender_private_key) - .unwrap() - .with_chain_id(DEFAULT_ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let sender_balance_before = era_provider - .get_balance(zk_wallet.l2_address(), None) - .await - .unwrap(); - let receiver_balance_before = era_provider - .get_balance(receiver_address, None) - .await - .unwrap(); - - println!("Sender balance before: {sender_balance_before}"); - println!("Receiver balance before: {receiver_balance_before}"); - - let transfer_request = TransferRequest::new(amount_to_transfer) - .to(receiver_address) - .from(zk_wallet.l2_address()); - let tx_hash = zk_wallet - .transfer_eip712(&transfer_request, None) - .await - .unwrap(); - - let receipt = era_provider - .get_transaction_receipt(tx_hash) - .await - .unwrap() - .unwrap(); - assert_eq!(receipt.from, zk_wallet.l2_address()); - assert_eq!(receipt.to.unwrap(), receiver_address); - - let sender_balance_after = era_provider - .get_balance(zk_wallet.l2_address(), None) - .await - .unwrap(); - let receiver_balance_after = era_provider - .get_balance(receiver_address, None) - .await - .unwrap(); - - println!("Sender balance after: {sender_balance_after}"); - println!("Receiver balance after: {receiver_balance_after}"); - - assert_eq!( - sender_balance_after, - sender_balance_before - - (amount_to_transfer - + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) - ); - assert_eq!( - receiver_balance_after, - receiver_balance_before + amount_to_transfer - ); -} - -#[tokio::test] -async fn test_deploy_contract_with_constructor_arg_uint() { - let deployer_private_key = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(deployer_private_key) - .unwrap() - .with_chain_id(DEFAULT_ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/storage_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = - DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["10".to_owned()]) - .from(zk_wallet.l2_address()); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let deploy_result = era_provider.get_code(contract_address, None).await; - - assert!(deploy_result.is_ok()); -} - -#[tokio::test] -async fn test_deploy_contract_with_constructor_arg_string() { - let deployer_private_key = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; - let era_provider = era_provider(); - let wallet = LocalWallet::from_str(deployer_private_key) - .unwrap() - .with_chain_id(DEFAULT_ERA_CHAIN_ID); - let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - - let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_path.push("src/abi/test_contracts/greeter_combined.json"); - let contract: CompiledContract = - serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - - let deploy_request = - DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["Hey".to_owned()]) - .from(zk_wallet.l2_address()); - let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); - let deploy_result = era_provider.get_code(contract_address, None).await; - - assert!(deploy_result.is_ok()); -} +// println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); +// println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); + +// assert_eq!( +// l2_balance_after_finalize, l2_balance_after_withdraw, +// "Check that L2 balance after finalize has decreased by the used gas" +// ); + +// assert_ne!( +// l1_balance_after_finalize, l1_balance_before, +// "Check that L1 balance after finalize is not the same" +// ); +// assert_eq!( +// l1_balance_after_finalize, +// l1_balance_before +// + (amount_to_withdraw +// - tx_finalize_receipt.effective_gas_price.unwrap() +// * tx_finalize_receipt.gas_used.unwrap()), +// "Check that L1 balance after finalize has increased by the amount" +// ); +// } // #[tokio::test] -// async fn test_deploy_contract_with_import() { -// let deployer_private_key = -// "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; -// let era_provider = era_provider(); -// let wallet = LocalWallet::from_str(deployer_private_key) +// async fn test_withdraw_to_other_address() { +// let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; +// let receiver_private_key = "0xe667e57a9b8aaa6709e51ff7d093f1c5b73b63f9987e4ab4aa9a5c699e024ee8"; +// let l2_wallet = LocalWallet::from_str(sender_private_key) // .unwrap() // .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); -// // Deploy imported contract first. -// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// contract_path.push("src/abi/test_contracts/counter_combined.json"); -// let counter_contract: CompiledContract = -// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); +// let l1_wallet = LocalWallet::from_str(receiver_private_key) +// .unwrap() +// .with_chain_id(utils::ETH_CHAIN_ID); +// let zk_wallet = ZKSWallet::new( +// l2_wallet, +// Some(l1_wallet), +// Some(era_provider()), +// Some(eth_provider()), +// ) +// .unwrap(); -// let deploy_request = -// DeployRequest::with(counter_contract.abi, counter_contract.bin.to_vec(), vec![]) -// .from(zk_wallet.l2_address()); -// let counter_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// let deploy_result = era_provider.get_code(counter_contract_address, None).await; +// // See balances before withdraw +// let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); +// let l2_balance_before = zk_wallet.era_balance().await.unwrap(); -// assert!(deploy_result.is_ok()); +// println!("Balance on L1 before withdrawal: {l1_balance_before}"); +// println!("Balance on L2 before withdrawal: {l2_balance_before}"); -// // Deploy another contract that imports the previous one. -// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// contract_path.push("src/abi/test_contracts/import_combined.json"); +// // Withdraw +// let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); +// let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); +// let tx_receipt = zk_wallet.withdraw(&withdraw_request).await.unwrap(); +// let tx_receipt = zk_wallet +// .get_era_provider() +// .unwrap() +// .wait_for_finalize(tx_receipt, None, None) +// .await +// .unwrap(); +// assert_eq!( +// 1, +// tx_receipt.status.unwrap().as_u64(), +// "Check that transaction in L2 is successful" +// ); -// let import_contract: CompiledContract = -// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); +// println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); -// let deploy_request = DeployRequest::with( -// import_contract.abi, -// import_contract.bin.to_vec(), -// vec![format!("{counter_contract_address:?}")], -// ) -// .from(zk_wallet.l2_address()); -// let import_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// let call_request = CallRequest::new( -// import_contract_address, -// "getCounterValue()(uint256)".to_owned(), +// let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); +// let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); + +// assert_eq!( +// l2_balance_after_withdraw, +// l2_balance_before +// - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), +// "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" +// ); + +// assert_eq!( +// l1_balance_before, l1_balance_after_withdraw, +// "Check that L1 balance has not changed" // ); -// let value = ZKMiddleware::call(&era_provider, &call_request) + +// let tx_finalize_hash = zk_wallet +// .finalize_withdraw(tx_receipt.transaction_hash) // .await // .unwrap(); -// assert_eq!(value, U256::from(0_u64).into_tokens()); -// } +// let tx_finalize_receipt = zk_wallet +// .get_eth_provider() +// .unwrap() +// .get_transaction_receipt(tx_finalize_hash) +// .await +// .unwrap() +// .unwrap(); +// println!( +// "L1 Transaction hash: {:?}", +// tx_finalize_receipt.transaction_hash +// ); -#[tokio::test] -async fn test_withdraw_to_same_address() { - let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let wallet = LocalWallet::from_str(sender_private_key) - .unwrap() - .with_chain_id(DEFAULT_ERA_CHAIN_ID); - let zk_wallet = - ZKSWallet::new(wallet, None, Some(era_provider()), Some(eth_provider())).unwrap(); - - // See balances before withdraw - let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_before = zk_wallet.era_balance().await.unwrap(); - - println!("Balance on L1 before withdrawal: {l1_balance_before}"); - println!("Balance on L2 before withdrawal: {l2_balance_before}"); - - // Withdraw - let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); - - let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); - let tx_hash = zk_wallet.withdraw(&withdraw_request).await.unwrap(); - let tx_receipt = zk_wallet - .get_era_provider() - .unwrap() - .wait_for_finalize(tx_hash, None, None) - .await - .unwrap(); - assert_eq!( - 1, - tx_receipt.status.unwrap().as_u64(), - "Check that transaction in L2 is successful" - ); - - println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); - - let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); - let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); - - assert_eq!( - l2_balance_after_withdraw, - l2_balance_before - - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), - "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" - ); - - assert_eq!( - l1_balance_before, l1_balance_after_withdraw, - "Check that L1 balance has not changed" - ); - - let tx_finalize_hash = zk_wallet.finalize_withdraw(tx_hash).await.unwrap(); - - let tx_finalize_receipt = zk_wallet - .get_eth_provider() - .unwrap() - .get_transaction_receipt(tx_finalize_hash) - .await - .unwrap() - .unwrap(); - println!( - "L1 Transaction hash: {:?}", - tx_finalize_receipt.transaction_hash - ); - - assert_eq!( - 1, - tx_finalize_receipt.status.unwrap().as_u64(), - "Check that transaction in L1 is successful" - ); - - // See balances after withdraw - let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); - - println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); - println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); - - assert_eq!( - l2_balance_after_finalize, l2_balance_after_withdraw, - "Check that L2 balance after finalize has decreased by the used gas" - ); - - assert_ne!( - l1_balance_after_finalize, l1_balance_before, - "Check that L1 balance after finalize is not the same" - ); - assert_eq!( - l1_balance_after_finalize, - l1_balance_before - + (amount_to_withdraw - - tx_finalize_receipt.effective_gas_price.unwrap() - * tx_finalize_receipt.gas_used.unwrap()), - "Check that L1 balance after finalize has increased by the amount" - ); -} - -#[tokio::test] -async fn test_withdraw_to_other_address() { - let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; - let receiver_private_key = "0xe667e57a9b8aaa6709e51ff7d093f1c5b73b63f9987e4ab4aa9a5c699e024ee8"; - let l2_wallet = LocalWallet::from_str(sender_private_key) - .unwrap() - .with_chain_id(DEFAULT_ERA_CHAIN_ID); - - let l1_wallet = LocalWallet::from_str(receiver_private_key) - .unwrap() - .with_chain_id(utils::ETH_CHAIN_ID); - let zk_wallet = ZKSWallet::new( - l2_wallet, - Some(l1_wallet), - Some(era_provider()), - Some(eth_provider()), - ) - .unwrap(); - - // See balances before withdraw - let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_before = zk_wallet.era_balance().await.unwrap(); - - println!("Balance on L1 before withdrawal: {l1_balance_before}"); - println!("Balance on L2 before withdrawal: {l2_balance_before}"); - - // Withdraw - let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); - let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); - let tx_receipt = zk_wallet.withdraw(&withdraw_request).await.unwrap(); - let tx_receipt = zk_wallet - .get_era_provider() - .unwrap() - .wait_for_finalize(tx_receipt, None, None) - .await - .unwrap(); - assert_eq!( - 1, - tx_receipt.status.unwrap().as_u64(), - "Check that transaction in L2 is successful" - ); - - println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); - - let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); - let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); - - assert_eq!( - l2_balance_after_withdraw, - l2_balance_before - - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), - "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" - ); - - assert_eq!( - l1_balance_before, l1_balance_after_withdraw, - "Check that L1 balance has not changed" - ); - - let tx_finalize_hash = zk_wallet - .finalize_withdraw(tx_receipt.transaction_hash) - .await - .unwrap(); - - let tx_finalize_receipt = zk_wallet - .get_eth_provider() - .unwrap() - .get_transaction_receipt(tx_finalize_hash) - .await - .unwrap() - .unwrap(); - println!( - "L1 Transaction hash: {:?}", - tx_finalize_receipt.transaction_hash - ); - - assert_eq!( - 1, - tx_finalize_receipt.status.unwrap().as_u64(), - "Check that transaction in L1 is successful" - ); - - // See balances after withdraw - let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); - let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); - - println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); - println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); - - assert_eq!( - l2_balance_after_finalize, l2_balance_after_withdraw, - "Check that L2 balance after finalize has decreased by the used gas" - ); - - assert_ne!( - l1_balance_after_finalize, l1_balance_before, - "Check that L1 balance after finalize is not the same" - ); - assert_eq!( - l1_balance_after_finalize, - l1_balance_before - + (amount_to_withdraw - - tx_finalize_receipt.effective_gas_price.unwrap() - * tx_finalize_receipt.gas_used.unwrap()), - "Check that L1 balance after finalize has increased by the amount" - ); -} +// assert_eq!( +// 1, +// tx_finalize_receipt.status.unwrap().as_u64(), +// "Check that transaction in L1 is successful" +// ); + +// // See balances after withdraw +// let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); +// let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); + +// println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); +// println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); + +// assert_eq!( +// l2_balance_after_finalize, l2_balance_after_withdraw, +// "Check that L2 balance after finalize has decreased by the used gas" +// ); + +// assert_ne!( +// l1_balance_after_finalize, l1_balance_before, +// "Check that L1 balance after finalize is not the same" +// ); +// assert_eq!( +// l1_balance_after_finalize, +// l1_balance_before +// + (amount_to_withdraw +// - tx_finalize_receipt.effective_gas_price.unwrap() +// * tx_finalize_receipt.gas_used.unwrap()), +// "Check that L1 balance after finalize has increased by the amount" +// ); +// } diff --git a/tests/zk_middleware_tests.rs b/tests/zk_middleware_tests.rs new file mode 100644 index 0000000..d947559 --- /dev/null +++ b/tests/zk_middleware_tests.rs @@ -0,0 +1,883 @@ +// use ethers::{ +// abi::Tokenize, +// types::{Address, Bytes, H256, U256}, +// }; +// use serde::{Deserialize, Serialize}; +// use std::{fs::File, path::PathBuf, str::FromStr}; +// use zksync_ethers_rs::{ +// types::zksync::api::{CallTracerConfig, SupportedTracers, TracerConfig}, +// zk_middleware::ZKMiddleware, +// }; + +// #[tokio::test] +// async fn test_provider_estimate_fee() { +// let provider = era_provider(); +// #[derive(Serialize, Deserialize, Debug)] +// struct TestTransaction { +// from: String, +// to: String, +// data: String, +// } + +// let transaction = TestTransaction { +// from: "0x1111111111111111111111111111111111111111".to_owned(), +// to: "0x2222222222222222222222222222222222222222".to_owned(), +// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), +// }; + +// let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); + +// assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); +// assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); +// assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); +// assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); +// } + +// #[tokio::test] +// async fn test_provider_get_testnet_paymaster() { +// let provider = era_provider(); + +// assert!(provider.get_testnet_paymaster().await.is_ok()); +// } + +// #[tokio::test] +// async fn test_provider_estimate_gas_l1_to_l2() { +// let provider = era_provider(); +// #[derive(Serialize, Deserialize, Debug)] +// struct TestTransaction { +// from: String, +// to: String, +// data: String, +// } + +// let transaction = TestTransaction { +// from: "0x1111111111111111111111111111111111111111".to_owned(), +// to: "0x2222222222222222222222222222222222222222".to_owned(), +// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), +// }; + +// let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); + +// assert_eq!(estimated_fee, U256::from(36_768_868_u64)); +// } + +// #[tokio::test] +// // TODO: This test is flacky. It could fail in the future. +// async fn test_provider_get_all_account_balances() { +// let provider = era_provider(); +// let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" +// .parse() +// .unwrap(); +// let balance = provider.get_balance(address, None).await.unwrap(); + +// let balances = provider.get_all_account_balances(address).await.unwrap(); + +// assert_eq!( +// balances +// .get( +// &"0x0000000000000000000000000000000000000000" +// .parse::
() +// .unwrap() +// ) +// .unwrap() +// .clone(), +// balance +// ); +// } + +// #[tokio::test] +// async fn test_provider_get_block_details() { +// let provider = era_provider(); +// let existing_block = 1_u64; +// let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; + +// let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); +// let non_existing_block_details = provider +// .get_block_details(non_existing_block.as_u32()) +// .await +// .unwrap(); + +// assert!(existing_block_details.is_some()); +// assert!(non_existing_block_details.is_none()) +// } + +// #[tokio::test] +// async fn test_provider_get_bridge_contracts() { +// let provider = era_provider(); + +// assert!(provider.get_bridge_contracts().await.is_ok()); +// } + +// #[tokio::test] +// async fn test_provider_get_bytecode_by_hash() { +// let provider = era_provider(); +// let invalid_hash = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" +// .parse() +// .unwrap(); +// let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); +// let valid_hash = test_block.base.root_hash.unwrap(); + +// assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); +// assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); +// } + +// #[ignore] +// #[tokio::test] +// async fn test_provider_get_confirmed_tokens() { +// let provider = era_provider(); +// let from = 0; +// let limit = 10; + +// assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); +// } + +// // TODO: This test is flacky. It could fail in the future. +// #[tokio::test] +// async fn test_provider_get_l1_batch_block_range() { +// let provider = era_provider(); +// let batch = 1_u64; + +// assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); +// } + +// #[tokio::test] +// async fn test_provider_get_l1_batch_details() { +// let provider = era_provider(); +// let batch = 1_u64; + +// assert!(provider.get_l1_batch_details(batch).await.is_ok()); +// } + +// #[tokio::test] +// async fn test_provider_get_l2_to_l1_log_proof() { +// let provider = era_provider(); +// let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" +// .parse() +// .unwrap(); + +// assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); +// } + +// // #[tokio::test] +// // async fn test_provider_get_l2_to_l1_msg_proof() { +// // let provider = local_provider(); +// // let block = 2; +// // let sender = /* create an address object */; +// // let msg = /* create a hash object */; + +// // assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); +// // } + +// #[tokio::test] +// async fn test_provider_get_main_contract() { +// let provider = era_provider(); + +// assert!(provider.get_main_contract().await.is_ok()); +// } + +// // TODO: This test is flacky. It could fail in the future. We should create a +// // transaction, send it, and the assert that the details match. +// #[tokio::test] +// async fn test_provider_get_raw_block_transactions() { +// let provider = era_provider(); +// let block = 1_u64; + +// assert!(provider.get_raw_block_transactions(block).await.is_ok()); +// } + +// #[tokio::test] +// async fn test_provider_get_token_price() { +// let provider = era_provider(); +// let address: Address = "0x0000000000000000000000000000000000000000" +// .parse() +// .unwrap(); + +// assert!(provider.get_token_price(address).await.is_ok()); +// } + +// // TODO: This test is flacky. It could fail in the future. We should create a +// // transaction, send it, and the assert that the details match. +// #[tokio::test] +// async fn test_provider_get_transaction_details() { +// let provider = era_provider(); +// let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); +// let hash = test_block.base.root_hash.unwrap(); + +// assert!(provider.get_transaction_details(hash).await.is_ok()); +// } + +// #[tokio::test] +// async fn test_provider_get_l1_batch_number() { +// let provider = era_provider(); + +// assert!(provider.get_l1_batch_number().await.is_ok()); +// } + +// #[tokio::test] +// async fn test_provider_get_l1_chain_id() { +// let provider = era_provider(); + +// assert!(provider.get_l1_chain_id().await.is_ok()); +// } + +// #[tokio::test] +// async fn test_provider_debug_trace_block_by_hash() { +// let provider = era_provider(); +// let block_number = provider.get_block_number().await.unwrap() - 1_u64; +// let test_block = provider +// .get_block_details(block_number.as_u32()) +// .await +// .unwrap() +// .unwrap(); +// let hash_block = test_block.base.root_hash.unwrap(); + +// let options = Some(TracerConfig { +// tracer: SupportedTracers::CallTracer, +// tracer_config: CallTracerConfig { +// only_top_call: true, +// }, +// }); + +// assert!( +// ZKMiddleware::debug_trace_block_by_hash(&provider, hash_block, None) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_block_by_hash(&provider, hash_block, options) +// .await +// .is_ok() +// ); +// } + +// #[tokio::test] +// async fn test_provider_debug_trace_block_by_number() { +// let provider = era_provider(); +// let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; +// let non_existing_block_number = existing_block_number + 100_u64; +// let options = Some(TracerConfig { +// tracer: SupportedTracers::CallTracer, +// tracer_config: CallTracerConfig { +// only_top_call: true, +// }, +// }); + +// assert!( +// ZKMiddleware::debug_trace_block_by_number(&provider, existing_block_number, None) +// .await +// .is_ok() +// ); +// assert!(ZKMiddleware::debug_trace_block_by_number( +// &provider, +// existing_block_number, +// options.clone() +// ) +// .await +// .is_ok()); +// assert!( +// ZKMiddleware::debug_trace_block_by_number(&provider, non_existing_block_number, None) +// .await +// .is_err() +// ); +// assert!(ZKMiddleware::debug_trace_block_by_number( +// &provider, +// non_existing_block_number, +// options +// ) +// .await +// .is_err()); +// } + +// #[tokio::test] +// async fn test_provider_debug_trace_call() { +// let provider = era_provider(); +// #[derive(Serialize, Deserialize, Debug)] +// struct TestTransaction { +// from: String, +// to: String, +// data: String, +// } + +// let request = TestTransaction { +// from: "0x1111111111111111111111111111111111111111".to_owned(), +// to: "0x2222222222222222222222222222222222222222".to_owned(), +// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), +// }; + +// let block = provider.get_block_number().await.ok(); +// let options = Some(TracerConfig { +// tracer: SupportedTracers::CallTracer, +// tracer_config: CallTracerConfig { +// only_top_call: true, +// }, +// }); + +// println!( +// "{:?}", +// ZKMiddleware::debug_trace_call::<&TestTransaction, u64>(&provider, &request, None, None) +// .await +// ); + +// assert!(ZKMiddleware::debug_trace_call::<&TestTransaction, u64>( +// &provider, &request, None, None +// ) +// .await +// .is_ok()); +// assert!( +// ZKMiddleware::debug_trace_call(&provider, &request, block, None) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_call(&provider, &request, block, options.clone()) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_call::<_, u64>(&provider, request, None, options) +// .await +// .is_ok() +// ); +// } + +// // TODO: This test is flacky. It could fail in the future. +// #[tokio::test] +// async fn test_provider_debug_trace_transaction() { +// let era_provider = era_provider(); +// let zk_wallet = ZKSWallet::new(local_wallet(), None, Some(era_provider.clone()), None).unwrap(); + +// let transfer_request = TransferRequest::new(1_u64.into()) +// .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) +// .from(zk_wallet.l2_address()); +// let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); +// let invalid_transaction_hash: H256 = +// "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" +// .parse() +// .unwrap(); + +// let options = Some(TracerConfig { +// tracer: SupportedTracers::CallTracer, +// tracer_config: CallTracerConfig { +// only_top_call: true, +// }, +// }); + +// assert!( +// ZKMiddleware::debug_trace_transaction(&era_provider, transaction_hash, None) +// .await +// .is_ok() +// ); +// assert!(ZKMiddleware::debug_trace_transaction( +// &era_provider, +// transaction_hash, +// options.clone() +// ) +// .await +// .is_ok()); +// assert!( +// ZKMiddleware::debug_trace_transaction(&era_provider, invalid_transaction_hash, None) +// .await +// .is_err() +// ); +// assert!(ZKMiddleware::debug_trace_transaction( +// &era_provider, +// invalid_transaction_hash, +// options +// ) +// .await +// .is_err()); +// } + +// #[tokio::test] +// async fn test_signer_estimate_fee() { +// let provider = era_signer(); +// #[derive(Serialize, Deserialize, Debug)] +// struct TestTransaction { +// from: String, +// to: String, +// data: String, +// } + +// let transaction = TestTransaction { +// from: "0x1111111111111111111111111111111111111111".to_owned(), +// to: "0x2222222222222222222222222222222222222222".to_owned(), +// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), +// }; + +// let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); + +// assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); +// assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); +// assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); +// assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); +// } + +// #[tokio::test] +// async fn test_signer_get_testnet_paymaster() { +// let provider = era_signer(); + +// assert!(provider.get_testnet_paymaster().await.is_ok()); +// } + +// #[tokio::test] +// async fn test_signer_estimate_gas_l1_to_l2() { +// let provider = era_signer(); +// #[derive(Serialize, Deserialize, Debug)] +// struct TestTransaction { +// from: String, +// to: String, +// data: String, +// } + +// let transaction = TestTransaction { +// from: "0x1111111111111111111111111111111111111111".to_owned(), +// to: "0x2222222222222222222222222222222222222222".to_owned(), +// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), +// }; + +// let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); + +// assert_eq!(estimated_fee, U256::from(36_768_868_u32)); +// } + +// #[tokio::test] +// // TODO: This test is flacky. It could fail in the future. +// async fn test_signer_get_all_account_balances() { +// let provider = era_signer(); +// let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" +// .parse() +// .unwrap(); +// let balance = provider.get_balance(address, None).await.unwrap(); + +// let balances = provider.get_all_account_balances(address).await.unwrap(); + +// assert_eq!( +// balances +// .get( +// &"0x0000000000000000000000000000000000000000" +// .parse::
() +// .unwrap() +// ) +// .unwrap() +// .clone(), +// balance +// ); +// } + +// #[tokio::test] +// async fn test_signer_get_block_details() { +// let provider = era_signer(); +// let existing_block = 1_u64; +// let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; + +// let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); +// let non_existing_block_details = provider +// .get_block_details(non_existing_block.as_u32()) +// .await +// .unwrap(); + +// assert!(existing_block_details.is_some()); +// assert!(non_existing_block_details.is_none()) +// } + +// #[tokio::test] +// async fn test_signer_get_bridge_contracts() { +// let provider = era_signer(); + +// assert!(provider.get_bridge_contracts().await.is_ok()); +// } + +// #[tokio::test] +// async fn test_signer_get_bytecode_by_hash() { +// let provider = era_signer(); +// let invalid_hash = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" +// .parse() +// .unwrap(); +// let valid_hash: H256 = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" +// .parse() +// .unwrap(); + +// assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); +// assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); +// } + +// #[ignore] +// #[tokio::test] +// async fn test_signer_get_confirmed_tokens() { +// let provider = era_signer(); +// let from = 0; +// let limit = 10; + +// assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); +// } + +// // TODO: This test is flacky. It could fail in the future. +// #[tokio::test] +// async fn test_signer_get_l1_batch_block_range() { +// let provider = era_signer(); +// let batch = 1_u64; + +// assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); +// } + +// #[tokio::test] +// async fn test_signer_get_l1_batch_details() { +// let provider = era_signer(); +// let batch = 1_u64; + +// assert!(provider.get_l1_batch_details(batch).await.is_ok()); +// } + +// #[tokio::test] +// async fn test_signer_get_l2_to_l1_log_proof() { +// let provider = era_signer(); +// let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" +// .parse() +// .unwrap(); + +// assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); +// } + +// // #[tokio::test] +// // async fn test_signer_get_l2_to_l1_msg_proof() { +// // let provider = local_signer(); +// // let block = 2; +// // let sender = /* create an address object */; +// // let msg = /* create a hash object */; + +// // assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); +// // } + +// #[tokio::test] +// async fn test_signer_get_main_contract() { +// let provider = era_signer(); + +// assert!(provider.get_main_contract().await.is_ok()); +// } + +// // TODO: This test is flacky. It could fail in the future. We should create a +// // transaction, send it, and the assert that the details match. +// #[tokio::test] +// async fn test_signer_get_raw_block_transactions() { +// let provider = era_signer(); +// let block = 1_u64; + +// assert!(provider.get_raw_block_transactions(block).await.is_ok()); +// } + +// #[tokio::test] +// async fn test_signer_get_token_price() { +// let provider = era_signer(); +// let address: Address = "0x0000000000000000000000000000000000000000" +// .parse() +// .unwrap(); + +// assert!(provider.get_token_price(address).await.is_ok()); +// } + +// // TODO: This test is flacky. It could fail in the future. We should create a +// // transaction, send it, and the assert that the details match. +// #[tokio::test] +// async fn test_signer_get_transaction_details() { +// let provider = era_signer(); +// let hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" +// .parse() +// .unwrap(); + +// assert!(provider.get_transaction_details(hash).await.is_ok()); +// } + +// #[tokio::test] +// async fn test_signer_get_l1_batch_number() { +// let provider = era_signer(); + +// assert!(provider.get_l1_batch_number().await.is_ok()); +// } + +// #[tokio::test] +// async fn test_signer_get_l1_chain_id() { +// let provider = era_signer(); + +// assert!(provider.get_l1_chain_id().await.is_ok()); +// } + +// #[tokio::test] +// async fn test_signer_debug_trace_block_by_hash() { +// let provider = era_signer(); +// let block_number = provider.get_block_number().await.unwrap() - 1_u64; +// let test_block = provider +// .get_block_details(block_number.as_u32()) +// .await +// .unwrap() +// .unwrap(); +// let hash = test_block.base.root_hash.unwrap(); + +// let options = Some(TracerConfig { +// tracer: SupportedTracers::CallTracer, +// tracer_config: CallTracerConfig { +// only_top_call: true, +// }, +// }); + +// assert!( +// ZKMiddleware::debug_trace_block_by_hash(&provider, hash, None) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_block_by_hash(&provider, hash, options) +// .await +// .is_ok() +// ); +// } + +// #[tokio::test] +// async fn test_signer_debug_trace_block_by_number() { +// let provider = era_signer(); +// let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; +// let non_existing_block_number = existing_block_number + 100_u64; +// let options = Some(TracerConfig { +// tracer: SupportedTracers::CallTracer, +// tracer_config: CallTracerConfig { +// only_top_call: true, +// }, +// }); + +// assert!( +// ZKMiddleware::debug_trace_block_by_number(&provider, existing_block_number, None) +// .await +// .is_ok() +// ); +// assert!(ZKMiddleware::debug_trace_block_by_number( +// &provider, +// existing_block_number, +// options.clone() +// ) +// .await +// .is_ok()); +// assert!( +// ZKMiddleware::debug_trace_block_by_number(&provider, non_existing_block_number, None) +// .await +// .is_err() +// ); +// assert!(ZKMiddleware::debug_trace_block_by_number( +// &provider, +// non_existing_block_number, +// options +// ) +// .await +// .is_err()); +// } + +// #[tokio::test] +// async fn test_signer_debug_trace_call() { +// let provider = era_signer(); +// #[derive(Serialize, Deserialize, Debug)] +// struct TestTransaction { +// from: String, +// to: String, +// data: String, +// } + +// let request = TestTransaction { +// from: "0x1111111111111111111111111111111111111111".to_owned(), +// to: "0x2222222222222222222222222222222222222222".to_owned(), +// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), +// }; + +// let block = provider.get_block_number().await.ok(); +// let options = Some(TracerConfig { +// tracer: SupportedTracers::CallTracer, +// tracer_config: CallTracerConfig { +// only_top_call: true, +// }, +// }); + +// assert!( +// ZKMiddleware::debug_trace_call::<_, u64>(&provider, &request, None, None) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_call(&provider, &request, block, None) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_call(&provider, &request, block, options.clone()) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_call::<_, u64>(&provider, request, None, options) +// .await +// .is_ok() +// ); +// } + +// #[tokio::test] +// async fn test_signer_debug_trace_transaction() { +// let era_signer = era_signer(); +// let zk_wallet = ZKSWallet::new(local_wallet(), None, Some(era_signer.clone()), None).unwrap(); + +// let transfer_request = TransferRequest::new(1_u64.into()) +// .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) +// .from(zk_wallet.l2_address()); +// let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); +// let invalid_transaction_hash: H256 = +// "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" +// .parse() +// .unwrap(); + +// let options = Some(TracerConfig { +// tracer: SupportedTracers::CallTracer, +// tracer_config: CallTracerConfig { +// only_top_call: true, +// }, +// }); + +// assert!( +// ZKMiddleware::debug_trace_transaction(&era_signer, transaction_hash, None) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_transaction(&era_signer, transaction_hash, options) +// .await +// .is_ok() +// ); +// assert!( +// ZKMiddleware::debug_trace_transaction(&era_signer, invalid_transaction_hash, None) +// .await +// .is_err() +// ); +// } + +// #[ignore = "Deprecated"] +// #[tokio::test] +// async fn test_send_function_with_arguments() { +// // Deploying a test contract +// let era_provider = era_provider(); +// let wallet = local_wallet(); +// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); +// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// contract_path.push("src/abi/test_contracts/storage_combined.json"); +// let contract: CompiledContract = +// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// let deploy_request = +// DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["0".to_owned()]) +// .from(zk_wallet.l2_address()); +// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// let call_request = CallRequest::new(contract_address, "getValue()(uint256)".to_owned()); +// let initial_value = ZKMiddleware::call(&era_provider, &call_request) +// .await +// .unwrap(); + +// assert_eq!(initial_value, U256::from(0_i32).into_tokens()); + +// let value_to_set = String::from("10"); +// era_provider +// .send_eip712( +// &zk_wallet.l2_wallet, +// contract_address, +// "setValue(uint256)", +// Some([value_to_set.clone()].into()), +// None, +// ) +// .await +// .unwrap() +// .await +// .unwrap() +// .unwrap(); +// let set_value = ZKMiddleware::call(&era_provider, &call_request) +// .await +// .unwrap(); + +// assert_eq!( +// set_value, +// U256::from(value_to_set.parse::().unwrap()).into_tokens() +// ); + +// era_provider +// .send_eip712( +// &zk_wallet.l2_wallet, +// contract_address, +// "incrementValue()", +// None, +// None, +// ) +// .await +// .unwrap() +// .await +// .unwrap() +// .unwrap(); +// let incremented_value = ZKMiddleware::call(&era_provider, &call_request) +// .await +// .unwrap(); + +// assert_eq!( +// incremented_value, +// (value_to_set.parse::().unwrap() + 1_u64).into_tokens() +// ); +// } + +// #[ignore = "Deprecated"] +// #[tokio::test] +// async fn test_call_view_function_with_no_parameters() { +// // Deploying a test contract +// let era_provider = era_provider(); +// let wallet = local_wallet(); +// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); +// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// contract_path.push("src/abi/test_contracts/basic_combined.json"); +// let contract: CompiledContract = +// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]); +// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// let call_request = CallRequest::new(contract_address, "str_out()(string)".to_owned()); +// let output = ZKMiddleware::call(&era_provider, &call_request) +// .await +// .unwrap(); + +// assert_eq!(output, String::from("Hello World!").into_tokens()); +// } + +// #[ignore = "Deprecated"] +// #[tokio::test] +// async fn test_call_view_function_with_arguments() { +// // Deploying a test contract +// let era_provider = era_provider(); +// let wallet = local_wallet(); +// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); + +// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// contract_path.push("src/abi/test_contracts/basic_combined.json"); +// let contract: CompiledContract = +// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + +// let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]) +// .from(zk_wallet.l2_address()); +// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); +// let call_request = CallRequest::new(contract_address, "plus_one(uint256)".to_owned()) +// .function_parameters(vec!["1".to_owned()]); +// let no_return_type_output = ZKMiddleware::call(&era_provider, &call_request) +// .await +// .unwrap(); + +// let call_request = call_request.function_signature("plus_one(uint256)(uint256)".to_owned()); +// let known_return_type_output = ZKMiddleware::call(&era_provider, &call_request) +// .await +// .unwrap(); + +// assert_eq!( +// no_return_type_output, +// Bytes::from([ +// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// 0, 0, 2 +// ]) +// .into_tokens() +// ); +// assert_eq!(known_return_type_output, U256::from(2_u64).into_tokens()); +// } From 8cb286ab5869f209926ec8beb6694d67c9b7270b Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:16:12 +0200 Subject: [PATCH 21/75] Update imports --- src/eip712/transaction.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/eip712/transaction.rs b/src/eip712/transaction.rs index a6427fb..1e177c3 100644 --- a/src/eip712/transaction.rs +++ b/src/eip712/transaction.rs @@ -1,5 +1,5 @@ use super::{hash_bytecode, Eip712TransactionRequest}; -use crate::zks_utils::{DEFAULT_GAS_PER_PUBDATA_LIMIT, EIP712_TX_TYPE}; +use crate::utils::DEFAULT_GAS_PER_PUBDATA_LIMIT; use ethers::{ abi::encode, types::{ @@ -12,6 +12,7 @@ use ethers::{ }; use serde::{Deserialize, Serialize}; use serde_json::json; +use zksync_types::EIP_712_TX_TYPE; #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all(serialize = "camelCase", deserialize = "camelCase"))] @@ -154,7 +155,7 @@ impl Eip712Transaction { impl Default for Eip712Transaction { fn default() -> Self { Self { - tx_type: EIP712_TX_TYPE.into(), + tx_type: EIP_712_TX_TYPE.into(), from: Default::default(), to: Default::default(), gas_limit: Default::default(), From a0adea832e26f099622d514cee4a810f07f89dfa Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 10 Jul 2024 13:16:17 +0200 Subject: [PATCH 22/75] Comment old impl --- src/eip712/transaction_request.rs | 200 ++++++++++++++---------------- 1 file changed, 92 insertions(+), 108 deletions(-) diff --git a/src/eip712/transaction_request.rs b/src/eip712/transaction_request.rs index ddefc2e..e1b6d85 100644 --- a/src/eip712/transaction_request.rs +++ b/src/eip712/transaction_request.rs @@ -1,22 +1,14 @@ -use std::{fs::File, io::BufReader, path::PathBuf, str::FromStr}; - -use super::{hash_bytecode, rlp_append_option, Eip712Meta}; -use crate::{ - zks_utils::{ - self, CONTRACT_DEPLOYER_ADDR, EIP712_TX_TYPE, ERA_CHAIN_ID, MAX_PRIORITY_FEE_PER_GAS, - }, - zks_wallet::{DeployRequest, Overrides, TransferRequest, WithdrawRequest, ZKRequestError}, -}; +use super::{rlp_append_option, Eip712Meta}; +use crate::{types::L1TxOverrides, utils::MAX_PRIORITY_FEE_PER_GAS}; use ethers::{ - abi::{Abi, HumanReadableParser, ParseError}, types::{ transaction::{eip2930::AccessList, eip712::Eip712Error}, Address, Bytes, Signature, U256, }, utils::rlp::{Encodable, RlpStream}, }; -use ethers_contract::encode_function_data; use serde::{Deserialize, Serialize}; +use zksync_types::{DEFAULT_ERA_CHAIN_ID, EIP_712_TX_TYPE}; // TODO: Not all the fields are optional. This was copied from the JS implementation. #[derive(Serialize, Deserialize, Clone, Debug)] @@ -53,7 +45,7 @@ impl Eip712TransactionRequest { Self::default() } - pub fn from_overrides(overrides: Overrides) -> Self { + pub fn from_overrides(overrides: L1TxOverrides) -> Self { let mut tx = Self::default(); if let Some(value) = overrides.value { tx.value = value; @@ -229,8 +221,8 @@ impl Default for Eip712TransactionRequest { gas_price: Default::default(), data: Default::default(), value: Default::default(), - chain_id: ERA_CHAIN_ID.into(), - r#type: EIP712_TX_TYPE.into(), + chain_id: DEFAULT_ERA_CHAIN_ID.into(), + r#type: EIP_712_TX_TYPE.into(), access_list: Default::default(), max_priority_fee_per_gas: MAX_PRIORITY_FEE_PER_GAS.into(), max_fee_per_gas: Default::default(), @@ -240,97 +232,89 @@ impl Default for Eip712TransactionRequest { } } -impl TryFrom for Eip712TransactionRequest { - type Error = ZKRequestError; - - fn try_from(request: WithdrawRequest) -> Result { - let contract_address = - Address::from_str(zks_utils::CONTRACTS_L2_ETH_TOKEN_ADDR).map_err(|e| { - ZKRequestError::CustomError(format!("Error getting L2 ETH token address {e:?}")) - })?; - let function_signature = "function withdraw(address _l1Receiver) external payable override"; - let function = HumanReadableParser::parse_function(function_signature) - .map_err(ParseError::LexerError)?; - let function_args = function.decode_input(&zks_utils::encode_args( - &function, - &[format!("{:?}", request.to)], - )?)?; - let data: Bytes = function.encode_input(&function_args)?.into(); - - Ok(Eip712TransactionRequest::new() - .r#type(EIP712_TX_TYPE) - .to(contract_address) - .value(request.amount) - .from(request.from) - .data(data)) - } -} - -impl From for Eip712TransactionRequest { - fn from(request: TransferRequest) -> Self { - Eip712TransactionRequest::new() - .r#type(EIP712_TX_TYPE) - .to(request.to) - .value(request.amount) - .from(request.from) - } -} - -impl TryFrom for Eip712TransactionRequest { - type Error = ZKRequestError; - - fn try_from(request: DeployRequest) -> Result { - let mut contract_deployer_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - contract_deployer_path.push("src/abi/ContractDeployer.json"); - - let custom_data = Eip712Meta::new().factory_deps({ - let mut factory_deps = Vec::new(); - if let Some(factory_dependencies) = request.factory_deps { - factory_deps.extend(factory_dependencies); - } - factory_deps.push(request.contract_bytecode.clone()); - factory_deps - }); - - let contract_deployer = Abi::load(BufReader::new( - File::open(contract_deployer_path).map_err(|e| { - ZKRequestError::CustomError(format!( - "Error opening contract deployer abi file {e:?}" - )) - })?, - ))?; - let create = contract_deployer.function("create")?; - - // TODO: User could provide this instead of defaulting. - let salt = [0_u8; 32]; - let bytecode_hash = hash_bytecode(&request.contract_bytecode).map_err(|e| { - ZKRequestError::CustomError(format!("Error hashing contract bytecode {e:?}")) - })?; - let call_data: Bytes = match ( - request.contract_abi.constructor(), - request.constructor_parameters.is_empty(), - ) { - (None, false) => { - return Err(ZKRequestError::CustomError( - "Constructor not present".to_owned(), - )) - } - (None, true) | (Some(_), true) => Bytes::default(), - (Some(constructor), false) => { - zks_utils::encode_constructor_args(constructor, &request.constructor_parameters)? - .into() - } - }; - - let data = encode_function_data(create, (salt, bytecode_hash, call_data))?; - - let contract_deployer_address = Address::from_str(CONTRACT_DEPLOYER_ADDR).map_err(|e| { - ZKRequestError::CustomError(format!("Error getting contract deployer address {e:?}")) - })?; - Ok(Eip712TransactionRequest::new() - .r#type(EIP712_TX_TYPE) - .to(contract_deployer_address) - .custom_data(custom_data) - .data(data)) - } -} +// impl TryFrom for Eip712TransactionRequest { +// type Error = ZKRequestError; + +// fn try_from(request: WithdrawRequest) -> Result { +// let function_signature = "function withdraw(address _l1Receiver) external payable override"; +// let function = HumanReadableParser::parse_function(function_signature) +// .map_err(ParseError::LexerError)?; +// let function_args = function.decode_input(&zks_utils::encode_args( +// &function, +// &[format!("{:?}", request.to)], +// )?)?; +// let data: Bytes = function.encode_input(&function_args)?.into(); + +// Ok(Eip712TransactionRequest::new() +// .r#type(EIP_712_TX_TYPE) +// .to(utils::L2_ETH_TOKEN_ADDRESS) +// .value(request.amount) +// .from(request.from) +// .data(data)) +// } +// } + +// impl From for Eip712TransactionRequest { +// fn from(request: TransferRequest) -> Self { +// Eip712TransactionRequest::new() +// .r#type(EIP712_TX_TYPE) +// .to(request.to) +// .value(request.amount) +// .from(request.from) +// } +// } + +// impl TryFrom for Eip712TransactionRequest { +// type Error = ZKRequestError; + +// fn try_from(request: DeployRequest) -> Result { +// let mut contract_deployer_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); +// contract_deployer_path.push("src/abi/ContractDeployer.json"); + +// let custom_data = Eip712Meta::new().factory_deps({ +// let mut factory_deps = Vec::new(); +// if let Some(factory_dependencies) = request.factory_deps { +// factory_deps.extend(factory_dependencies); +// } +// factory_deps.push(request.contract_bytecode.clone()); +// factory_deps +// }); + +// let contract_deployer = Abi::load(BufReader::new( +// File::open(contract_deployer_path).map_err(|e| { +// ZKRequestError::CustomError(format!( +// "Error opening contract deployer abi file {e:?}" +// )) +// })?, +// ))?; +// let create = contract_deployer.function("create")?; + +// // TODO: User could provide this instead of defaulting. +// let salt = [0_u8; 32]; +// let bytecode_hash = hash_bytecode(&request.contract_bytecode).map_err(|e| { +// ZKRequestError::CustomError(format!("Error hashing contract bytecode {e:?}")) +// })?; +// let call_data: Bytes = match ( +// request.contract_abi.constructor(), +// request.constructor_parameters.is_empty(), +// ) { +// (None, false) => { +// return Err(ZKRequestError::CustomError( +// "Constructor not present".to_owned(), +// )) +// } +// (None, true) | (Some(_), true) => Bytes::default(), +// (Some(constructor), false) => { +// utils::encode_constructor_args(constructor, &request.constructor_parameters)?.into() +// } +// }; + +// let data = encode_function_data(create, (salt, bytecode_hash, call_data))?; + +// Ok(Eip712TransactionRequest::new() +// .r#type(EIP_712_TX_TYPE) +// .to(CONTRACT_DEPLOYER_ADDRESS) +// .custom_data(custom_data) +// .data(data)) +// } +// } From 42c4cdb7ef3e33d0ffbb75e8809d1b138bafcc94 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Thu, 11 Jul 2024 19:49:25 +0200 Subject: [PATCH 23/75] Add base token implementation --- src/contracts/l2_eth.rs | 3 +++ src/contracts/mod.rs | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 src/contracts/l2_eth.rs diff --git a/src/contracts/l2_eth.rs b/src/contracts/l2_eth.rs new file mode 100644 index 0000000..51bb489 --- /dev/null +++ b/src/contracts/l2_eth.rs @@ -0,0 +1,3 @@ +use ethers_contract::abigen; + +abigen!(BaseToken, "abi/IEthToken.json"); diff --git a/src/contracts/mod.rs b/src/contracts/mod.rs index d67abc5..b29e3ac 100644 --- a/src/contracts/mod.rs +++ b/src/contracts/mod.rs @@ -2,3 +2,5 @@ pub mod bridgehub; pub mod erc20; pub mod l1_shared_bridge; pub mod main_contract; + +pub mod l2_eth; From 6845eef7f4b2c8bdc2fe3f2c7ac0624dafeec83b Mon Sep 17 00:00:00 2001 From: ilitteri Date: Thu, 11 Jul 2024 19:50:07 +0200 Subject: [PATCH 24/75] First withdraw impl --- src/withdraw.rs | 202 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 src/withdraw.rs diff --git a/src/withdraw.rs b/src/withdraw.rs new file mode 100644 index 0000000..8e7772f --- /dev/null +++ b/src/withdraw.rs @@ -0,0 +1,202 @@ +// FIXME: Remove this after finishing the implementation. +#![allow(clippy::unwrap_used)] + +use ethers::{ + abi::{Hash, ParamType, Token}, + middleware::SignerMiddleware, + providers::{Http, Middleware, Provider, ProviderExt}, + signers::{LocalWallet, Signer}, + types::{Bytes, U256}, +}; +use std::{str::FromStr, sync::Arc}; +use zksync_types::{api::L2ToL1Log, L1_MESSENGER_ADDRESS}; + +use crate::{ + contracts::{bridgehub::Bridgehub, l1_shared_bridge::L1SharedBridge}, + ZKMiddleware, +}; + +pub async fn wait_for_finalize_withdrawal( + l2_withdrawal_tx_hash: Hash, + l2_provider: &L2Provider, +) where + L2Provider: ZKMiddleware + Middleware, +{ + loop { + if l2_provider + .get_transaction_details(l2_withdrawal_tx_hash) + .await + .unwrap() + .unwrap() + .eth_execute_tx_hash + .is_some() + { + break; + } + println!("Withdraw request not executed on L1 yet. Retrying in 5 seconds..."); + tokio::time::sleep(std::time::Duration::from_secs(5)).await; + } +} + +pub async fn finalize_withdrawal(l2_withdrawal_tx_hash: Hash) -> Hash { + let l1_provider = Provider::::connect("http://eth-sepolia").await; + let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); + let to = Arc::new(SignerMiddleware::, LocalWallet>::new( + l1_provider, + LocalWallet::from_str("0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924") + .unwrap() + .with_chain_id(l1_chain_id), + )); + + let l2_provider = + Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; + + let bridgehub_address = l2_provider.get_bridgehub_contract().await.unwrap(); + let bridgehub = Bridgehub::new(bridgehub_address, Arc::clone(&to)); + let l1_shared_bridge_address = bridgehub.shared_bridge().call().await.unwrap(); + let l1_shared_bridge = L1SharedBridge::new(l1_shared_bridge_address, Arc::clone(&to)); + + // This is an L2 transaction hash. + let withdrawal_tx_receipt = l2_provider + .get_transaction_receipt(l2_withdrawal_tx_hash) + .await + .unwrap() + .unwrap(); + let zk_chain_id = l2_provider.get_chainid().await.unwrap().as_u64(); + let withdrawal_log = withdrawal_tx_receipt + .logs + .iter() + .filter(|log| { + log.address == L1_MESSENGER_ADDRESS + && log.topics[0] + == ethers::utils::keccak256("L1MessageSent(address,bytes32,bytes)").into() + }) + .collect::>()[0]; + let l2_tx_number_in_batch: u16 = U256::from_str( + &serde_json::from_value::( + withdrawal_tx_receipt + .other + .get("l1BatchTxIndex") + .unwrap() + .clone(), + ) + .unwrap(), + ) + .unwrap() + .as_u64() + .try_into() + .unwrap(); + let l2_to_l1_logs = withdrawal_tx_receipt + .other + .get_deserialized::>("l2ToL1Logs") + .unwrap() + .unwrap(); + let withdraw_l2_to_l1_logs = l2_to_l1_logs + .into_iter() + .filter(|log| log.sender == L1_MESSENGER_ADDRESS) + .collect::>(); + let l1_messenger_l2_to_l1_log_index = withdraw_l2_to_l1_logs + .first() + .map(|log| &log.log_index) + .map(U256::as_u64); + + let message = Bytes::from( + ethers::abi::decode(&[ParamType::Bytes], &withdrawal_log.data) + .unwrap() + .first() + .cloned() + .map(Token::into_bytes) + .unwrap() + .unwrap(), + ); + let proof = l2_provider + .get_l2_to_l1_log_proof(l2_withdrawal_tx_hash, l1_messenger_l2_to_l1_log_index) + .await + .unwrap() + .unwrap() + .proof + .into_iter() + .map(Into::into) + .collect::>(); + let l2_batch_number = withdraw_l2_to_l1_logs + .first() + .map(|log| log.l1_batch_number) + .unwrap() + .unwrap(); + + let finalize_withdrawal_tx_receipt = l1_shared_bridge + .finalize_withdrawal( + zk_chain_id.into(), + l2_batch_number.as_u64().into(), + U256::zero(), + l2_tx_number_in_batch, + message, + proof, + ) + .send() + .await + .inspect_err(|err| { + if let Some(revert) = err.as_revert() { + println!("{:?}", ethers::abi::decode(&[ParamType::String], revert)) + } + }) + .unwrap() + .await + .unwrap() + .unwrap(); + + finalize_withdrawal_tx_receipt.transaction_hash +} + +#[cfg(test)] +mod withdraw_tests { + use crate::{ + contracts::l2_eth::BaseToken, + withdraw::{finalize_withdrawal, wait_for_finalize_withdrawal}, + }; + use ethers::{ + abi::Hash, + middleware::SignerMiddleware, + providers::{Http, Middleware, Provider, ProviderExt}, + signers::{LocalWallet, Signer}, + types::U256, + }; + use std::{str::FromStr, sync::Arc}; + use zksync_types::L2_BASE_TOKEN_ADDRESS; + + #[tokio::test] + async fn can_withdraw_eth_from_eth_based_chain() { + let l2_provider = + Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; + let zk_chain_id = l2_provider.get_chainid().await.unwrap().as_u64(); + let from = Arc::new(SignerMiddleware::, LocalWallet>::new( + l2_provider, + LocalWallet::from_str( + "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", + ) + .unwrap() + .with_chain_id(zk_chain_id), + )); + let amount: U256 = ethers::utils::parse_units("0.01", "ether").unwrap().into(); + + let withdrawal_tx_receipt = BaseToken::new(L2_BASE_TOKEN_ADDRESS, Arc::clone(&from)) + .withdraw(from.address()) + .value(amount) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap(); + + let withdrawal_tx_hash = withdrawal_tx_receipt.transaction_hash; + + println!("https://dev.explorer.sepolia.shyft.lambdaclass.com/tx/{withdrawal_tx_hash:?}"); + + wait_for_finalize_withdrawal(withdrawal_tx_hash, from.provider()).await; + + let finalize_withdrawal_l1_tx_hash = finalize_withdrawal(withdrawal_tx_hash).await; + + println!("https://sepolia.etherscan.io/tx/{finalize_withdrawal_l1_tx_hash:?}",); + } +} From 6eed031a85f1a41c407a86175bf33153288b847c Mon Sep 17 00:00:00 2001 From: ilitteri Date: Thu, 11 Jul 2024 19:50:13 +0200 Subject: [PATCH 25/75] Refactors --- src/deposit.rs | 11 +++-------- src/lib.rs | 1 + src/types.rs | 4 ++++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/deposit.rs b/src/deposit.rs index 0b57624..87907da 100644 --- a/src/deposit.rs +++ b/src/deposit.rs @@ -230,12 +230,7 @@ where .await; let l2_costs = base_cost + operator_tip; - let l1_shared_bridge_address = l2_provider - .get_bridge_contracts() - .await - .unwrap() - .l1_shared_default_bridge - .unwrap(); + let l1_shared_bridge_address: Address = bridgehub.shared_bridge().call().await.unwrap(); let calldata = ethers::abi::encode(&[token.into_token(), amount.into_token(), to.into_token()]); @@ -354,7 +349,7 @@ mod deposit_tests { use std::{str::FromStr, sync::Arc}; #[tokio::test] - async fn deposit_eth_to_eth_based_zk_chain() { + async fn can_deposit_eth_to_eth_based_zk_chain() { let l1_provider = Provider::::connect("http://eth-sepolia").await; let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); let from = Arc::new(SignerMiddleware::, LocalWallet>::new( @@ -369,7 +364,7 @@ mod deposit_tests { let refund_recipient = from.address(); let l2_provider = Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; - let amount: U256 = ethers::utils::parse_units("0.01", "ether").unwrap().into(); + let amount: U256 = ethers::utils::parse_units("0.1", "ether").unwrap().into(); let receipt = deposit( amount, diff --git a/src/lib.rs b/src/lib.rs index 311ec0e..5f3f042 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,6 +50,7 @@ pub mod contracts; pub mod eip712; pub mod deposit; +pub mod withdraw; pub mod zk_middleware; pub mod zk_wallet; diff --git a/src/types.rs b/src/types.rs index ad0a8f3..1b77548 100644 --- a/src/types.rs +++ b/src/types.rs @@ -20,6 +20,10 @@ pub struct L1TxOverrides { } impl L1TxOverrides { + pub fn new() -> Self { + Self::default() + } + pub fn from(mut self, from: Address) -> Self { self.from = Some(from); self From 11723476a17d536b837091154f8c4463e2f71a62 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Fri, 12 Jul 2024 02:01:31 +0200 Subject: [PATCH 26/75] First withdraw refactor --- src/lib.rs | 1 + src/withdraw.rs | 188 +++++++++++++++++++++++++++++++++--------------- 2 files changed, 130 insertions(+), 59 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5f3f042..e1350ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,6 +51,7 @@ pub mod eip712; pub mod deposit; pub mod withdraw; +pub use withdraw::{finalize_withdrawal, wait_for_finalize_withdrawal, withdraw}; pub mod zk_middleware; pub mod zk_wallet; diff --git a/src/withdraw.rs b/src/withdraw.rs index 8e7772f..c4db0db 100644 --- a/src/withdraw.rs +++ b/src/withdraw.rs @@ -2,20 +2,86 @@ #![allow(clippy::unwrap_used)] use ethers::{ - abi::{Hash, ParamType, Token}, + abi::{Address, Hash, ParamType, Token}, middleware::SignerMiddleware, - providers::{Http, Middleware, Provider, ProviderExt}, - signers::{LocalWallet, Signer}, + providers::Middleware, + signers::Signer, types::{Bytes, U256}, }; use std::{str::FromStr, sync::Arc}; -use zksync_types::{api::L2ToL1Log, L1_MESSENGER_ADDRESS}; +use zksync_types::{api::L2ToL1Log, L1_MESSENGER_ADDRESS, L2_BASE_TOKEN_ADDRESS}; use crate::{ - contracts::{bridgehub::Bridgehub, l1_shared_bridge::L1SharedBridge}, + contracts::{bridgehub::Bridgehub, l1_shared_bridge::L1SharedBridge, l2_eth::BaseToken}, + utils::L2_ETH_TOKEN_ADDRESS, ZKMiddleware, }; +pub async fn withdraw( + amount: U256, + token: impl Into
, + from: Arc>, + l1_provider: Arc, +) -> Hash +where + M: Middleware, + S: Signer, +{ + // The type is converted to avoid adding Copy as a constraint bound (Address is Copy). + let token: Address = token.into(); + + let bridgehub_address = from.get_bridgehub_contract().await.unwrap(); + let bridgehub = Bridgehub::new(bridgehub_address, l1_provider); + + let zk_chain_id = from.get_chainid().await.unwrap(); + let zk_chain_base_token: Address = bridgehub.base_token(zk_chain_id).call().await.unwrap(); + + let token_to_withdraw_is_eth = token == L2_ETH_TOKEN_ADDRESS; + let token_to_withdraw_is_zk_chain_base_token = token == zk_chain_base_token; + + match ( + token_to_withdraw_is_eth, + token_to_withdraw_is_zk_chain_base_token, + ) { + // Withdrawing ETH from an ETH-based ZKchain to the L1. + (true, true) => withdraw_eth_from_an_eth_based_chain(amount, from).await, + // Withdrawing ETH from an ERC20-based ZKchain to the L1. + (true, false) => unimplemented!( + "Withdrawing ETH from an ERC20-based ZKchain to the L1 is not supported." + ), + // Withdrawing an ERC20 from an ETH-based ZKchain to the L1. + (false, true) => unimplemented!( + "Withdrawing an ERC20 from an ETH-based ZKchain to the L1 is not supported." + ), + // Withdrawing an ERC20 where either ETH is the base token, or an ERC20 + // different than the withdrawn is the base token. + (false, false) => unimplemented!( + "Withdrawing an ERC20 where ETH is the base token or where a different ERC20 is the base token is not supported." + ), + } +} + +pub async fn withdraw_eth_from_an_eth_based_chain( + amount: U256, + from: Arc>, +) -> Hash +where + M: Middleware, + S: Signer, +{ + let withdrawal_tx_receipt = BaseToken::new(L2_BASE_TOKEN_ADDRESS, Arc::clone(&from)) + .withdraw(from.address()) + .value(amount) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap(); + + withdrawal_tx_receipt.transaction_hash +} + pub async fn wait_for_finalize_withdrawal( l2_withdrawal_tx_hash: Hash, l2_provider: &L2Provider, @@ -38,32 +104,27 @@ pub async fn wait_for_finalize_withdrawal( } } -pub async fn finalize_withdrawal(l2_withdrawal_tx_hash: Hash) -> Hash { - let l1_provider = Provider::::connect("http://eth-sepolia").await; - let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); - let to = Arc::new(SignerMiddleware::, LocalWallet>::new( - l1_provider, - LocalWallet::from_str("0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924") - .unwrap() - .with_chain_id(l1_chain_id), - )); - - let l2_provider = - Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; - +pub async fn finalize_withdrawal( + to: Arc>, + l2_withdrawal_tx_hash: Hash, + l2_provider: &L2Provider, +) -> Hash +where + M: Middleware, + S: Signer, + L2Provider: ZKMiddleware + Middleware, +{ let bridgehub_address = l2_provider.get_bridgehub_contract().await.unwrap(); let bridgehub = Bridgehub::new(bridgehub_address, Arc::clone(&to)); let l1_shared_bridge_address = bridgehub.shared_bridge().call().await.unwrap(); let l1_shared_bridge = L1SharedBridge::new(l1_shared_bridge_address, Arc::clone(&to)); - // This is an L2 transaction hash. - let withdrawal_tx_receipt = l2_provider + let withdrawal_initialization_tx_receipt = l2_provider .get_transaction_receipt(l2_withdrawal_tx_hash) .await .unwrap() .unwrap(); - let zk_chain_id = l2_provider.get_chainid().await.unwrap().as_u64(); - let withdrawal_log = withdrawal_tx_receipt + let withdrawal_initialization_log = withdrawal_initialization_tx_receipt .logs .iter() .filter(|log| { @@ -72,9 +133,9 @@ pub async fn finalize_withdrawal(l2_withdrawal_tx_hash: Hash) -> Hash { == ethers::utils::keccak256("L1MessageSent(address,bytes32,bytes)").into() }) .collect::>()[0]; - let l2_tx_number_in_batch: u16 = U256::from_str( + let withdrawal_initialization_tx_number_in_batch: u16 = U256::from_str( &serde_json::from_value::( - withdrawal_tx_receipt + withdrawal_initialization_tx_receipt .other .get("l1BatchTxIndex") .unwrap() @@ -86,22 +147,18 @@ pub async fn finalize_withdrawal(l2_withdrawal_tx_hash: Hash) -> Hash { .as_u64() .try_into() .unwrap(); - let l2_to_l1_logs = withdrawal_tx_receipt + let withdrawal_initialization_tx_l2_to_l1_logs = withdrawal_initialization_tx_receipt .other .get_deserialized::>("l2ToL1Logs") .unwrap() .unwrap(); - let withdraw_l2_to_l1_logs = l2_to_l1_logs - .into_iter() - .filter(|log| log.sender == L1_MESSENGER_ADDRESS) - .collect::>(); - let l1_messenger_l2_to_l1_log_index = withdraw_l2_to_l1_logs - .first() - .map(|log| &log.log_index) - .map(U256::as_u64); - - let message = Bytes::from( - ethers::abi::decode(&[ParamType::Bytes], &withdrawal_log.data) + let withdrawal_initialization_l1_messenger_log_index = + withdrawal_initialization_tx_l2_to_l1_logs + .iter() + .find(|log| log.sender == L1_MESSENGER_ADDRESS) + .map(|log| U256::as_u64(&log.log_index)); + let withdrawal_initialization_message = Bytes::from( + ethers::abi::decode(&[ParamType::Bytes], &withdrawal_initialization_log.data) .unwrap() .first() .cloned() @@ -109,8 +166,11 @@ pub async fn finalize_withdrawal(l2_withdrawal_tx_hash: Hash) -> Hash { .unwrap() .unwrap(), ); - let proof = l2_provider - .get_l2_to_l1_log_proof(l2_withdrawal_tx_hash, l1_messenger_l2_to_l1_log_index) + let withdrawal_initialization_log_merkle_proof = l2_provider + .get_l2_to_l1_log_proof( + l2_withdrawal_tx_hash, + withdrawal_initialization_l1_messenger_log_index, + ) .await .unwrap() .unwrap() @@ -118,20 +178,23 @@ pub async fn finalize_withdrawal(l2_withdrawal_tx_hash: Hash) -> Hash { .into_iter() .map(Into::into) .collect::>(); - let l2_batch_number = withdraw_l2_to_l1_logs - .first() + let l2_batch_number = withdrawal_initialization_tx_l2_to_l1_logs + .iter() + .find(|log| log.sender == L1_MESSENGER_ADDRESS) .map(|log| log.l1_batch_number) .unwrap() .unwrap(); + let zk_chain_id = l2_provider.get_chainid().await.unwrap().as_u64(); + let finalize_withdrawal_tx_receipt = l1_shared_bridge .finalize_withdrawal( zk_chain_id.into(), l2_batch_number.as_u64().into(), U256::zero(), - l2_tx_number_in_batch, - message, - proof, + withdrawal_initialization_tx_number_in_batch, + withdrawal_initialization_message, + withdrawal_initialization_log_merkle_proof, ) .send() .await @@ -151,18 +214,16 @@ pub async fn finalize_withdrawal(l2_withdrawal_tx_hash: Hash) -> Hash { #[cfg(test)] mod withdraw_tests { use crate::{ - contracts::l2_eth::BaseToken, - withdraw::{finalize_withdrawal, wait_for_finalize_withdrawal}, + utils::L2_ETH_TOKEN_ADDRESS, + withdraw::{finalize_withdrawal, wait_for_finalize_withdrawal, withdraw}, }; use ethers::{ - abi::Hash, middleware::SignerMiddleware, providers::{Http, Middleware, Provider, ProviderExt}, signers::{LocalWallet, Signer}, types::U256, }; use std::{str::FromStr, sync::Arc}; - use zksync_types::L2_BASE_TOKEN_ADDRESS; #[tokio::test] async fn can_withdraw_eth_from_eth_based_chain() { @@ -177,26 +238,35 @@ mod withdraw_tests { .unwrap() .with_chain_id(zk_chain_id), )); - let amount: U256 = ethers::utils::parse_units("0.01", "ether").unwrap().into(); - let withdrawal_tx_receipt = BaseToken::new(L2_BASE_TOKEN_ADDRESS, Arc::clone(&from)) - .withdraw(from.address()) - .value(amount) - .send() - .await - .unwrap() - .await + let l1_provider = Provider::::connect("http://eth-sepolia").await; + let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); + let to = Arc::new(SignerMiddleware::, LocalWallet>::new( + l1_provider, + LocalWallet::from_str( + "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", + ) .unwrap() - .unwrap(); + .with_chain_id(l1_chain_id), + )); - let withdrawal_tx_hash = withdrawal_tx_receipt.transaction_hash; + let amount: U256 = ethers::utils::parse_units("0.01", "ether").unwrap().into(); + + let withdrawal_tx_hash = withdraw( + amount, + L2_ETH_TOKEN_ADDRESS, + Arc::clone(&from), + Arc::new(to.provider().clone()), + ) + .await; println!("https://dev.explorer.sepolia.shyft.lambdaclass.com/tx/{withdrawal_tx_hash:?}"); wait_for_finalize_withdrawal(withdrawal_tx_hash, from.provider()).await; - let finalize_withdrawal_l1_tx_hash = finalize_withdrawal(withdrawal_tx_hash).await; + let finalize_withdrawal_l1_tx_hash = + finalize_withdrawal(to, withdrawal_tx_hash, from.provider()).await; - println!("https://sepolia.etherscan.io/tx/{finalize_withdrawal_l1_tx_hash:?}",); + println!("https://sepolia.etherscan.io/tx/{finalize_withdrawal_l1_tx_hash:?}"); } } From 9aa8cac721cf52318683dab4dafd7cca6531176c Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 7 Aug 2024 10:48:10 -0300 Subject: [PATCH 27/75] Update tests suites --- tests/common/mod.rs | 96 +++++++++++++++++++++++++++++++++ tests/deposit.rs | 129 ++++++++++++++++++++++++++++++++++++++++++++ tests/lib.rs | 3 -- tests/mod.rs | 1 + tests/utils.rs | 45 ---------------- 5 files changed, 226 insertions(+), 48 deletions(-) create mode 100644 tests/common/mod.rs create mode 100644 tests/deposit.rs delete mode 100644 tests/lib.rs create mode 100644 tests/mod.rs delete mode 100644 tests/utils.rs diff --git a/tests/common/mod.rs b/tests/common/mod.rs new file mode 100644 index 0000000..fedfe46 --- /dev/null +++ b/tests/common/mod.rs @@ -0,0 +1,96 @@ +use std::{str::FromStr, sync::Arc}; + +use ethers::{ + abi::{Abi, Address, Hash}, + prelude::SignerMiddleware, + providers::{Http, Middleware, Provider, ProviderExt}, + signers::{LocalWallet, Signer}, + types::{Bytes, U256, U64}, +}; +use serde::Deserialize; +use zksync_ethers_rs::{ + utils::{L1_ETH_TOKEN_ADDRESS, L2_ETH_TOKEN_ADDRESS}, + ZKMiddleware, +}; + +#[derive(Deserialize)] +pub struct CompiledContract { + pub abi: Abi, + pub bin: Bytes, +} + +pub async fn l1_provider() -> Provider { + Provider::::connect("http://eth-sepolia").await +} + +pub async fn l2_provider() -> Provider { + Provider::::connect("https://k8s.rpc.sepolia.shyft.lambdaclass.com").await +} + +pub async fn signer( + provider: Provider, +) -> Arc, LocalWallet>> { + let chain_id = provider.get_chainid().await.unwrap().as_u64(); + Arc::new(SignerMiddleware::, LocalWallet>::new( + provider, + LocalWallet::from_str("0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924") + .unwrap() + .with_chain_id(chain_id), + )) +} + +pub async fn l1_signer() -> Arc, LocalWallet>> { + signer(l1_provider().await).await +} + +pub async fn l2_signer() -> Arc, LocalWallet>> { + signer(l2_provider().await).await +} + +pub async fn balance_of(of: Address, token: Address, provider: &Provider) -> U256 { + let token = if token == L2_ETH_TOKEN_ADDRESS { + L1_ETH_TOKEN_ADDRESS + } else { + token + }; + *provider + .get_all_account_balances(of) + .await + .unwrap() + .get(&token) + .unwrap_or(&U256::zero()) +} + +pub async fn assert_tx_succeeded(tx_hash: Hash, provider: &Provider, panic_message: &str) +where + Provider: Middleware, +{ + wait_for_tx(tx_hash, provider).await; + + let tx_receipt = provider + .get_transaction_receipt(tx_hash) + .await + .unwrap() + .unwrap(); + + assert!(tx_succeeded(&tx_receipt), "{panic_message}: {tx_receipt:?}"); +} + +async fn wait_for_tx(tx_hash: Hash, provider: &M) +where + M: Middleware, +{ + while provider + .get_transaction_receipt(tx_hash) + .await + .unwrap() + .is_none() + { + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + } +} + +fn tx_succeeded(receipt: ðers::types::TransactionReceipt) -> bool { + let tx_has_failed = receipt.status.as_ref().is_some_and(U64::is_zero); + !tx_has_failed +} diff --git a/tests/deposit.rs b/tests/deposit.rs new file mode 100644 index 0000000..7a07f0a --- /dev/null +++ b/tests/deposit.rs @@ -0,0 +1,129 @@ +use common::{assert_tx_succeeded, balance_of, l1_provider, l1_signer, l2_provider}; +use ethers::{ + abi::Address, middleware::SignerMiddleware, providers::Middleware, signers::Signer, types::U256, +}; +use std::{str::FromStr, sync::Arc}; +use zksync_ethers_rs::{ + deposit::{deposit, l2_deposit_tx_hash}, + utils::L2_ETH_TOKEN_ADDRESS, +}; + +mod common; + +async fn can_deposit(token: Address, from: Arc>, to: Address) +where + M: Middleware, + S: Signer, +{ + let refund_recipient = from.address(); + let l2_provider = l2_provider().await; + let amount: U256 = ethers::utils::parse_units("0.001", "ether").unwrap().into(); + + let receiver_l2_balance_before = balance_of(to, token, &l2_provider).await; + + let deposit_tx_hash = deposit( + amount, + token, + Arc::clone(&from), + to, + refund_recipient, + &l2_provider, + ) + .await; + + println!("https://sepolia.etherscan.io/tx/{deposit_tx_hash:?}",); + + assert_tx_succeeded(deposit_tx_hash, from.provider(), "L1 transaction failed").await; + + let l2_tx_hash = l2_deposit_tx_hash(deposit_tx_hash, from.provider()).await; + + println!("https://explorer.sepolia.shyft.lambdaclass.com/tx/{l2_tx_hash:?}"); + + assert_tx_succeeded(l2_tx_hash, &l2_provider, "L2 transaction failed").await; + + let receiver_l2_balance_after = balance_of(to, token, &l2_provider).await; + + assert_eq!( + receiver_l2_balance_after, + receiver_l2_balance_before + amount, + "Receiver's L2 balance has not increased by the deposited amount." + ); +} + +#[tokio::test] +async fn can_self_deposit_eth_to_eth_based_zk_chain() { + let from = l1_signer().await; + let to = from.address(); + can_deposit(L2_ETH_TOKEN_ADDRESS, from, to).await; +} + +#[tokio::test] +async fn can_self_deposit_erc20_to_eth_based_zk_chain() { + let some_erc20 = Address::from_str("0x7209EaD3dfe1c3a517B6b730C00bea1E7f319260").unwrap(); + let from = l1_signer().await; + let to = from.address(); + can_deposit(some_erc20, from, to).await; +} + +#[tokio::test] +#[ignore = "unimplemented"] +async fn can_self_deposit_eth_to_erc20_based_zk_chain() {} + +#[tokio::test] +#[ignore = "unimplemented"] +async fn can_self_deposit_erc20_to_same_erc20_based_zk_chain() { + let from = l1_signer().await; + let to = from.address(); + let ihc_token = Address::from_str("0xd0580192e98ea6ceb9c7b6191ed2e27560911697").unwrap(); + can_deposit(ihc_token, from, to).await; +} + +#[tokio::test] +#[ignore = "unimplemented"] +async fn can_self_deposit_erc20_to_different_erc20_based_zk_chain() {} + +#[tokio::test] +#[ignore = "unimplemented"] +async fn can_deposit_eth_to_eth_based_zk_chain_to_other_account() { + let from = l1_signer().await; + let to = Address::from_str("0x01bdD706463BC3A556a7efD8497A5b008D77dc71").unwrap(); + can_deposit(L2_ETH_TOKEN_ADDRESS, from, to).await; +} + +#[tokio::test] +#[ignore = "unimplemented"] +async fn can_deposit_erc20_to_eth_based_zk_chain_to_other_account() { + let some_erc20 = Address::from_str("0x7209EaD3dfe1c3a517B6b730C00bea1E7f319260").unwrap(); + let from = l1_signer().await; + let to = Address::from_str("0x01bdD706463BC3A556a7efD8497A5b008D77dc71").unwrap(); + can_deposit(some_erc20, from, to).await; +} + +#[tokio::test] +#[ignore = "unimplemented"] +async fn can_deposit_eth_to_erc20_based_zk_chain_to_other_account() {} + +#[tokio::test] +#[ignore = "unimplemented"] +async fn can_deposit_erc20_to_same_erc20_based_zk_chain_to_other_account() {} + +#[tokio::test] +#[ignore = "unimplemented"] +async fn can_deposit_erc20_to_different_erc20_based_zk_chain_to_other_account() {} + +#[tokio::test] +async fn testito() { + let l1_provider = l1_provider().await; + let l2_provider = l2_provider().await; + + println!( + "{:?}", + l2_deposit_tx_hash( + "0x1ba39e2ca832d5fedaf92d46220bd2582048c7e69c4a20ba74555b9ce94d5485" + .parse() + .unwrap(), + &l1_provider + ) + .await + ); +} diff --git a/tests/lib.rs b/tests/lib.rs deleted file mode 100644 index c0d188f..0000000 --- a/tests/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod utils; -mod wallet_tests; -pub mod zk_middleware_tests; diff --git a/tests/mod.rs b/tests/mod.rs new file mode 100644 index 0000000..34994bf --- /dev/null +++ b/tests/mod.rs @@ -0,0 +1 @@ +pub mod common; diff --git a/tests/utils.rs b/tests/utils.rs deleted file mode 100644 index c933280..0000000 --- a/tests/utils.rs +++ /dev/null @@ -1,45 +0,0 @@ -use std::env; - -use ethers::{ - abi::Abi, - prelude::{MiddlewareBuilder, SignerMiddleware}, - providers::{Http, Provider}, - signers::{LocalWallet, Signer, Wallet}, - types::Bytes, -}; -use ethers_contract::core::k256::ecdsa::SigningKey; -use serde::Deserialize; -use zksync_types::DEFAULT_ERA_CHAIN_ID; - -#[derive(Deserialize)] -pub struct CompiledContract { - pub abi: Abi, - pub bin: Bytes, -} - -pub fn eth_provider() -> Provider { - let url: String = env::var("ZKSYNC_WEB3_RS_L1_PROVIDER_URL").unwrap(); - Provider::try_from(url).unwrap() -} - -pub fn era_provider() -> Provider { - let url: String = env::var("ZKSYNC_WEB3_RS_L2_PROVIDER_URL").unwrap(); - Provider::try_from(url).unwrap() -} - -pub fn local_wallet() -> LocalWallet { - "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110" - .parse::() - .unwrap() - .with_chain_id(DEFAULT_ERA_CHAIN_ID) -} - -pub fn era_signer() -> SignerMiddleware, Wallet> { - let signer = Wallet::with_chain_id( - "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110" - .parse::>() - .unwrap(), - DEFAULT_ERA_CHAIN_ID, - ); - era_provider().with_signer(signer) -} From 77c4a15598e6ffa6dcac56da070e73d12f6cf031 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 7 Aug 2024 10:48:20 -0300 Subject: [PATCH 28/75] Refactor deposit module --- src/deposit/constants.rs | 11 ++ src/{deposit.rs => deposit/mod.rs} | 207 ++++++++++++++--------------- 2 files changed, 110 insertions(+), 108 deletions(-) create mode 100644 src/deposit/constants.rs rename src/{deposit.rs => deposit/mod.rs} (73%) diff --git a/src/deposit/constants.rs b/src/deposit/constants.rs new file mode 100644 index 0000000..385d53d --- /dev/null +++ b/src/deposit/constants.rs @@ -0,0 +1,11 @@ +/// Numerator used in scaling the gas limit to ensure acceptance of `L1->L2` transactions. +/// +/// This constant is part of a coefficient calculation to adjust the gas limit to account for variations +/// in the SDK estimation, ensuring the transaction will be accepted. +pub const L1_FEE_ESTIMATION_COEF_NUMERATOR: u8 = 12; + +/// Denominator used in scaling the gas limit to ensure acceptance of `L1->L2` transactions. +/// +/// This constant is part of a coefficient calculation to adjust the gas limit to account for variations +/// in the SDK estimation, ensuring the transaction will be accepted. +pub const L1_FEE_ESTIMATION_COEF_DENOMINATOR: u8 = 10; diff --git a/src/deposit.rs b/src/deposit/mod.rs similarity index 73% rename from src/deposit.rs rename to src/deposit/mod.rs index 87907da..5202a19 100644 --- a/src/deposit.rs +++ b/src/deposit/mod.rs @@ -1,16 +1,6 @@ // FIXME: Remove this after finishing the implementation. #![allow(clippy::unwrap_used)] -use std::sync::Arc; - -use ethers::{ - abi::{Address, Tokenizable}, - middleware::SignerMiddleware, - providers::Middleware, - signers::Signer, - types::U256, -}; - use crate::{ contracts::{ bridgehub::{Bridgehub, L2TransactionRequestDirect, L2TransactionRequestTwoBridgesOuter}, @@ -20,6 +10,17 @@ use crate::{ types::L1TxOverrides, utils, ZKMiddleware, }; +use constants::{L1_FEE_ESTIMATION_COEF_DENOMINATOR, L1_FEE_ESTIMATION_COEF_NUMERATOR}; +use ethers::{ + abi::{Address, Hash, Tokenizable}, + middleware::SignerMiddleware, + providers::Middleware, + signers::Signer, + types::U256, +}; +use std::sync::Arc; + +mod constants; pub async fn deposit( amount: U256, @@ -27,8 +28,8 @@ pub async fn deposit( from: Arc>, to: Address, refund_recipient: Address, - l2_provider: L2Provider, -) -> ethers::types::TransactionReceipt + l2_provider: &L2Provider, +) -> Hash where M: Middleware, S: Signer, @@ -53,23 +54,23 @@ where token_to_deposit_is_eth, token_to_deposit_is_zk_chain_base_token, ) { - // Depositing ETH to an ETH based ZKChain. - (true, true) => { - deposit_eth_to_eth_based_zk_chain( + // Depositing base token. + (_, true) => { + deposit_base_token( amount, + token, from, to, refund_recipient, zk_chain_id, l2_provider, bridgehub, + token_to_deposit_is_eth, ) .await } // Depositing ETH to a ZKChain whose base token is not ETH. (true, false) => todo!(), - // Depositing an ERC20 to a ZKChain whose base token is the same ERC20. - (false, true) => todo!(), // We are depositing an ERC20 to a ZKChain where: // 1. ETH is the base token. // 2. An ERC20 different than the deposited is the base token. @@ -84,6 +85,7 @@ where l2_provider, bridgehub, erc20, + false, ) .await } @@ -91,15 +93,17 @@ where } /// Deposit ETH to a ZKChain whose base token is ETH. -pub async fn deposit_eth_to_eth_based_zk_chain( +pub async fn deposit_base_token( amount: U256, + token: Address, from: Arc>, to: Address, refund_recipient: Address, zk_chain_id: U256, - l2_provider: L2Provider, + l2_provider: &L2Provider, bridgehub: Bridgehub>, -) -> ethers::types::TransactionReceipt + token_is_eth: bool, +) -> Hash where M: Middleware, S: Signer, @@ -153,14 +157,40 @@ where .factory_deps(vec![]) .refund_recipient(refund_recipient); + let base_token_is_eth = token == utils::L2_ETH_TOKEN_ADDRESS; + if !base_token_is_eth { + let l1_shared_bridge_address: Address = bridgehub.shared_bridge().call().await.unwrap(); + let erc20 = ERC20::new(token, Arc::>::clone(&from)); + + let allowance: U256 = erc20 + .allowance(from.address(), l1_shared_bridge_address) + .call() + .await + .unwrap(); + // ERC20 approval needs to be done before getting the nonce for the + // overrides. + if allowance < amount { + erc20 + .approve(l1_shared_bridge_address, amount) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap(); + } + } + + let value = base_token_is_eth.then_some(l2_costs).unwrap_or_default(); + // NOTE: In ETH deposits, the amount of ETH to be deposited into the // ETH based chain should be part of the `value` field of the L1 tx // which essentially is the call to the `requestL2TransactionDirect`. let overrides = L1TxOverrides::default() .from(from_addr) - .value(l2_costs) + .value(value) .gas_price(from.get_gas_price().await.unwrap()) - .gas(estimate_l1_to_l2_gas) + .gas(scale_gas_limit(estimate_l1_to_l2_gas)) .nonce(from.get_transaction_count(from_addr, None).await.unwrap()); deposit_with_l2_transaction_direct_request(bridgehub, request, overrides).await @@ -170,7 +200,7 @@ pub async fn deposit_with_l2_transaction_direct_request( bridgehub: Bridgehub>, request: L2TransactionRequestDirect, overrides: L1TxOverrides, -) -> ethers::types::TransactionReceipt +) -> Hash where M: Middleware, S: Signer, @@ -188,6 +218,7 @@ where .await .unwrap() .unwrap() + .transaction_hash } /// Deposits ERC20 tokens into a ZKChain where the base token @@ -198,10 +229,11 @@ pub async fn deposit_non_base_erc20_token( from: Arc>, to: Address, refund_recipient: Address, - l2_provider: L2Provider, + l2_provider: &L2Provider, bridgehub: Bridgehub>, erc20: ERC20>, -) -> ethers::types::TransactionReceipt + token_to_deposit_is_zk_chain_base_token: bool, +) -> Hash where M: Middleware, S: Signer, @@ -228,7 +260,7 @@ where l2_gas_per_pubdata_byte_limit, ) .await; - let l2_costs = base_cost + operator_tip; + let l2_costs = scale_gas_limit(base_cost + operator_tip); let l1_shared_bridge_address: Address = bridgehub.shared_bridge().call().await.unwrap(); @@ -288,11 +320,11 @@ where deposit_with_l2_transaction_two_bridges_request(bridgehub, request, overrides).await } -async fn deposit_with_l2_transaction_two_bridges_request( +pub async fn deposit_with_l2_transaction_two_bridges_request( bridgehub: Bridgehub>, request: L2TransactionRequestTwoBridgesOuter, overrides: L1TxOverrides, -) -> ethers::types::TransactionReceipt +) -> Hash where M: Middleware, S: Signer, @@ -310,6 +342,35 @@ where .await .unwrap() .unwrap() + .transaction_hash +} + +/// Hash corresponding to the L2 priority operation transaction for finalizing a deposit. +pub async fn l2_deposit_tx_hash( + l1_deposit_tx_hash: Hash, + l1_provider: &L1Provider, +) -> Hash +where + L1Provider: Middleware, +{ + let l1_deposit_tx_receipt = l1_provider + .get_transaction_receipt(l1_deposit_tx_hash) + .await + .unwrap() + .unwrap(); + + l1_deposit_tx_receipt + .logs + .into_iter() + .find(|event| { + event.topics[0] + .eq(ðers::utils::keccak256( + "NewPriorityRequest(uint256,bytes32,uint64,(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256[4],bytes,bytes,uint256[],bytes,bytes),bytes[])", + ) + .into()) + }) + .map(|new_priority_request_event| Hash::from_slice(&new_priority_request_event.data.0[32..64])) + .unwrap() } pub async fn l2_tx_base_cost( @@ -335,84 +396,14 @@ where .unwrap() } -#[cfg(test)] -mod deposit_tests { - use super::deposit; - use crate::utils::L2_ETH_TOKEN_ADDRESS; - use ethers::{ - abi::Address, - middleware::SignerMiddleware, - providers::{Http, Middleware, Provider, ProviderExt}, - signers::{LocalWallet, Signer}, - types::U256, - }; - use std::{str::FromStr, sync::Arc}; - - #[tokio::test] - async fn can_deposit_eth_to_eth_based_zk_chain() { - let l1_provider = Provider::::connect("http://eth-sepolia").await; - let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); - let from = Arc::new(SignerMiddleware::, LocalWallet>::new( - l1_provider, - LocalWallet::from_str( - "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", - ) - .unwrap() - .with_chain_id(l1_chain_id), - )); - let to = from.address(); - let refund_recipient = from.address(); - let l2_provider = - Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; - let amount: U256 = ethers::utils::parse_units("0.1", "ether").unwrap().into(); - - let receipt = deposit( - amount, - L2_ETH_TOKEN_ADDRESS, - from, - to, - refund_recipient, - l2_provider, - ) - .await; - - println!( - "https://sepolia.etherscan.io/tx/{:?}", - receipt.transaction_hash - ); - } - - #[tokio::test] - async fn deposit_erc20_to_eth_based_zk_chain() { - let l1_provider = Provider::::connect("http://eth-sepolia").await; - let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); - let from = Arc::new(SignerMiddleware::, LocalWallet>::new( - l1_provider, - LocalWallet::from_str( - "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", - ) - .unwrap() - .with_chain_id(l1_chain_id), - )); - let to = from.address(); - let refund_recipient = from.address(); - let l2_provider = - Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; - let amount: U256 = ethers::utils::parse_units("0.1", "ether").unwrap().into(); - - let receipt = deposit( - amount, - Address::from_str("0x7209EaD3dfe1c3a517B6b730C00bea1E7f319260").unwrap(), - from, - to, - refund_recipient, - l2_provider, - ) - .await; - - println!( - "https://sepolia.etherscan.io/tx/{:?}", - receipt.transaction_hash - ); - } +/// Scales the provided gas limit using a coefficient to ensure acceptance of L1->L2 transactions. +/// +/// This function adjusts the gas limit by multiplying it with a coefficient calculated from the +/// `L1_FEE_ESTIMATION_COEF_NUMERATOR` and `L1_FEE_ESTIMATION_COEF_DENOMINATOR` constants. +pub fn scale_gas_limit(gas_limit: U256) -> U256 { + gas_limit + .checked_mul(U256::from(L1_FEE_ESTIMATION_COEF_NUMERATOR)) + .unwrap() + .checked_div(U256::from(L1_FEE_ESTIMATION_COEF_DENOMINATOR)) + .unwrap() } From 3b8b4fcf25ebc86c17f831f81cf65a929ca32699 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 7 Aug 2024 10:48:38 -0300 Subject: [PATCH 29/75] Add L2SharedBridge instance --- src/contracts/l2_shared_bridge.rs | 3 +++ src/contracts/mod.rs | 1 + 2 files changed, 4 insertions(+) create mode 100644 src/contracts/l2_shared_bridge.rs diff --git a/src/contracts/l2_shared_bridge.rs b/src/contracts/l2_shared_bridge.rs new file mode 100644 index 0000000..46bf445 --- /dev/null +++ b/src/contracts/l2_shared_bridge.rs @@ -0,0 +1,3 @@ +use ethers_contract::abigen; + +abigen!(L2SharedBridge, "abi/IL2Bridge.json"); diff --git a/src/contracts/mod.rs b/src/contracts/mod.rs index b29e3ac..bba60f0 100644 --- a/src/contracts/mod.rs +++ b/src/contracts/mod.rs @@ -4,3 +4,4 @@ pub mod l1_shared_bridge; pub mod main_contract; pub mod l2_eth; +pub mod l2_shared_bridge; From 07edc6820d3dcb4b6f859b6d5e5b31b58ea69070 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 7 Aug 2024 10:49:46 -0300 Subject: [PATCH 30/75] Refactor withdraw --- src/withdraw.rs | 100 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 23 deletions(-) diff --git a/src/withdraw.rs b/src/withdraw.rs index c4db0db..fc45085 100644 --- a/src/withdraw.rs +++ b/src/withdraw.rs @@ -12,8 +12,10 @@ use std::{str::FromStr, sync::Arc}; use zksync_types::{api::L2ToL1Log, L1_MESSENGER_ADDRESS, L2_BASE_TOKEN_ADDRESS}; use crate::{ - contracts::{bridgehub::Bridgehub, l1_shared_bridge::L1SharedBridge, l2_eth::BaseToken}, - utils::L2_ETH_TOKEN_ADDRESS, + contracts::{ + bridgehub::Bridgehub, l1_shared_bridge::L1SharedBridge, l2_eth::BaseToken, + l2_shared_bridge::L2SharedBridge, + }, ZKMiddleware, }; @@ -36,35 +38,42 @@ where let zk_chain_id = from.get_chainid().await.unwrap(); let zk_chain_base_token: Address = bridgehub.base_token(zk_chain_id).call().await.unwrap(); - let token_to_withdraw_is_eth = token == L2_ETH_TOKEN_ADDRESS; let token_to_withdraw_is_zk_chain_base_token = token == zk_chain_base_token; - match ( - token_to_withdraw_is_eth, - token_to_withdraw_is_zk_chain_base_token, - ) { - // Withdrawing ETH from an ETH-based ZKchain to the L1. - (true, true) => withdraw_eth_from_an_eth_based_chain(amount, from).await, - // Withdrawing ETH from an ERC20-based ZKchain to the L1. - (true, false) => unimplemented!( - "Withdrawing ETH from an ERC20-based ZKchain to the L1 is not supported." - ), - // Withdrawing an ERC20 from an ETH-based ZKchain to the L1. - (false, true) => unimplemented!( - "Withdrawing an ERC20 from an ETH-based ZKchain to the L1 is not supported." - ), - // Withdrawing an ERC20 where either ETH is the base token, or an ERC20 - // different than the withdrawn is the base token. - (false, false) => unimplemented!( - "Withdrawing an ERC20 where ETH is the base token or where a different ERC20 is the base token is not supported." - ), + if token_to_withdraw_is_zk_chain_base_token { + withdraw_base_token(amount, from).await + } else { + withdraw_non_base_token(amount, token, from).await } } -pub async fn withdraw_eth_from_an_eth_based_chain( +pub async fn withdraw_non_base_token( amount: U256, + token: impl Into
, from: Arc>, ) -> Hash +where + M: Middleware, + S: Signer, +{ + let l2_shared_bridge_address = from + .get_bridge_contracts() + .await + .unwrap() + .l2_shared_default_bridge + .unwrap(); + let l2_shared_bridge = L2SharedBridge::new(l2_shared_bridge_address, Arc::clone(&from)) + .withdraw(from.address(), token.into(), amount) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap(); + l2_shared_bridge.transaction_hash +} + +pub async fn withdraw_base_token(amount: U256, from: Arc>) -> Hash where M: Middleware, S: Signer, @@ -218,6 +227,7 @@ mod withdraw_tests { withdraw::{finalize_withdrawal, wait_for_finalize_withdrawal, withdraw}, }; use ethers::{ + abi::Address, middleware::SignerMiddleware, providers::{Http, Middleware, Provider, ProviderExt}, signers::{LocalWallet, Signer}, @@ -227,6 +237,50 @@ mod withdraw_tests { #[tokio::test] async fn can_withdraw_eth_from_eth_based_chain() { + let l2_provider = Provider::::connect("http://zksync-devnet-03:3050").await; + let zk_chain_id = l2_provider.get_chainid().await.unwrap().as_u64(); + let from = Arc::new(SignerMiddleware::, LocalWallet>::new( + l2_provider, + LocalWallet::from_str( + "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", + ) + .unwrap() + .with_chain_id(zk_chain_id), + )); + + let l1_provider = Provider::::connect("http://eth-sepolia").await; + let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); + let to = Arc::new(SignerMiddleware::, LocalWallet>::new( + l1_provider, + LocalWallet::from_str( + "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", + ) + .unwrap() + .with_chain_id(l1_chain_id), + )); + + let amount: U256 = ethers::utils::parse_units("0.01", "ether").unwrap().into(); + + let withdrawal_tx_hash = withdraw( + amount, + Address::from_str("0x74Bc16333Df68581324ebF3172a4dEba5D1ADd6c").unwrap(), + Arc::clone(&from), + Arc::new(to.provider().clone()), + ) + .await; + + println!("http://zksync-devnet-03:3011/tx/{withdrawal_tx_hash:?}"); + + wait_for_finalize_withdrawal(withdrawal_tx_hash, from.provider()).await; + + let finalize_withdrawal_l1_tx_hash = + finalize_withdrawal(to, withdrawal_tx_hash, from.provider()).await; + + println!("https://sepolia.etherscan.io/tx/{finalize_withdrawal_l1_tx_hash:?}"); + } + + #[tokio::test] + async fn can_withdraw_2() { let l2_provider = Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; let zk_chain_id = l2_provider.get_chainid().await.unwrap().as_u64(); From ef2810d0f339d3541ade7498c54084dce48e867e Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 7 Aug 2024 10:49:57 -0300 Subject: [PATCH 31/75] Add gas_limit to L1TxOverrides --- src/types.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types.rs b/src/types.rs index 1b77548..51fdc93 100644 --- a/src/types.rs +++ b/src/types.rs @@ -17,6 +17,7 @@ pub struct L1TxOverrides { pub gas_price: Option, pub gas: Option, pub nonce: Option, + pub gas_limit: Option, } impl L1TxOverrides { From 9546413959408b938fef9d0f7b88d94cf89e3517 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 7 Aug 2024 10:50:05 -0300 Subject: [PATCH 32/75] Add new dep --- Cargo.lock | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 8fa3cee..1cf7594 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5899,6 +5899,7 @@ dependencies = [ "sha2 0.10.8", "thiserror", "tokio", + "zksync_contracts", "zksync_system_constants", "zksync_types", "zksync_web3_decl", diff --git a/Cargo.toml b/Cargo.toml index 3623098..7e88e33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ lazy_static = "1.4.0" zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_types"} zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_web3_decl"} zksync_system_constants = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_system_constants"} +zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_contracts"} # Async tokio = { version = "1", features = ["macros", "process"] } From bd6a5b5443bb57add38ba23baa8dd13d53dc614c Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:06:10 -0300 Subject: [PATCH 33/75] Remove old stuff --- examples/contract-deployment/Greeter.abi | 39 - examples/contract-deployment/Greeter.bin | 1 - examples/contract-deployment/Greeter.sol | 18 - examples/contract-deployment/main.rs | 94 - examples/simple_payment/main.rs | 89 - resources/testing/erc20/ERC20Token.json | 10232 --------------------- resources/testing/erc20/MyToken.json | 286 - resources/testing/erc20/abi.json | 277 - 8 files changed, 11036 deletions(-) delete mode 100644 examples/contract-deployment/Greeter.abi delete mode 100644 examples/contract-deployment/Greeter.bin delete mode 100644 examples/contract-deployment/Greeter.sol delete mode 100644 examples/contract-deployment/main.rs delete mode 100644 examples/simple_payment/main.rs delete mode 100644 resources/testing/erc20/ERC20Token.json delete mode 100644 resources/testing/erc20/MyToken.json delete mode 100644 resources/testing/erc20/abi.json diff --git a/examples/contract-deployment/Greeter.abi b/examples/contract-deployment/Greeter.abi deleted file mode 100644 index c226d99..0000000 --- a/examples/contract-deployment/Greeter.abi +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "string", - "name": "_greeting", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "greet", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_greeting", - "type": "string" - } - ], - "name": "setGreeting", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/examples/contract-deployment/Greeter.bin b/examples/contract-deployment/Greeter.bin deleted file mode 100644 index cc5bd5e..0000000 --- a/examples/contract-deployment/Greeter.bin +++ /dev/null @@ -1 +0,0 @@ -0002000000000002000500000000000200010000000103550000006001100270000000830010019d0000008001000039000000400010043f0000000101200190000000a80000c13d0000000001000031000000040110008c000001880000413d0000000101000367000000000101043b000000e001100270000000880210009c000001770000613d000000890110009c000001880000c13d0000000001000416000000000110004c000001880000c13d0000000001000031000000040210008a0000008503000041000000200420008c000000000400001900000000040340190000008502200197000000000520004c000000000300a019000000850220009c00000000020400190000000002036019000000000220004c000001880000c13d00000001020003670000000403200370000000000303043b000000840430009c000001880000213d00000023043000390000008505000041000000000614004b0000000006000019000000000605801900000085011001970000008504400197000000000714004b0000000005008019000000000114013f000000850110009c00000000010600190000000001056019000000000110004c000001880000c13d0000000401300039000000000112034f000000000101043b000000840210009c000001dc0000213d000000bf04100039000000200200008a000000000424016f000000840540009c000001dc0000213d000000400040043f000000800010043f000000240430003900000000034100190000000005000031000000000353004b000001880000213d0000001f0310018f00000001044003670000000505100272000000560000613d00000000060000190000000507600210000000000874034f000000000808043b000000a00770003900000000008704350000000106600039000000000756004b0000004e0000413d000000000630004c000000650000613d0000000505500210000000000454034f0000000303300210000000a005500039000000000605043300000000063601cf000000000636022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000363019f0000000000350435000000a0011000390000000000010435000000800100043d000000840310009c000001dc0000213d000000000400041a000000010340019000000001034002700000007f0530018f00000000030560190000001f0530008c00000000050000190000000105002039000000000454013f0000000104400190000001960000c13d000000200430008c000000870000413d0000001f0410003900000005044002700000008a044000410000008a05000041000000200610008c000000000405401900000000000004350000001f0330003900000005033002700000008a03300041000000000534004b000000870000813d000000000004041b0000000104400039000000000534004b000000830000413d0000001f0310008c000001f30000a13d00000000032101700000008a02000041000000a00400003900000000000004350000009b0000613d00000020060000390000008a020000410000000004000019000000000506001900000080065000390000000006060433000000000062041b000000200650003900000001022000390000002004400039000000000734004b000000910000413d000000a004500039000000000313004b000000a50000813d0000000303100210000000f80330018f000000010500008a000000000335022f000000000353013f0000000004040433000000000334016f000000000032041b00000001020000390000000103100210000001fd0000013d0000000001000416000000000110004c000001880000c13d00000000010000310000001f02100039000000200900008a000000000492016f000000400200043d0000000003240019000000000443004b00000000040000190000000104004039000000840530009c000001dc0000213d0000000104400190000001dc0000c13d000000400030043f0000001f0310018f00000001040003670000000505100272000000c60000613d000000000600001900000005076002100000000008720019000000000774034f000000000707043b00000000007804350000000106600039000000000756004b000000be0000413d000000000630004c000000d50000613d0000000505500210000000000454034f00000000055200190000000303300210000000000605043300000000063601cf000000000636022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000363019f00000000003504350000008503000041000000200410008c000000000400001900000000040340190000008505100197000000000650004c000000000300a019000000850550009c000000000304c019000000000330004c000001880000c13d0000000004020433000000840340009c000001880000213d000000000312001900000000012400190000001f021000390000008504000041000000000532004b0000000005000019000000000504801900000085022001970000008506300197000000000762004b0000000004008019000000000262013f000000850220009c00000000020500190000000002046019000000000220004c000001880000c13d0000000002010433000000840420009c000001dc0000213d0000003f04200039000000000494016f000000400700043d0000000004470019000000000574004b00000000050000190000000105004039000000840640009c000001dc0000213d0000000105500190000001dc0000c13d000000400040043f000000000627043600000000042100190000002004400039000000000334004b000001880000213d000000000320004c000001120000613d000000000300001900000000046300190000002003300039000000000513001900000000050504330000000000540435000000000423004b0000010b0000413d000000000126001900000000000104350000000004070433000000840140009c000001dc0000213d000000000100041a000000010210019000000001011002700000007f0310018f000000000301c0190000001f0130008c00000000010000190000000101002039000000010110018f000000000112004b000001960000c13d000000200130008c000001480000413d000100000003001d000300000004001d000000000000043500000083010000410000000002000414000000830320009c0000000001024019000000c00110021000000086011001c70000801002000039000500000009001d000400000007001d000200000006001d020602010000040f0000000206000029000000040700002900000005090000290000000102200190000001880000613d00000003040000290000001f024000390000000502200270000000200340008c0000000002004019000000000301043b00000001010000290000001f01100039000000050110027000000000011300190000000002230019000000000312004b000001480000813d000000000002041b0000000102200039000000000312004b000001440000413d0000001f0140008c000001e20000a13d000300000004001d000000000000043500000083010000410000000002000414000000830320009c0000000001024019000000c00110021000000086011001c70000801002000039000500000009001d000400000007001d020602010000040f000000040600002900000005030000290000000102200190000001880000613d000000030700002900000000033701700000002002000039000000000101043b000001690000613d0000002002000039000000000400001900000000056200190000000005050433000000000051041b000000200220003900000001011000390000002004400039000000000534004b000001610000413d000000000373004b000001740000813d0000000303700210000000f80330018f000000010400008a000000000334022f000000000343013f00000000026200190000000002020433000000000232016f000000000021041b00000001010000390000000102700210000001ec0000013d0000000001000416000000000110004c000001880000c13d000000040100008a00000000011000310000008502000041000000000310004c000000000300001900000000030240190000008501100197000000000410004c000000000200a019000000850110009c00000000010300190000000001026019000000000110004c0000018a0000613d00000000010000190000020800010430000000000400041a000000010540019000000001014002700000007f0210018f000000000301001900000000030260190000001f0130008c00000000010000190000000101002039000000000114013f00000001011001900000019c0000613d0000008b0100004100000000001004350000002201000039000000040010043f0000008c010000410000020800010430000000400200043d0000000001320436000000000550004c000001ae0000613d0000000000000435000000000430004c0000000004000019000001b40000613d0000008a0500004100000000040000190000000006410019000000000705041a000000000076043500000001055000390000002004400039000000000634004b000001a60000413d000001b40000013d000001000500008a000000000454016f0000000000410435000000000330004c000000200400003900000000040060190000003f03400039000000200400008a000000000543016f0000000003250019000000000553004b00000000050000190000000105004039000000840630009c000001dc0000213d0000000105500190000001dc0000c13d000000400030043f00000020050000390000000005530436000000000202043300000000002504350000004005300039000000000620004c000001cf0000613d000000000600001900000000075600190000000008610019000000000808043300000000008704350000002006600039000000000726004b000001c80000413d000000000152001900000000000104350000005f01200039000000000141016f0000008302000041000000830410009c0000000001028019000000830430009c000000000203401900000040022002100000006001100210000000000121019f000002070001042e0000008b0100004100000000001004350000004101000039000000040010043f0000008c010000410000020800010430000000000140004c0000000001000019000001e60000613d00000000010604330000000302400210000000010300008a000000000223022f000000000232013f000000000221016f0000000101400210000000000112019f000000000010041b0000002001000039000001000010044300000120000004430000008701000041000002070001042e000000000210004c0000000002000019000001f70000613d000000a00200043d0000000303100210000000010400008a000000000334022f000000000343013f000000000332016f0000000102100210000000000123019f000000000010041b0000000001000019000002070001042e00000204002104230000000102000039000000000001042d0000000002000019000000000001042d0000020600000432000002070001042e000002080001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000000000000000000000000000000000000000000000ffffffffffffffff80000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000020000000000000000000000000000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000cfae321700000000000000000000000000000000000000000000000000000000a4136862290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5634e487b71000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000049640b54fe6c32c3d2b931a12d0e92ca2c903f61744f706361c28dd6cf0a568a \ No newline at end of file diff --git a/examples/contract-deployment/Greeter.sol b/examples/contract-deployment/Greeter.sol deleted file mode 100644 index 7208f4c..0000000 --- a/examples/contract-deployment/Greeter.sol +++ /dev/null @@ -1,18 +0,0 @@ -//SPDX-License-Identifier: Unlicense -pragma solidity ^0.8.8; - -contract Greeter { - string private greeting; - - constructor(string memory _greeting) { - greeting = _greeting; - } - - function greet() public view returns (string memory) { - return greeting; - } - - function setGreeting(string memory _greeting) public { - greeting = _greeting; - } -} diff --git a/examples/contract-deployment/main.rs b/examples/contract-deployment/main.rs deleted file mode 100644 index 6aa77e0..0000000 --- a/examples/contract-deployment/main.rs +++ /dev/null @@ -1,94 +0,0 @@ -use ethers::abi::Abi; -use std::str::FromStr; -use zksync_web3_rs::providers::{Middleware, Provider}; -use zksync_web3_rs::signers::{LocalWallet, Signer}; -use zksync_web3_rs::zks_provider::ZKSProvider; -use zksync_web3_rs::zks_wallet::{CallRequest, DeployRequest}; -use zksync_web3_rs::ZKSWallet; - -// This is the default url for a local `era-test-node` instance. -static ERA_PROVIDER_URL: &str = "http://127.0.0.1:8011"; - -// This is the private key for one of the rich wallets that come bundled with the era-test-node. -static PRIVATE_KEY: &str = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; - -static CONTRACT_BIN: &str = include_str!("./Greeter.bin"); -static CONTRACT_ABI: &str = include_str!("./Greeter.abi"); - -#[tokio::main(flavor = "current_thread")] -async fn main() { - // Note that for this code example we only need to interface with zkSync Era. We don't care - // about the Ethereum layer-1 network. - let zk_wallet = { - let era_provider = Provider::try_from(ERA_PROVIDER_URL).unwrap(); - - let chain_id = era_provider.get_chainid().await.unwrap(); - let l2_wallet = LocalWallet::from_str(PRIVATE_KEY) - .unwrap() - .with_chain_id(chain_id.as_u64()); - ZKSWallet::new(l2_wallet, None, Some(era_provider.clone()), None).unwrap() - }; - - // Deploy contract: - let contract_address = { - let abi = Abi::load(CONTRACT_ABI.as_bytes()).unwrap(); - let contract_bin = hex::decode(CONTRACT_BIN).unwrap().to_vec(); - let request = DeployRequest::with(abi, contract_bin, vec!["Hey".to_owned()]) - .from(zk_wallet.l2_address()); - let address = zk_wallet.deploy(&request).await.unwrap(); - - println!("Contract address: {:#?}", address); - - address - }; - - // Call the greet view method: - { - let era_provider = zk_wallet.get_era_provider().unwrap(); - let call_request = CallRequest::new(contract_address, "greet()(string)".to_owned()); - - let greet = ZKSProvider::call(era_provider.as_ref(), &call_request) - .await - .unwrap(); - - println!("greet: {}", greet[0]); - } - - // Perform a signed transaction calling the setGreeting method - { - let receipt = zk_wallet - .get_era_provider() - .unwrap() - .clone() - .send_eip712( - &zk_wallet.l2_wallet, - contract_address, - "setGreeting(string)", - Some(["Hello".into()].into()), - None, - ) - .await - .unwrap() - .await - .unwrap() - .unwrap(); - - println!( - "setGreeting transaction hash {:#?}", - receipt.transaction_hash - ); - }; - - // Call the greet view method: - - { - let era_provider = zk_wallet.get_era_provider().unwrap(); - let call_request = CallRequest::new(contract_address, "greet()(string)".to_owned()); - - let greet = ZKSProvider::call(era_provider.as_ref(), &call_request) - .await - .unwrap(); - - println!("greet: {}", greet[0]); - } -} diff --git a/examples/simple_payment/main.rs b/examples/simple_payment/main.rs deleted file mode 100644 index dc47dd3..0000000 --- a/examples/simple_payment/main.rs +++ /dev/null @@ -1,89 +0,0 @@ -use clap::Parser; -use ethers::{ - abi::Address, - prelude::k256::ecdsa::SigningKey, - providers::{Middleware, Provider}, - signers::{Signer, Wallet}, - types::U256, -}; -use zksync_web3_rs::{zks_wallet::TransferRequest, ZKSWallet}; - -// It is set so that the transaction is replay-protected (EIP-155) -// https://era.zksync.io/docs/api/hardhat/testing.html#connect-wallet-to-local-nodes -//const L1_CHAIN_ID: u64 = 9; -const L2_CHAIN_ID: u64 = 270; - -#[derive(Parser)] -struct Args { - #[clap(long)] - pub host: String, - #[clap(short, long)] - pub port: u16, - #[clap(long, name = "AMOUNT_TO_TRANSFER")] - pub amount: String, - #[clap(long, name = "SENDER_ADDRESS")] - pub from: Address, - #[clap(long, name = "RECEIVER_ADDRESS")] - pub to: Address, - #[clap(long, name = "SENDER_PRIVATE_KEY")] - pub private_key: Wallet, -} - -#[tokio::main] -async fn main() { - env_logger::builder() - .filter_module("reqwest::connect", log::LevelFilter::Off) - .filter_level(log::LevelFilter::Debug) - .init(); - - let args = Args::parse(); - - /* Connecting to the node */ - let amount = U256::from_dec_str(&args.amount).unwrap(); - log::debug!("Amount to transfer: {:?}", amount); - let signer = Wallet::with_chain_id(args.private_key, L2_CHAIN_ID); - - let provider = Provider::try_from(format!( - "http://{host}:{port}", - host = args.host, - port = args.port - )) - .unwrap() - .interval(std::time::Duration::from_millis(10)); - - let zk_wallet = ZKSWallet::new(signer, None, Some(provider.clone()), None).unwrap(); - - /* Payment transaction building */ - let payment_request = TransferRequest::new(amount).to(args.to).from(args.from); - - log::debug!("{:?}", payment_request); - - /* Sending the payment transaction */ - - log::debug!( - "Sender's balance before paying: {:?}", - provider.clone().get_balance(args.from, None).await.unwrap() - ); - log::debug!( - "Receiver's balance before getting payed: {:?}", - provider.get_balance(args.to, None).await.unwrap() - ); - - let payment_transaction_id = zk_wallet.transfer(&payment_request, None).await.unwrap(); - let payment_transaction_receipt = provider - .get_transaction_receipt(payment_transaction_id) - .await - .unwrap() - .unwrap(); - - log::info!("{:?}", payment_transaction_receipt); - - log::debug!( - "Sender's balance after paying: {:?}", - provider.get_balance(args.from, None).await.unwrap() - ); - log::debug!( - "Receiver's balance after getting payed: {:?}", - provider.get_balance(args.to, None).await.unwrap() - ); -} diff --git a/resources/testing/erc20/ERC20Token.json b/resources/testing/erc20/ERC20Token.json deleted file mode 100644 index 11c23c7..0000000 --- a/resources/testing/erc20/ERC20Token.json +++ /dev/null @@ -1,10232 +0,0 @@ -{ - "compilerInput": "{\"language\":\"Solidity\",\"sources\":{\"contract-2f654b501f.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport \\\"@openzeppelin/contracts@4.9.2/token/ERC20/ERC20.sol\\\";\\n\\ncontract ERC20Token is ERC20 {\\n constructor() ERC20(\\\"ERC20Token\\\", \\\"ERC20\\\") {}\\n}\\n\"},\"@openzeppelin/contracts@4.9.2/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\"},\"@openzeppelin/contracts@4.9.2/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\"},\"@openzeppelin/contracts@4.9.2/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\"},\"@openzeppelin/contracts@4.9.2/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\"}},\"settings\":{\"optimizer\":{\"enabled\":false,\"runs\":200},\"outputSelection\":{\"*\":{\"\":[\"ast\"],\"*\":[\"abi\",\"metadata\",\"devdoc\",\"userdoc\",\"storageLayout\",\"evm.legacyAssembly\",\"evm.bytecode\",\"evm.deployedBytecode\",\"evm.methodIdentifiers\",\"evm.gasEstimates\",\"evm.assembly\"]}}}}", - "name": "ERC20Token", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contract-2f654b501f.sol\":\"ERC20Token\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts@4.9.2/token/ERC20/ERC20.sol\":{\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cac938788bc4be12101e59d45588b4e059579f4e61062e1cda8d6b06c0191b15\",\"dweb:/ipfs/QmV2JKCyjTVH3rkWNrfdJRhAT7tZ3usAN2XcnD4h53Mvih\"]},\"@openzeppelin/contracts@4.9.2/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5\",\"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53\"]},\"@openzeppelin/contracts@4.9.2/token/ERC20/extensions/IERC20Metadata.sol\":{\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a376d3dda2cb70536c0a45c208b29b34ac560c4cb4f513a42079f96ba47d2dd\",\"dweb:/ipfs/QmZQg6gn1sUpM8wHzwNvSnihumUCAhxD119MpXeKp8B9s8\"]},\"@openzeppelin/contracts@4.9.2/utils/Context.sol\":{\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92\",\"dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3\"]},\"contract-2f654b501f.sol\":{\"keccak256\":\"0x609a271925f287dc634e06c3a875df759b7fad8c78571dc2f7068b70a2a7db26\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://051d6930c3f2e073a9fa1917d65b5336abadf5ecf4a65c4426ac0bc41706d01b\",\"dweb:/ipfs/QmZnhVzFG5fvcPDhwFnVGyndmD81jUmz7NLiusVX8MUZr5\"]}},\"version\":1}", - "bytecode": { - "functionDebugData": { - "@_44": { - "entryPoint": null, - "id": 44, - "parameterSlots": 2, - "returnSlots": 0 - }, - "@_724": { - "entryPoint": null, - "id": 724, - "parameterSlots": 0, - "returnSlots": 0 - }, - "array_dataslot_t_string_storage": { - "entryPoint": 328, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "array_length_t_string_memory_ptr": { - "entryPoint": 170, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "clean_up_bytearray_end_slots_t_string_storage": { - "entryPoint": 649, - "id": null, - "parameterSlots": 3, - "returnSlots": 0 - }, - "cleanup_t_uint256": { - "entryPoint": 464, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "clear_storage_range_t_bytes1": { - "entryPoint": 610, - "id": null, - "parameterSlots": 2, - "returnSlots": 0 - }, - "convert_t_uint256_to_t_uint256": { - "entryPoint": 484, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "copy_byte_array_to_storage_from_t_string_memory_ptr_to_t_string_storage": { - "entryPoint": 804, - "id": null, - "parameterSlots": 2, - "returnSlots": 0 - }, - "divide_by_32_ceil": { - "entryPoint": 349, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "extract_byte_array_length": { - "entryPoint": 275, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "extract_used_part_and_set_length_of_short_byte_array": { - "entryPoint": 774, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "identity": { - "entryPoint": 474, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "mask_bytes_dynamic": { - "entryPoint": 742, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "panic_error_0x22": { - "entryPoint": 228, - "id": null, - "parameterSlots": 0, - "returnSlots": 0 - }, - "panic_error_0x41": { - "entryPoint": 181, - "id": null, - "parameterSlots": 0, - "returnSlots": 0 - }, - "prepare_store_t_uint256": { - "entryPoint": 524, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "shift_left_dynamic": { - "entryPoint": 365, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "shift_right_unsigned_dynamic": { - "entryPoint": 729, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "storage_set_to_zero_t_uint256": { - "entryPoint": 582, - "id": null, - "parameterSlots": 2, - "returnSlots": 0 - }, - "update_byte_slice_dynamic32": { - "entryPoint": 378, - "id": null, - "parameterSlots": 3, - "returnSlots": 1 - }, - "update_storage_value_t_uint256_to_t_uint256": { - "entryPoint": 534, - "id": null, - "parameterSlots": 3, - "returnSlots": 0 - }, - "zero_value_for_split_t_uint256": { - "entryPoint": 577, - "id": null, - "parameterSlots": 0, - "returnSlots": 1 - } - }, - "generatedSources": [ - { - "ast": { - "nodeType": "YulBlock", - "src": "0:5231:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "66:40:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "77:22:5", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "93:5:5" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "87:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "87:12:5" - }, - "variableNames": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "77:6:5" - } - ] - } - ] - }, - "name": "array_length_t_string_memory_ptr", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "49:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "length", - "nodeType": "YulTypedName", - "src": "59:6:5", - "type": "" - } - ], - "src": "7:99:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "140:152:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "157:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "160:77:5", - "type": "", - "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "150:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "150:88:5" - }, - "nodeType": "YulExpressionStatement", - "src": "150:88:5" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "254:1:5", - "type": "", - "value": "4" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "257:4:5", - "type": "", - "value": "0x41" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "247:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "247:15:5" - }, - "nodeType": "YulExpressionStatement", - "src": "247:15:5" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "278:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "281:4:5", - "type": "", - "value": "0x24" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "271:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "271:15:5" - }, - "nodeType": "YulExpressionStatement", - "src": "271:15:5" - } - ] - }, - "name": "panic_error_0x41", - "nodeType": "YulFunctionDefinition", - "src": "112:180:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "326:152:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "343:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "346:77:5", - "type": "", - "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "336:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "336:88:5" - }, - "nodeType": "YulExpressionStatement", - "src": "336:88:5" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "440:1:5", - "type": "", - "value": "4" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "443:4:5", - "type": "", - "value": "0x22" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "433:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "433:15:5" - }, - "nodeType": "YulExpressionStatement", - "src": "433:15:5" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "464:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "467:4:5", - "type": "", - "value": "0x24" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "457:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "457:15:5" - }, - "nodeType": "YulExpressionStatement", - "src": "457:15:5" - } - ] - }, - "name": "panic_error_0x22", - "nodeType": "YulFunctionDefinition", - "src": "298:180:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "535:269:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "545:22:5", - "value": { - "arguments": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "559:4:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "565:1:5", - "type": "", - "value": "2" - } - ], - "functionName": { - "name": "div", - "nodeType": "YulIdentifier", - "src": "555:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "555:12:5" - }, - "variableNames": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "545:6:5" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "576:38:5", - "value": { - "arguments": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "606:4:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "612:1:5", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "602:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "602:12:5" - }, - "variables": [ - { - "name": "outOfPlaceEncoding", - "nodeType": "YulTypedName", - "src": "580:18:5", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "653:51:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "667:27:5", - "value": { - "arguments": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "681:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "689:4:5", - "type": "", - "value": "0x7f" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "677:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "677:17:5" - }, - "variableNames": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "667:6:5" - } - ] - } - ] - }, - "condition": { - "arguments": [ - { - "name": "outOfPlaceEncoding", - "nodeType": "YulIdentifier", - "src": "633:18:5" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "626:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "626:26:5" - }, - "nodeType": "YulIf", - "src": "623:81:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "756:42:5", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "panic_error_0x22", - "nodeType": "YulIdentifier", - "src": "770:16:5" - }, - "nodeType": "YulFunctionCall", - "src": "770:18:5" - }, - "nodeType": "YulExpressionStatement", - "src": "770:18:5" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "outOfPlaceEncoding", - "nodeType": "YulIdentifier", - "src": "720:18:5" - }, - { - "arguments": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "743:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "751:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "740:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "740:14:5" - } - ], - "functionName": { - "name": "eq", - "nodeType": "YulIdentifier", - "src": "717:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "717:38:5" - }, - "nodeType": "YulIf", - "src": "714:84:5" - } - ] - }, - "name": "extract_byte_array_length", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "data", - "nodeType": "YulTypedName", - "src": "519:4:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "length", - "nodeType": "YulTypedName", - "src": "528:6:5", - "type": "" - } - ], - "src": "484:320:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "864:87:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "874:11:5", - "value": { - "name": "ptr", - "nodeType": "YulIdentifier", - "src": "882:3:5" - }, - "variableNames": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "874:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "902:1:5", - "type": "", - "value": "0" - }, - { - "name": "ptr", - "nodeType": "YulIdentifier", - "src": "905:3:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "895:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "895:14:5" - }, - "nodeType": "YulExpressionStatement", - "src": "895:14:5" - }, - { - "nodeType": "YulAssignment", - "src": "918:26:5", - "value": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "936:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "939:4:5", - "type": "", - "value": "0x20" - } - ], - "functionName": { - "name": "keccak256", - "nodeType": "YulIdentifier", - "src": "926:9:5" - }, - "nodeType": "YulFunctionCall", - "src": "926:18:5" - }, - "variableNames": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "918:4:5" - } - ] - } - ] - }, - "name": "array_dataslot_t_string_storage", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "ptr", - "nodeType": "YulTypedName", - "src": "851:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "data", - "nodeType": "YulTypedName", - "src": "859:4:5", - "type": "" - } - ], - "src": "810:141:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1001:49:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1011:33:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1029:5:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1036:2:5", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1025:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1025:14:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1041:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "div", - "nodeType": "YulIdentifier", - "src": "1021:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1021:23:5" - }, - "variableNames": [ - { - "name": "result", - "nodeType": "YulIdentifier", - "src": "1011:6:5" - } - ] - } - ] - }, - "name": "divide_by_32_ceil", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "984:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "result", - "nodeType": "YulTypedName", - "src": "994:6:5", - "type": "" - } - ], - "src": "957:93:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1109:54:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1119:37:5", - "value": { - "arguments": [ - { - "name": "bits", - "nodeType": "YulIdentifier", - "src": "1144:4:5" - }, - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1150:5:5" - } - ], - "functionName": { - "name": "shl", - "nodeType": "YulIdentifier", - "src": "1140:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1140:16:5" - }, - "variableNames": [ - { - "name": "newValue", - "nodeType": "YulIdentifier", - "src": "1119:8:5" - } - ] - } - ] - }, - "name": "shift_left_dynamic", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "bits", - "nodeType": "YulTypedName", - "src": "1084:4:5", - "type": "" - }, - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1090:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "newValue", - "nodeType": "YulTypedName", - "src": "1100:8:5", - "type": "" - } - ], - "src": "1056:107:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1245:317:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "1255:35:5", - "value": { - "arguments": [ - { - "name": "shiftBytes", - "nodeType": "YulIdentifier", - "src": "1276:10:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1288:1:5", - "type": "", - "value": "8" - } - ], - "functionName": { - "name": "mul", - "nodeType": "YulIdentifier", - "src": "1272:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1272:18:5" - }, - "variables": [ - { - "name": "shiftBits", - "nodeType": "YulTypedName", - "src": "1259:9:5", - "type": "" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "1299:109:5", - "value": { - "arguments": [ - { - "name": "shiftBits", - "nodeType": "YulIdentifier", - "src": "1330:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1341:66:5", - "type": "", - "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - } - ], - "functionName": { - "name": "shift_left_dynamic", - "nodeType": "YulIdentifier", - "src": "1311:18:5" - }, - "nodeType": "YulFunctionCall", - "src": "1311:97:5" - }, - "variables": [ - { - "name": "mask", - "nodeType": "YulTypedName", - "src": "1303:4:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "1417:51:5", - "value": { - "arguments": [ - { - "name": "shiftBits", - "nodeType": "YulIdentifier", - "src": "1448:9:5" - }, - { - "name": "toInsert", - "nodeType": "YulIdentifier", - "src": "1459:8:5" - } - ], - "functionName": { - "name": "shift_left_dynamic", - "nodeType": "YulIdentifier", - "src": "1429:18:5" - }, - "nodeType": "YulFunctionCall", - "src": "1429:39:5" - }, - "variableNames": [ - { - "name": "toInsert", - "nodeType": "YulIdentifier", - "src": "1417:8:5" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "1477:30:5", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1490:5:5" - }, - { - "arguments": [ - { - "name": "mask", - "nodeType": "YulIdentifier", - "src": "1501:4:5" - } - ], - "functionName": { - "name": "not", - "nodeType": "YulIdentifier", - "src": "1497:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1497:9:5" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "1486:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1486:21:5" - }, - "variableNames": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1477:5:5" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "1516:40:5", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1529:5:5" - }, - { - "arguments": [ - { - "name": "toInsert", - "nodeType": "YulIdentifier", - "src": "1540:8:5" - }, - { - "name": "mask", - "nodeType": "YulIdentifier", - "src": "1550:4:5" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "1536:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1536:19:5" - } - ], - "functionName": { - "name": "or", - "nodeType": "YulIdentifier", - "src": "1526:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "1526:30:5" - }, - "variableNames": [ - { - "name": "result", - "nodeType": "YulIdentifier", - "src": "1516:6:5" - } - ] - } - ] - }, - "name": "update_byte_slice_dynamic32", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1206:5:5", - "type": "" - }, - { - "name": "shiftBytes", - "nodeType": "YulTypedName", - "src": "1213:10:5", - "type": "" - }, - { - "name": "toInsert", - "nodeType": "YulTypedName", - "src": "1225:8:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "result", - "nodeType": "YulTypedName", - "src": "1238:6:5", - "type": "" - } - ], - "src": "1169:393:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1613:32:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1623:16:5", - "value": { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1634:5:5" - }, - "variableNames": [ - { - "name": "cleaned", - "nodeType": "YulIdentifier", - "src": "1623:7:5" - } - ] - } - ] - }, - "name": "cleanup_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1595:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "cleaned", - "nodeType": "YulTypedName", - "src": "1605:7:5", - "type": "" - } - ], - "src": "1568:77:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1683:28:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1693:12:5", - "value": { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1700:5:5" - }, - "variableNames": [ - { - "name": "ret", - "nodeType": "YulIdentifier", - "src": "1693:3:5" - } - ] - } - ] - }, - "name": "identity", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1669:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "ret", - "nodeType": "YulTypedName", - "src": "1679:3:5", - "type": "" - } - ], - "src": "1651:60:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1777:82:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1787:66:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1845:5:5" - } - ], - "functionName": { - "name": "cleanup_t_uint256", - "nodeType": "YulIdentifier", - "src": "1827:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "1827:24:5" - } - ], - "functionName": { - "name": "identity", - "nodeType": "YulIdentifier", - "src": "1818:8:5" - }, - "nodeType": "YulFunctionCall", - "src": "1818:34:5" - } - ], - "functionName": { - "name": "cleanup_t_uint256", - "nodeType": "YulIdentifier", - "src": "1800:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "1800:53:5" - }, - "variableNames": [ - { - "name": "converted", - "nodeType": "YulIdentifier", - "src": "1787:9:5" - } - ] - } - ] - }, - "name": "convert_t_uint256_to_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1757:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "converted", - "nodeType": "YulTypedName", - "src": "1767:9:5", - "type": "" - } - ], - "src": "1717:142:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1912:28:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1922:12:5", - "value": { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1929:5:5" - }, - "variableNames": [ - { - "name": "ret", - "nodeType": "YulIdentifier", - "src": "1922:3:5" - } - ] - } - ] - }, - "name": "prepare_store_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1898:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "ret", - "nodeType": "YulTypedName", - "src": "1908:3:5", - "type": "" - } - ], - "src": "1865:75:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2022:193:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "2032:63:5", - "value": { - "arguments": [ - { - "name": "value_0", - "nodeType": "YulIdentifier", - "src": "2087:7:5" - } - ], - "functionName": { - "name": "convert_t_uint256_to_t_uint256", - "nodeType": "YulIdentifier", - "src": "2056:30:5" - }, - "nodeType": "YulFunctionCall", - "src": "2056:39:5" - }, - "variables": [ - { - "name": "convertedValue_0", - "nodeType": "YulTypedName", - "src": "2036:16:5", - "type": "" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "slot", - "nodeType": "YulIdentifier", - "src": "2111:4:5" - }, - { - "arguments": [ - { - "arguments": [ - { - "name": "slot", - "nodeType": "YulIdentifier", - "src": "2151:4:5" - } - ], - "functionName": { - "name": "sload", - "nodeType": "YulIdentifier", - "src": "2145:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "2145:11:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "2158:6:5" - }, - { - "arguments": [ - { - "name": "convertedValue_0", - "nodeType": "YulIdentifier", - "src": "2190:16:5" - } - ], - "functionName": { - "name": "prepare_store_t_uint256", - "nodeType": "YulIdentifier", - "src": "2166:23:5" - }, - "nodeType": "YulFunctionCall", - "src": "2166:41:5" - } - ], - "functionName": { - "name": "update_byte_slice_dynamic32", - "nodeType": "YulIdentifier", - "src": "2117:27:5" - }, - "nodeType": "YulFunctionCall", - "src": "2117:91:5" - } - ], - "functionName": { - "name": "sstore", - "nodeType": "YulIdentifier", - "src": "2104:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "2104:105:5" - }, - "nodeType": "YulExpressionStatement", - "src": "2104:105:5" - } - ] - }, - "name": "update_storage_value_t_uint256_to_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "slot", - "nodeType": "YulTypedName", - "src": "1999:4:5", - "type": "" - }, - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "2005:6:5", - "type": "" - }, - { - "name": "value_0", - "nodeType": "YulTypedName", - "src": "2013:7:5", - "type": "" - } - ], - "src": "1946:269:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2270:24:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "2280:8:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2287:1:5", - "type": "", - "value": "0" - }, - "variableNames": [ - { - "name": "ret", - "nodeType": "YulIdentifier", - "src": "2280:3:5" - } - ] - } - ] - }, - "name": "zero_value_for_split_t_uint256", - "nodeType": "YulFunctionDefinition", - "returnVariables": [ - { - "name": "ret", - "nodeType": "YulTypedName", - "src": "2266:3:5", - "type": "" - } - ], - "src": "2221:73:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2353:136:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "2363:46:5", - "value": { - "arguments": [], - "functionName": { - "name": "zero_value_for_split_t_uint256", - "nodeType": "YulIdentifier", - "src": "2377:30:5" - }, - "nodeType": "YulFunctionCall", - "src": "2377:32:5" - }, - "variables": [ - { - "name": "zero_0", - "nodeType": "YulTypedName", - "src": "2367:6:5", - "type": "" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "slot", - "nodeType": "YulIdentifier", - "src": "2462:4:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "2468:6:5" - }, - { - "name": "zero_0", - "nodeType": "YulIdentifier", - "src": "2476:6:5" - } - ], - "functionName": { - "name": "update_storage_value_t_uint256_to_t_uint256", - "nodeType": "YulIdentifier", - "src": "2418:43:5" - }, - "nodeType": "YulFunctionCall", - "src": "2418:65:5" - }, - "nodeType": "YulExpressionStatement", - "src": "2418:65:5" - } - ] - }, - "name": "storage_set_to_zero_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "slot", - "nodeType": "YulTypedName", - "src": "2339:4:5", - "type": "" - }, - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "2345:6:5", - "type": "" - } - ], - "src": "2300:189:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2545:136:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "2612:63:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "start", - "nodeType": "YulIdentifier", - "src": "2656:5:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2663:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "storage_set_to_zero_t_uint256", - "nodeType": "YulIdentifier", - "src": "2626:29:5" - }, - "nodeType": "YulFunctionCall", - "src": "2626:39:5" - }, - "nodeType": "YulExpressionStatement", - "src": "2626:39:5" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "start", - "nodeType": "YulIdentifier", - "src": "2565:5:5" - }, - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "2572:3:5" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "2562:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "2562:14:5" - }, - "nodeType": "YulForLoop", - "post": { - "nodeType": "YulBlock", - "src": "2577:26:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "2579:22:5", - "value": { - "arguments": [ - { - "name": "start", - "nodeType": "YulIdentifier", - "src": "2592:5:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2599:1:5", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2588:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "2588:13:5" - }, - "variableNames": [ - { - "name": "start", - "nodeType": "YulIdentifier", - "src": "2579:5:5" - } - ] - } - ] - }, - "pre": { - "nodeType": "YulBlock", - "src": "2559:2:5", - "statements": [] - }, - "src": "2555:120:5" - } - ] - }, - "name": "clear_storage_range_t_bytes1", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "start", - "nodeType": "YulTypedName", - "src": "2533:5:5", - "type": "" - }, - { - "name": "end", - "nodeType": "YulTypedName", - "src": "2540:3:5", - "type": "" - } - ], - "src": "2495:186:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2766:464:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "2792:431:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "2806:54:5", - "value": { - "arguments": [ - { - "name": "array", - "nodeType": "YulIdentifier", - "src": "2854:5:5" - } - ], - "functionName": { - "name": "array_dataslot_t_string_storage", - "nodeType": "YulIdentifier", - "src": "2822:31:5" - }, - "nodeType": "YulFunctionCall", - "src": "2822:38:5" - }, - "variables": [ - { - "name": "dataArea", - "nodeType": "YulTypedName", - "src": "2810:8:5", - "type": "" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "2873:63:5", - "value": { - "arguments": [ - { - "name": "dataArea", - "nodeType": "YulIdentifier", - "src": "2896:8:5" - }, - { - "arguments": [ - { - "name": "startIndex", - "nodeType": "YulIdentifier", - "src": "2924:10:5" - } - ], - "functionName": { - "name": "divide_by_32_ceil", - "nodeType": "YulIdentifier", - "src": "2906:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "2906:29:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2892:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "2892:44:5" - }, - "variables": [ - { - "name": "deleteStart", - "nodeType": "YulTypedName", - "src": "2877:11:5", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3093:27:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "3095:23:5", - "value": { - "name": "dataArea", - "nodeType": "YulIdentifier", - "src": "3110:8:5" - }, - "variableNames": [ - { - "name": "deleteStart", - "nodeType": "YulIdentifier", - "src": "3095:11:5" - } - ] - } - ] - }, - "condition": { - "arguments": [ - { - "name": "startIndex", - "nodeType": "YulIdentifier", - "src": "3077:10:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3089:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "3074:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "3074:18:5" - }, - "nodeType": "YulIf", - "src": "3071:49:5" - }, - { - "expression": { - "arguments": [ - { - "name": "deleteStart", - "nodeType": "YulIdentifier", - "src": "3162:11:5" - }, - { - "arguments": [ - { - "name": "dataArea", - "nodeType": "YulIdentifier", - "src": "3179:8:5" - }, - { - "arguments": [ - { - "name": "len", - "nodeType": "YulIdentifier", - "src": "3207:3:5" - } - ], - "functionName": { - "name": "divide_by_32_ceil", - "nodeType": "YulIdentifier", - "src": "3189:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "3189:22:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3175:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3175:37:5" - } - ], - "functionName": { - "name": "clear_storage_range_t_bytes1", - "nodeType": "YulIdentifier", - "src": "3133:28:5" - }, - "nodeType": "YulFunctionCall", - "src": "3133:80:5" - }, - "nodeType": "YulExpressionStatement", - "src": "3133:80:5" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "len", - "nodeType": "YulIdentifier", - "src": "2783:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2788:2:5", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "gt", - "nodeType": "YulIdentifier", - "src": "2780:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "2780:11:5" - }, - "nodeType": "YulIf", - "src": "2777:446:5" - } - ] - }, - "name": "clean_up_bytearray_end_slots_t_string_storage", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "array", - "nodeType": "YulTypedName", - "src": "2742:5:5", - "type": "" - }, - { - "name": "len", - "nodeType": "YulTypedName", - "src": "2749:3:5", - "type": "" - }, - { - "name": "startIndex", - "nodeType": "YulTypedName", - "src": "2754:10:5", - "type": "" - } - ], - "src": "2687:543:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3299:54:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "3309:37:5", - "value": { - "arguments": [ - { - "name": "bits", - "nodeType": "YulIdentifier", - "src": "3334:4:5" - }, - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "3340:5:5" - } - ], - "functionName": { - "name": "shr", - "nodeType": "YulIdentifier", - "src": "3330:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3330:16:5" - }, - "variableNames": [ - { - "name": "newValue", - "nodeType": "YulIdentifier", - "src": "3309:8:5" - } - ] - } - ] - }, - "name": "shift_right_unsigned_dynamic", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "bits", - "nodeType": "YulTypedName", - "src": "3274:4:5", - "type": "" - }, - { - "name": "value", - "nodeType": "YulTypedName", - "src": "3280:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "newValue", - "nodeType": "YulTypedName", - "src": "3290:8:5", - "type": "" - } - ], - "src": "3236:117:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3410:118:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "3420:68:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3469:1:5", - "type": "", - "value": "8" - }, - { - "name": "bytes", - "nodeType": "YulIdentifier", - "src": "3472:5:5" - } - ], - "functionName": { - "name": "mul", - "nodeType": "YulIdentifier", - "src": "3465:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3465:13:5" - }, - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3484:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "not", - "nodeType": "YulIdentifier", - "src": "3480:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3480:6:5" - } - ], - "functionName": { - "name": "shift_right_unsigned_dynamic", - "nodeType": "YulIdentifier", - "src": "3436:28:5" - }, - "nodeType": "YulFunctionCall", - "src": "3436:51:5" - } - ], - "functionName": { - "name": "not", - "nodeType": "YulIdentifier", - "src": "3432:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3432:56:5" - }, - "variables": [ - { - "name": "mask", - "nodeType": "YulTypedName", - "src": "3424:4:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "3497:25:5", - "value": { - "arguments": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "3511:4:5" - }, - { - "name": "mask", - "nodeType": "YulIdentifier", - "src": "3517:4:5" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "3507:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3507:15:5" - }, - "variableNames": [ - { - "name": "result", - "nodeType": "YulIdentifier", - "src": "3497:6:5" - } - ] - } - ] - }, - "name": "mask_bytes_dynamic", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "data", - "nodeType": "YulTypedName", - "src": "3387:4:5", - "type": "" - }, - { - "name": "bytes", - "nodeType": "YulTypedName", - "src": "3393:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "result", - "nodeType": "YulTypedName", - "src": "3403:6:5", - "type": "" - } - ], - "src": "3359:169:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3614:214:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "3747:37:5", - "value": { - "arguments": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "3774:4:5" - }, - { - "name": "len", - "nodeType": "YulIdentifier", - "src": "3780:3:5" - } - ], - "functionName": { - "name": "mask_bytes_dynamic", - "nodeType": "YulIdentifier", - "src": "3755:18:5" - }, - "nodeType": "YulFunctionCall", - "src": "3755:29:5" - }, - "variableNames": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "3747:4:5" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "3793:29:5", - "value": { - "arguments": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "3804:4:5" - }, - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3814:1:5", - "type": "", - "value": "2" - }, - { - "name": "len", - "nodeType": "YulIdentifier", - "src": "3817:3:5" - } - ], - "functionName": { - "name": "mul", - "nodeType": "YulIdentifier", - "src": "3810:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3810:11:5" - } - ], - "functionName": { - "name": "or", - "nodeType": "YulIdentifier", - "src": "3801:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "3801:21:5" - }, - "variableNames": [ - { - "name": "used", - "nodeType": "YulIdentifier", - "src": "3793:4:5" - } - ] - } - ] - }, - "name": "extract_used_part_and_set_length_of_short_byte_array", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "data", - "nodeType": "YulTypedName", - "src": "3595:4:5", - "type": "" - }, - { - "name": "len", - "nodeType": "YulTypedName", - "src": "3601:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "used", - "nodeType": "YulTypedName", - "src": "3609:4:5", - "type": "" - } - ], - "src": "3533:295:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3925:1303:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "3936:51:5", - "value": { - "arguments": [ - { - "name": "src", - "nodeType": "YulIdentifier", - "src": "3983:3:5" - } - ], - "functionName": { - "name": "array_length_t_string_memory_ptr", - "nodeType": "YulIdentifier", - "src": "3950:32:5" - }, - "nodeType": "YulFunctionCall", - "src": "3950:37:5" - }, - "variables": [ - { - "name": "newLen", - "nodeType": "YulTypedName", - "src": "3940:6:5", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4072:22:5", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "panic_error_0x41", - "nodeType": "YulIdentifier", - "src": "4074:16:5" - }, - "nodeType": "YulFunctionCall", - "src": "4074:18:5" - }, - "nodeType": "YulExpressionStatement", - "src": "4074:18:5" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "4044:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4052:18:5", - "type": "", - "value": "0xffffffffffffffff" - } - ], - "functionName": { - "name": "gt", - "nodeType": "YulIdentifier", - "src": "4041:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "4041:30:5" - }, - "nodeType": "YulIf", - "src": "4038:56:5" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "4104:52:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "slot", - "nodeType": "YulIdentifier", - "src": "4150:4:5" - } - ], - "functionName": { - "name": "sload", - "nodeType": "YulIdentifier", - "src": "4144:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "4144:11:5" - } - ], - "functionName": { - "name": "extract_byte_array_length", - "nodeType": "YulIdentifier", - "src": "4118:25:5" - }, - "nodeType": "YulFunctionCall", - "src": "4118:38:5" - }, - "variables": [ - { - "name": "oldLen", - "nodeType": "YulTypedName", - "src": "4108:6:5", - "type": "" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "slot", - "nodeType": "YulIdentifier", - "src": "4249:4:5" - }, - { - "name": "oldLen", - "nodeType": "YulIdentifier", - "src": "4255:6:5" - }, - { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "4263:6:5" - } - ], - "functionName": { - "name": "clean_up_bytearray_end_slots_t_string_storage", - "nodeType": "YulIdentifier", - "src": "4203:45:5" - }, - "nodeType": "YulFunctionCall", - "src": "4203:67:5" - }, - "nodeType": "YulExpressionStatement", - "src": "4203:67:5" - }, - { - "nodeType": "YulVariableDeclaration", - "src": "4280:18:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4297:1:5", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "srcOffset", - "nodeType": "YulTypedName", - "src": "4284:9:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "4308:17:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4321:4:5", - "type": "", - "value": "0x20" - }, - "variableNames": [ - { - "name": "srcOffset", - "nodeType": "YulIdentifier", - "src": "4308:9:5" - } - ] - }, - { - "cases": [ - { - "body": { - "nodeType": "YulBlock", - "src": "4372:611:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "4386:37:5", - "value": { - "arguments": [ - { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "4405:6:5" - }, - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4417:4:5", - "type": "", - "value": "0x1f" - } - ], - "functionName": { - "name": "not", - "nodeType": "YulIdentifier", - "src": "4413:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4413:9:5" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "4401:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4401:22:5" - }, - "variables": [ - { - "name": "loopEnd", - "nodeType": "YulTypedName", - "src": "4390:7:5", - "type": "" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "4437:51:5", - "value": { - "arguments": [ - { - "name": "slot", - "nodeType": "YulIdentifier", - "src": "4483:4:5" - } - ], - "functionName": { - "name": "array_dataslot_t_string_storage", - "nodeType": "YulIdentifier", - "src": "4451:31:5" - }, - "nodeType": "YulFunctionCall", - "src": "4451:37:5" - }, - "variables": [ - { - "name": "dstPtr", - "nodeType": "YulTypedName", - "src": "4441:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "4501:10:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4510:1:5", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "i", - "nodeType": "YulTypedName", - "src": "4505:1:5", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4569:163:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "dstPtr", - "nodeType": "YulIdentifier", - "src": "4594:6:5" - }, - { - "arguments": [ - { - "arguments": [ - { - "name": "src", - "nodeType": "YulIdentifier", - "src": "4612:3:5" - }, - { - "name": "srcOffset", - "nodeType": "YulIdentifier", - "src": "4617:9:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4608:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4608:19:5" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "4602:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "4602:26:5" - } - ], - "functionName": { - "name": "sstore", - "nodeType": "YulIdentifier", - "src": "4587:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "4587:42:5" - }, - "nodeType": "YulExpressionStatement", - "src": "4587:42:5" - }, - { - "nodeType": "YulAssignment", - "src": "4646:24:5", - "value": { - "arguments": [ - { - "name": "dstPtr", - "nodeType": "YulIdentifier", - "src": "4660:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4668:1:5", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4656:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4656:14:5" - }, - "variableNames": [ - { - "name": "dstPtr", - "nodeType": "YulIdentifier", - "src": "4646:6:5" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "4687:31:5", - "value": { - "arguments": [ - { - "name": "srcOffset", - "nodeType": "YulIdentifier", - "src": "4704:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4715:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4700:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4700:18:5" - }, - "variableNames": [ - { - "name": "srcOffset", - "nodeType": "YulIdentifier", - "src": "4687:9:5" - } - ] - } - ] - }, - "condition": { - "arguments": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "4535:1:5" - }, - { - "name": "loopEnd", - "nodeType": "YulIdentifier", - "src": "4538:7:5" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "4532:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "4532:14:5" - }, - "nodeType": "YulForLoop", - "post": { - "nodeType": "YulBlock", - "src": "4547:21:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "4549:17:5", - "value": { - "arguments": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "4558:1:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4561:4:5", - "type": "", - "value": "0x20" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4554:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4554:12:5" - }, - "variableNames": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "4549:1:5" - } - ] - } - ] - }, - "pre": { - "nodeType": "YulBlock", - "src": "4528:3:5", - "statements": [] - }, - "src": "4524:208:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4768:156:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "4786:43:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "src", - "nodeType": "YulIdentifier", - "src": "4813:3:5" - }, - { - "name": "srcOffset", - "nodeType": "YulIdentifier", - "src": "4818:9:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4809:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4809:19:5" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "4803:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "4803:26:5" - }, - "variables": [ - { - "name": "lastValue", - "nodeType": "YulTypedName", - "src": "4790:9:5", - "type": "" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "dstPtr", - "nodeType": "YulIdentifier", - "src": "4853:6:5" - }, - { - "arguments": [ - { - "name": "lastValue", - "nodeType": "YulIdentifier", - "src": "4880:9:5" - }, - { - "arguments": [ - { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "4895:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4903:4:5", - "type": "", - "value": "0x1f" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "4891:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4891:17:5" - } - ], - "functionName": { - "name": "mask_bytes_dynamic", - "nodeType": "YulIdentifier", - "src": "4861:18:5" - }, - "nodeType": "YulFunctionCall", - "src": "4861:48:5" - } - ], - "functionName": { - "name": "sstore", - "nodeType": "YulIdentifier", - "src": "4846:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "4846:64:5" - }, - "nodeType": "YulExpressionStatement", - "src": "4846:64:5" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "loopEnd", - "nodeType": "YulIdentifier", - "src": "4751:7:5" - }, - { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "4760:6:5" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "4748:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "4748:19:5" - }, - "nodeType": "YulIf", - "src": "4745:179:5" - }, - { - "expression": { - "arguments": [ - { - "name": "slot", - "nodeType": "YulIdentifier", - "src": "4944:4:5" - }, - { - "arguments": [ - { - "arguments": [ - { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "4958:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4966:1:5", - "type": "", - "value": "2" - } - ], - "functionName": { - "name": "mul", - "nodeType": "YulIdentifier", - "src": "4954:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4954:14:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4970:1:5", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4950:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4950:22:5" - } - ], - "functionName": { - "name": "sstore", - "nodeType": "YulIdentifier", - "src": "4937:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "4937:36:5" - }, - "nodeType": "YulExpressionStatement", - "src": "4937:36:5" - } - ] - }, - "nodeType": "YulCase", - "src": "4365:618:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4370:1:5", - "type": "", - "value": "1" - } - }, - { - "body": { - "nodeType": "YulBlock", - "src": "5000:222:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "5014:14:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5027:1:5", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "5018:5:5", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "5051:67:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "5069:35:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "src", - "nodeType": "YulIdentifier", - "src": "5088:3:5" - }, - { - "name": "srcOffset", - "nodeType": "YulIdentifier", - "src": "5093:9:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5084:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "5084:19:5" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "5078:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "5078:26:5" - }, - "variableNames": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "5069:5:5" - } - ] - } - ] - }, - "condition": { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "5044:6:5" - }, - "nodeType": "YulIf", - "src": "5041:77:5" - }, - { - "expression": { - "arguments": [ - { - "name": "slot", - "nodeType": "YulIdentifier", - "src": "5138:4:5" - }, - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "5197:5:5" - }, - { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "5204:6:5" - } - ], - "functionName": { - "name": "extract_used_part_and_set_length_of_short_byte_array", - "nodeType": "YulIdentifier", - "src": "5144:52:5" - }, - "nodeType": "YulFunctionCall", - "src": "5144:67:5" - } - ], - "functionName": { - "name": "sstore", - "nodeType": "YulIdentifier", - "src": "5131:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "5131:81:5" - }, - "nodeType": "YulExpressionStatement", - "src": "5131:81:5" - } - ] - }, - "nodeType": "YulCase", - "src": "4992:230:5", - "value": "default" - } - ], - "expression": { - "arguments": [ - { - "name": "newLen", - "nodeType": "YulIdentifier", - "src": "4345:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4353:2:5", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "gt", - "nodeType": "YulIdentifier", - "src": "4342:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "4342:14:5" - }, - "nodeType": "YulSwitch", - "src": "4335:887:5" - } - ] - }, - "name": "copy_byte_array_to_storage_from_t_string_memory_ptr_to_t_string_storage", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "slot", - "nodeType": "YulTypedName", - "src": "3914:4:5", - "type": "" - }, - { - "name": "src", - "nodeType": "YulTypedName", - "src": "3920:3:5", - "type": "" - } - ], - "src": "3833:1395:5" - } - ] - }, - "contents": "{\n\n function array_length_t_string_memory_ptr(value) -> length {\n\n length := mload(value)\n\n }\n\n function panic_error_0x41() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x41)\n revert(0, 0x24)\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n function array_dataslot_t_string_storage(ptr) -> data {\n data := ptr\n\n mstore(0, ptr)\n data := keccak256(0, 0x20)\n\n }\n\n function divide_by_32_ceil(value) -> result {\n result := div(add(value, 31), 32)\n }\n\n function shift_left_dynamic(bits, value) -> newValue {\n newValue :=\n\n shl(bits, value)\n\n }\n\n function update_byte_slice_dynamic32(value, shiftBytes, toInsert) -> result {\n let shiftBits := mul(shiftBytes, 8)\n let mask := shift_left_dynamic(shiftBits, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)\n toInsert := shift_left_dynamic(shiftBits, toInsert)\n value := and(value, not(mask))\n result := or(value, and(toInsert, mask))\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function identity(value) -> ret {\n ret := value\n }\n\n function convert_t_uint256_to_t_uint256(value) -> converted {\n converted := cleanup_t_uint256(identity(cleanup_t_uint256(value)))\n }\n\n function prepare_store_t_uint256(value) -> ret {\n ret := value\n }\n\n function update_storage_value_t_uint256_to_t_uint256(slot, offset, value_0) {\n let convertedValue_0 := convert_t_uint256_to_t_uint256(value_0)\n sstore(slot, update_byte_slice_dynamic32(sload(slot), offset, prepare_store_t_uint256(convertedValue_0)))\n }\n\n function zero_value_for_split_t_uint256() -> ret {\n ret := 0\n }\n\n function storage_set_to_zero_t_uint256(slot, offset) {\n let zero_0 := zero_value_for_split_t_uint256()\n update_storage_value_t_uint256_to_t_uint256(slot, offset, zero_0)\n }\n\n function clear_storage_range_t_bytes1(start, end) {\n for {} lt(start, end) { start := add(start, 1) }\n {\n storage_set_to_zero_t_uint256(start, 0)\n }\n }\n\n function clean_up_bytearray_end_slots_t_string_storage(array, len, startIndex) {\n\n if gt(len, 31) {\n let dataArea := array_dataslot_t_string_storage(array)\n let deleteStart := add(dataArea, divide_by_32_ceil(startIndex))\n // If we are clearing array to be short byte array, we want to clear only data starting from array data area.\n if lt(startIndex, 32) { deleteStart := dataArea }\n clear_storage_range_t_bytes1(deleteStart, add(dataArea, divide_by_32_ceil(len)))\n }\n\n }\n\n function shift_right_unsigned_dynamic(bits, value) -> newValue {\n newValue :=\n\n shr(bits, value)\n\n }\n\n function mask_bytes_dynamic(data, bytes) -> result {\n let mask := not(shift_right_unsigned_dynamic(mul(8, bytes), not(0)))\n result := and(data, mask)\n }\n function extract_used_part_and_set_length_of_short_byte_array(data, len) -> used {\n // we want to save only elements that are part of the array after resizing\n // others should be set to zero\n data := mask_bytes_dynamic(data, len)\n used := or(data, mul(2, len))\n }\n function copy_byte_array_to_storage_from_t_string_memory_ptr_to_t_string_storage(slot, src) {\n\n let newLen := array_length_t_string_memory_ptr(src)\n // Make sure array length is sane\n if gt(newLen, 0xffffffffffffffff) { panic_error_0x41() }\n\n let oldLen := extract_byte_array_length(sload(slot))\n\n // potentially truncate data\n clean_up_bytearray_end_slots_t_string_storage(slot, oldLen, newLen)\n\n let srcOffset := 0\n\n srcOffset := 0x20\n\n switch gt(newLen, 31)\n case 1 {\n let loopEnd := and(newLen, not(0x1f))\n\n let dstPtr := array_dataslot_t_string_storage(slot)\n let i := 0\n for { } lt(i, loopEnd) { i := add(i, 0x20) } {\n sstore(dstPtr, mload(add(src, srcOffset)))\n dstPtr := add(dstPtr, 1)\n srcOffset := add(srcOffset, 32)\n }\n if lt(loopEnd, newLen) {\n let lastValue := mload(add(src, srcOffset))\n sstore(dstPtr, mask_bytes_dynamic(lastValue, and(newLen, 0x1f)))\n }\n sstore(slot, add(mul(newLen, 2), 1))\n }\n default {\n let value := 0\n if newLen {\n value := mload(add(src, srcOffset))\n }\n sstore(slot, extract_used_part_and_set_length_of_short_byte_array(value, newLen))\n }\n }\n\n}\n", - "id": 5, - "language": "Yul", - "name": "#utility.yul" - } - ], - "linkReferences": {}, - "object": "60806040523480156200001157600080fd5b506040518060400160405280600a81526020017f4552433230546f6b656e000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f455243323000000000000000000000000000000000000000000000000000000081525081600390816200008f919062000324565b508060049081620000a1919062000324565b5050506200040b565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200012c57607f821691505b602082108103620001425762000141620000e4565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620001ac7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200016d565b620001b886836200016d565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000205620001ff620001f984620001d0565b620001da565b620001d0565b9050919050565b6000819050919050565b6200022183620001e4565b6200023962000230826200020c565b8484546200017a565b825550505050565b600090565b6200025062000241565b6200025d81848462000216565b505050565b5b8181101562000285576200027960008262000246565b60018101905062000263565b5050565b601f821115620002d4576200029e8162000148565b620002a9846200015d565b81016020851015620002b9578190505b620002d1620002c8856200015d565b83018262000262565b50505b505050565b600082821c905092915050565b6000620002f960001984600802620002d9565b1980831691505092915050565b6000620003148383620002e6565b9150826002028217905092915050565b6200032f82620000aa565b67ffffffffffffffff8111156200034b576200034a620000b5565b5b62000357825462000113565b6200036482828562000289565b600060209050601f8311600181146200039c576000841562000387578287015190505b62000393858262000306565b86555062000403565b601f198416620003ac8662000148565b60005b82811015620003d657848901518255600182019150602085019450602081019050620003af565b86831015620003f65784890151620003f2601f891682620002e6565b8355505b6001600288020188555050505b505050505050565b61122f806200041b6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea2646970667358221220d8197461cfcf76643d85773e2b13b928ad86533df5fdb26a8122e9a71272bcc364736f6c63430008120033", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0xA DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4552433230546F6B656E00000000000000000000000000000000000000000000 DUP2 MSTORE POP PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x5 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4552433230000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 PUSH1 0x3 SWAP1 DUP2 PUSH3 0x8F SWAP2 SWAP1 PUSH3 0x324 JUMP JUMPDEST POP DUP1 PUSH1 0x4 SWAP1 DUP2 PUSH3 0xA1 SWAP2 SWAP1 PUSH3 0x324 JUMP JUMPDEST POP POP POP PUSH3 0x40B JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH3 0x12C JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 SUB PUSH3 0x142 JUMPI PUSH3 0x141 PUSH3 0xE4 JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP DUP2 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 PUSH1 0x1F DUP4 ADD DIV SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 SHL SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x8 DUP4 MUL PUSH3 0x1AC PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 PUSH3 0x16D JUMP JUMPDEST PUSH3 0x1B8 DUP7 DUP4 PUSH3 0x16D JUMP JUMPDEST SWAP6 POP DUP1 NOT DUP5 AND SWAP4 POP DUP1 DUP7 AND DUP5 OR SWAP3 POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x205 PUSH3 0x1FF PUSH3 0x1F9 DUP5 PUSH3 0x1D0 JUMP JUMPDEST PUSH3 0x1DA JUMP JUMPDEST PUSH3 0x1D0 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH3 0x221 DUP4 PUSH3 0x1E4 JUMP JUMPDEST PUSH3 0x239 PUSH3 0x230 DUP3 PUSH3 0x20C JUMP JUMPDEST DUP5 DUP5 SLOAD PUSH3 0x17A JUMP JUMPDEST DUP3 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x0 SWAP1 JUMP JUMPDEST PUSH3 0x250 PUSH3 0x241 JUMP JUMPDEST PUSH3 0x25D DUP2 DUP5 DUP5 PUSH3 0x216 JUMP JUMPDEST POP POP POP JUMP JUMPDEST JUMPDEST DUP2 DUP2 LT ISZERO PUSH3 0x285 JUMPI PUSH3 0x279 PUSH1 0x0 DUP3 PUSH3 0x246 JUMP JUMPDEST PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH3 0x263 JUMP JUMPDEST POP POP JUMP JUMPDEST PUSH1 0x1F DUP3 GT ISZERO PUSH3 0x2D4 JUMPI PUSH3 0x29E DUP2 PUSH3 0x148 JUMP JUMPDEST PUSH3 0x2A9 DUP5 PUSH3 0x15D JUMP JUMPDEST DUP2 ADD PUSH1 0x20 DUP6 LT ISZERO PUSH3 0x2B9 JUMPI DUP2 SWAP1 POP JUMPDEST PUSH3 0x2D1 PUSH3 0x2C8 DUP6 PUSH3 0x15D JUMP JUMPDEST DUP4 ADD DUP3 PUSH3 0x262 JUMP JUMPDEST POP POP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 SHR SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x2F9 PUSH1 0x0 NOT DUP5 PUSH1 0x8 MUL PUSH3 0x2D9 JUMP JUMPDEST NOT DUP1 DUP4 AND SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x314 DUP4 DUP4 PUSH3 0x2E6 JUMP JUMPDEST SWAP2 POP DUP3 PUSH1 0x2 MUL DUP3 OR SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH3 0x32F DUP3 PUSH3 0xAA JUMP JUMPDEST PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x34B JUMPI PUSH3 0x34A PUSH3 0xB5 JUMP JUMPDEST JUMPDEST PUSH3 0x357 DUP3 SLOAD PUSH3 0x113 JUMP JUMPDEST PUSH3 0x364 DUP3 DUP3 DUP6 PUSH3 0x289 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 SWAP1 POP PUSH1 0x1F DUP4 GT PUSH1 0x1 DUP2 EQ PUSH3 0x39C JUMPI PUSH1 0x0 DUP5 ISZERO PUSH3 0x387 JUMPI DUP3 DUP8 ADD MLOAD SWAP1 POP JUMPDEST PUSH3 0x393 DUP6 DUP3 PUSH3 0x306 JUMP JUMPDEST DUP7 SSTORE POP PUSH3 0x403 JUMP JUMPDEST PUSH1 0x1F NOT DUP5 AND PUSH3 0x3AC DUP7 PUSH3 0x148 JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP3 DUP2 LT ISZERO PUSH3 0x3D6 JUMPI DUP5 DUP10 ADD MLOAD DUP3 SSTORE PUSH1 0x1 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP6 ADD SWAP5 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH3 0x3AF JUMP JUMPDEST DUP7 DUP4 LT ISZERO PUSH3 0x3F6 JUMPI DUP5 DUP10 ADD MLOAD PUSH3 0x3F2 PUSH1 0x1F DUP10 AND DUP3 PUSH3 0x2E6 JUMP JUMPDEST DUP4 SSTORE POP JUMPDEST PUSH1 0x1 PUSH1 0x2 DUP9 MUL ADD DUP9 SSTORE POP POP POP JUMPDEST POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x122F DUP1 PUSH3 0x41B PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0xA9 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x39509351 GT PUSH2 0x71 JUMPI DUP1 PUSH4 0x39509351 EQ PUSH2 0x168 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x198 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x1C8 JUMPI DUP1 PUSH4 0xA457C2D7 EQ PUSH2 0x1E6 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x216 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x246 JUMPI PUSH2 0xA9 JUMP JUMPDEST DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xAE JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xCC JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0xFC JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x11A JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x14A JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xB6 PUSH2 0x276 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xC3 SWAP2 SWAP1 PUSH2 0xB0C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0xE6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xE1 SWAP2 SWAP1 PUSH2 0xBC7 JUMP JUMPDEST PUSH2 0x308 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xF3 SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x104 PUSH2 0x32B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x111 SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x134 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x12F SWAP2 SWAP1 PUSH2 0xC67 JUMP JUMPDEST PUSH2 0x335 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x141 SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x152 PUSH2 0x364 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x15F SWAP2 SWAP1 PUSH2 0xCD6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x182 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x17D SWAP2 SWAP1 PUSH2 0xBC7 JUMP JUMPDEST PUSH2 0x36D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x18F SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x1B2 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x1AD SWAP2 SWAP1 PUSH2 0xCF1 JUMP JUMPDEST PUSH2 0x3A4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BF SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x1D0 PUSH2 0x3EC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DD SWAP2 SWAP1 PUSH2 0xB0C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x200 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x1FB SWAP2 SWAP1 PUSH2 0xBC7 JUMP JUMPDEST PUSH2 0x47E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x20D SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x230 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x22B SWAP2 SWAP1 PUSH2 0xBC7 JUMP JUMPDEST PUSH2 0x4F5 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x23D SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x260 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x25B SWAP2 SWAP1 PUSH2 0xD1E JUMP JUMPDEST PUSH2 0x518 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x26D SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD PUSH2 0x285 SWAP1 PUSH2 0xD8D JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x2B1 SWAP1 PUSH2 0xD8D JUMP JUMPDEST DUP1 ISZERO PUSH2 0x2FE JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2D3 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2FE JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2E1 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x313 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH2 0x320 DUP2 DUP6 DUP6 PUSH2 0x5A7 JUMP JUMPDEST PUSH1 0x1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x340 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH2 0x34D DUP6 DUP3 DUP6 PUSH2 0x770 JUMP JUMPDEST PUSH2 0x358 DUP6 DUP6 DUP6 PUSH2 0x7FC JUMP JUMPDEST PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x12 SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x378 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH2 0x399 DUP2 DUP6 DUP6 PUSH2 0x38A DUP6 DUP10 PUSH2 0x518 JUMP JUMPDEST PUSH2 0x394 SWAP2 SWAP1 PUSH2 0xDED JUMP JUMPDEST PUSH2 0x5A7 JUMP JUMPDEST PUSH1 0x1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x4 DUP1 SLOAD PUSH2 0x3FB SWAP1 PUSH2 0xD8D JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x427 SWAP1 PUSH2 0xD8D JUMP JUMPDEST DUP1 ISZERO PUSH2 0x474 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x449 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x474 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x457 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x489 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x497 DUP3 DUP7 PUSH2 0x518 JUMP JUMPDEST SWAP1 POP DUP4 DUP2 LT ISZERO PUSH2 0x4DC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x4D3 SWAP1 PUSH2 0xE93 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x4E9 DUP3 DUP7 DUP7 DUP5 SUB PUSH2 0x5A7 JUMP JUMPDEST PUSH1 0x1 SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x500 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH2 0x50D DUP2 DUP6 DUP6 PUSH2 0x7FC JUMP JUMPDEST PUSH1 0x1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 CALLER SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SUB PUSH2 0x616 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x60D SWAP1 PUSH2 0xF25 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SUB PUSH2 0x685 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x67C SWAP1 PUSH2 0xFB7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP4 PUSH1 0x40 MLOAD PUSH2 0x763 SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x77C DUP5 DUP5 PUSH2 0x518 JUMP JUMPDEST SWAP1 POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 EQ PUSH2 0x7F6 JUMPI DUP2 DUP2 LT ISZERO PUSH2 0x7E8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7DF SWAP1 PUSH2 0x1023 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x7F5 DUP5 DUP5 DUP5 DUP5 SUB PUSH2 0x5A7 JUMP JUMPDEST JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SUB PUSH2 0x86B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x862 SWAP1 PUSH2 0x10B5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SUB PUSH2 0x8DA JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8D1 SWAP1 PUSH2 0x1147 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x8E5 DUP4 DUP4 DUP4 PUSH2 0xA72 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP2 DUP2 LT ISZERO PUSH2 0x96B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x962 SWAP1 PUSH2 0x11D9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP2 DUP2 SUB PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xA59 SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH2 0xA6C DUP5 DUP5 DUP5 PUSH2 0xA77 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST POP POP POP JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xAB6 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xA9B JUMP JUMPDEST PUSH1 0x0 DUP5 DUP5 ADD MSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xADE DUP3 PUSH2 0xA7C JUMP JUMPDEST PUSH2 0xAE8 DUP2 DUP6 PUSH2 0xA87 JUMP JUMPDEST SWAP4 POP PUSH2 0xAF8 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0xA98 JUMP JUMPDEST PUSH2 0xB01 DUP2 PUSH2 0xAC2 JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0xB26 DUP2 DUP5 PUSH2 0xAD3 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xB5E DUP3 PUSH2 0xB33 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xB6E DUP2 PUSH2 0xB53 JUMP JUMPDEST DUP2 EQ PUSH2 0xB79 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xB8B DUP2 PUSH2 0xB65 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xBA4 DUP2 PUSH2 0xB91 JUMP JUMPDEST DUP2 EQ PUSH2 0xBAF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xBC1 DUP2 PUSH2 0xB9B JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0xBDE JUMPI PUSH2 0xBDD PUSH2 0xB2E JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xBEC DUP6 DUP3 DUP7 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0xBFD DUP6 DUP3 DUP7 ADD PUSH2 0xBB2 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xC1C DUP2 PUSH2 0xC07 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xC37 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xC13 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xC46 DUP2 PUSH2 0xB91 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xC61 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xC3D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0xC80 JUMPI PUSH2 0xC7F PUSH2 0xB2E JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xC8E DUP7 DUP3 DUP8 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0xC9F DUP7 DUP3 DUP8 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0xCB0 DUP7 DUP3 DUP8 ADD PUSH2 0xBB2 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 PUSH1 0xFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xCD0 DUP2 PUSH2 0xCBA JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xCEB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xCC7 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD07 JUMPI PUSH2 0xD06 PUSH2 0xB2E JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xD15 DUP5 DUP3 DUP6 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0xD35 JUMPI PUSH2 0xD34 PUSH2 0xB2E JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xD43 DUP6 DUP3 DUP7 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0xD54 DUP6 DUP3 DUP7 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0xDA5 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 SUB PUSH2 0xDB8 JUMPI PUSH2 0xDB7 PUSH2 0xD5E JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xDF8 DUP3 PUSH2 0xB91 JUMP JUMPDEST SWAP2 POP PUSH2 0xE03 DUP4 PUSH2 0xB91 JUMP JUMPDEST SWAP3 POP DUP3 DUP3 ADD SWAP1 POP DUP1 DUP3 GT ISZERO PUSH2 0xE1B JUMPI PUSH2 0xE1A PUSH2 0xDBE JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x45524332303A2064656372656173656420616C6C6F77616E63652062656C6F77 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x207A65726F000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xE7D PUSH1 0x25 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0xE88 DUP3 PUSH2 0xE21 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0xEAC DUP2 PUSH2 0xE70 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A20617070726F76652066726F6D20746865207A65726F20616464 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x7265737300000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF0F PUSH1 0x24 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0xF1A DUP3 PUSH2 0xEB3 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0xF3E DUP2 PUSH2 0xF02 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A20617070726F766520746F20746865207A65726F206164647265 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x7373000000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xFA1 PUSH1 0x22 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0xFAC DUP3 PUSH2 0xF45 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0xFD0 DUP2 PUSH2 0xF94 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A20696E73756666696369656E7420616C6C6F77616E6365000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x100D PUSH1 0x1D DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0x1018 DUP3 PUSH2 0xFD7 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x103C DUP2 PUSH2 0x1000 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A207472616E736665722066726F6D20746865207A65726F206164 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x6472657373000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x109F PUSH1 0x25 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0x10AA DUP3 PUSH2 0x1043 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x10CE DUP2 PUSH2 0x1092 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A207472616E7366657220746F20746865207A65726F2061646472 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x6573730000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1131 PUSH1 0x23 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0x113C DUP3 PUSH2 0x10D5 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x1160 DUP2 PUSH2 0x1124 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A207472616E7366657220616D6F756E7420657863656564732062 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x616C616E63650000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11C3 PUSH1 0x26 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0x11CE DUP3 PUSH2 0x1167 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x11F2 DUP2 PUSH2 0x11B6 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xD8 NOT PUSH21 0x61CFCF76643D85773E2B13B928AD86533DF5FDB26A DUP2 0x22 0xE9 0xA7 SLT PUSH19 0xBCC364736F6C63430008120033000000000000 ", - "sourceMap": "120:82:4:-:0;;;155:45;;;;;;;;;;1980:113:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2054:5;2046;:13;;;;;;:::i;:::-;;2079:7;2069;:17;;;;;;:::i;:::-;;1980:113;;120:82:4;;7:99:5;59:6;93:5;87:12;77:22;;7:99;;;:::o;112:180::-;160:77;157:1;150:88;257:4;254:1;247:15;281:4;278:1;271:15;298:180;346:77;343:1;336:88;443:4;440:1;433:15;467:4;464:1;457:15;484:320;528:6;565:1;559:4;555:12;545:22;;612:1;606:4;602:12;633:18;623:81;;689:4;681:6;677:17;667:27;;623:81;751:2;743:6;740:14;720:18;717:38;714:84;;770:18;;:::i;:::-;714:84;535:269;484:320;;;:::o;810:141::-;859:4;882:3;874:11;;905:3;902:1;895:14;939:4;936:1;926:18;918:26;;810:141;;;:::o;957:93::-;994:6;1041:2;1036;1029:5;1025:14;1021:23;1011:33;;957:93;;;:::o;1056:107::-;1100:8;1150:5;1144:4;1140:16;1119:37;;1056:107;;;;:::o;1169:393::-;1238:6;1288:1;1276:10;1272:18;1311:97;1341:66;1330:9;1311:97;:::i;:::-;1429:39;1459:8;1448:9;1429:39;:::i;:::-;1417:51;;1501:4;1497:9;1490:5;1486:21;1477:30;;1550:4;1540:8;1536:19;1529:5;1526:30;1516:40;;1245:317;;1169:393;;;;;:::o;1568:77::-;1605:7;1634:5;1623:16;;1568:77;;;:::o;1651:60::-;1679:3;1700:5;1693:12;;1651:60;;;:::o;1717:142::-;1767:9;1800:53;1818:34;1827:24;1845:5;1827:24;:::i;:::-;1818:34;:::i;:::-;1800:53;:::i;:::-;1787:66;;1717:142;;;:::o;1865:75::-;1908:3;1929:5;1922:12;;1865:75;;;:::o;1946:269::-;2056:39;2087:7;2056:39;:::i;:::-;2117:91;2166:41;2190:16;2166:41;:::i;:::-;2158:6;2151:4;2145:11;2117:91;:::i;:::-;2111:4;2104:105;2022:193;1946:269;;;:::o;2221:73::-;2266:3;2221:73;:::o;2300:189::-;2377:32;;:::i;:::-;2418:65;2476:6;2468;2462:4;2418:65;:::i;:::-;2353:136;2300:189;;:::o;2495:186::-;2555:120;2572:3;2565:5;2562:14;2555:120;;;2626:39;2663:1;2656:5;2626:39;:::i;:::-;2599:1;2592:5;2588:13;2579:22;;2555:120;;;2495:186;;:::o;2687:543::-;2788:2;2783:3;2780:11;2777:446;;;2822:38;2854:5;2822:38;:::i;:::-;2906:29;2924:10;2906:29;:::i;:::-;2896:8;2892:44;3089:2;3077:10;3074:18;3071:49;;;3110:8;3095:23;;3071:49;3133:80;3189:22;3207:3;3189:22;:::i;:::-;3179:8;3175:37;3162:11;3133:80;:::i;:::-;2792:431;;2777:446;2687:543;;;:::o;3236:117::-;3290:8;3340:5;3334:4;3330:16;3309:37;;3236:117;;;;:::o;3359:169::-;3403:6;3436:51;3484:1;3480:6;3472:5;3469:1;3465:13;3436:51;:::i;:::-;3432:56;3517:4;3511;3507:15;3497:25;;3410:118;3359:169;;;;:::o;3533:295::-;3609:4;3755:29;3780:3;3774:4;3755:29;:::i;:::-;3747:37;;3817:3;3814:1;3810:11;3804:4;3801:21;3793:29;;3533:295;;;;:::o;3833:1395::-;3950:37;3983:3;3950:37;:::i;:::-;4052:18;4044:6;4041:30;4038:56;;;4074:18;;:::i;:::-;4038:56;4118:38;4150:4;4144:11;4118:38;:::i;:::-;4203:67;4263:6;4255;4249:4;4203:67;:::i;:::-;4297:1;4321:4;4308:17;;4353:2;4345:6;4342:14;4370:1;4365:618;;;;5027:1;5044:6;5041:77;;;5093:9;5088:3;5084:19;5078:26;5069:35;;5041:77;5144:67;5204:6;5197:5;5144:67;:::i;:::-;5138:4;5131:81;5000:222;4335:887;;4365:618;4417:4;4413:9;4405:6;4401:22;4451:37;4483:4;4451:37;:::i;:::-;4510:1;4524:208;4538:7;4535:1;4532:14;4524:208;;;4617:9;4612:3;4608:19;4602:26;4594:6;4587:42;4668:1;4660:6;4656:14;4646:24;;4715:2;4704:9;4700:18;4687:31;;4561:4;4558:1;4554:12;4549:17;;4524:208;;;4760:6;4751:7;4748:19;4745:179;;;4818:9;4813:3;4809:19;4803:26;4861:48;4903:4;4895:6;4891:17;4880:9;4861:48;:::i;:::-;4853:6;4846:64;4768:156;4745:179;4970:1;4966;4958:6;4954:14;4950:22;4944:4;4937:36;4372:611;;;4335:887;;3925:1303;;;3833:1395;;:::o;120:82:4:-;;;;;;;" - }, - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "storageLayout": { - "storage": [ - { - "astId": 15, - "contract": "contract-2f654b501f.sol:ERC20Token", - "label": "_balances", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 21, - "contract": "contract-2f654b501f.sol:ERC20Token", - "label": "_allowances", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 23, - "contract": "contract-2f654b501f.sol:ERC20Token", - "label": "_totalSupply", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 25, - "contract": "contract-2f654b501f.sol:ERC20Token", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 27, - "contract": "contract-2f654b501f.sol:ERC20Token", - "label": "_symbol", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - }, - "web3Deploy": "var erc20tokenContract = new web3.eth.Contract([{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]);\nvar erc20token = erc20tokenContract.deploy({\n data: '0x60806040523480156200001157600080fd5b506040518060400160405280600a81526020017f4552433230546f6b656e000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f455243323000000000000000000000000000000000000000000000000000000081525081600390816200008f919062000324565b508060049081620000a1919062000324565b5050506200040b565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200012c57607f821691505b602082108103620001425762000141620000e4565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620001ac7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200016d565b620001b886836200016d565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000205620001ff620001f984620001d0565b620001da565b620001d0565b9050919050565b6000819050919050565b6200022183620001e4565b6200023962000230826200020c565b8484546200017a565b825550505050565b600090565b6200025062000241565b6200025d81848462000216565b505050565b5b8181101562000285576200027960008262000246565b60018101905062000263565b5050565b601f821115620002d4576200029e8162000148565b620002a9846200015d565b81016020851015620002b9578190505b620002d1620002c8856200015d565b83018262000262565b50505b505050565b600082821c905092915050565b6000620002f960001984600802620002d9565b1980831691505092915050565b6000620003148383620002e6565b9150826002028217905092915050565b6200032f82620000aa565b67ffffffffffffffff8111156200034b576200034a620000b5565b5b62000357825462000113565b6200036482828562000289565b600060209050601f8311600181146200039c576000841562000387578287015190505b62000393858262000306565b86555062000403565b601f198416620003ac8662000148565b60005b82811015620003d657848901518255600182019150602085019450602081019050620003af565b86831015620003f65784890151620003f2601f891682620002e6565b8355505b6001600288020188555050505b505050505050565b61122f806200041b6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea2646970667358221220d8197461cfcf76643d85773e2b13b928ad86533df5fdb26a8122e9a71272bcc364736f6c63430008120033', \n arguments: [\n ]\n}).send({\n from: web3.eth.accounts[0], \n gas: '4700000'\n }, function (e, contract){\n console.log(e, contract);\n if (typeof contract.address !== 'undefined') {\n console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);\n }\n })", - "functionHashes": { - "39509351": "increaseAllowance(address,uint256)", - "dd62ed3e": "allowance(address,address)", - "095ea7b3": "approve(address,uint256)", - "70a08231": "balanceOf(address)", - "313ce567": "decimals()", - "a457c2d7": "decreaseAllowance(address,uint256)", - "06fdde03": "name()", - "95d89b41": "symbol()", - "18160ddd": "totalSupply()", - "a9059cbb": "transfer(address,uint256)", - "23b872dd": "transferFrom(address,address,uint256)" - }, - "gasEstimates": { - "Creation": { - "codeDepositCost": "931000", - "executionCost": "infinite", - "totalCost": "infinite" - }, - "External": { - "allowance(address,address)": "infinite", - "approve(address,uint256)": "infinite", - "balanceOf(address)": "2863", - "decimals()": "432", - "decreaseAllowance(address,uint256)": "infinite", - "increaseAllowance(address,uint256)": "infinite", - "name()": "infinite", - "symbol()": "infinite", - "totalSupply()": "2482", - "transfer(address,uint256)": "infinite", - "transferFrom(address,address,uint256)": "infinite" - } - }, - "devdoc": { - "events": { - "Approval(address,address,uint256)": { - "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." - }, - "Transfer(address,address,uint256)": { - "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." - } - }, - "kind": "dev", - "methods": { - "allowance(address,address)": { - "details": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "decimals()": { - "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." - }, - "decreaseAllowance(address,uint256)": { - "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." - }, - "increaseAllowance(address,uint256)": { - "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." - }, - "name()": { - "details": "Returns the name of the token." - }, - "symbol()": { - "details": "Returns the symbol of the token, usually a shorter version of the name." - }, - "totalSupply()": { - "details": "See {IERC20-totalSupply}." - }, - "transfer(address,uint256)": { - "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "Runtime Bytecode": { - "functionDebugData": { - "@_afterTokenTransfer_585": { - "entryPoint": 2679, - "id": 585, - "parameterSlots": 3, - "returnSlots": 0 - }, - "@_approve_520": { - "entryPoint": 1447, - "id": 520, - "parameterSlots": 3, - "returnSlots": 0 - }, - "@_beforeTokenTransfer_574": { - "entryPoint": 2674, - "id": 574, - "parameterSlots": 3, - "returnSlots": 0 - }, - "@_msgSender_701": { - "entryPoint": 1439, - "id": 701, - "parameterSlots": 0, - "returnSlots": 1 - }, - "@_spendAllowance_563": { - "entryPoint": 1904, - "id": 563, - "parameterSlots": 3, - "returnSlots": 0 - }, - "@_transfer_346": { - "entryPoint": 2044, - "id": 346, - "parameterSlots": 3, - "returnSlots": 0 - }, - "@allowance_141": { - "entryPoint": 1304, - "id": 141, - "parameterSlots": 2, - "returnSlots": 1 - }, - "@approve_166": { - "entryPoint": 776, - "id": 166, - "parameterSlots": 2, - "returnSlots": 1 - }, - "@balanceOf_98": { - "entryPoint": 932, - "id": 98, - "parameterSlots": 1, - "returnSlots": 1 - }, - "@decimals_74": { - "entryPoint": 868, - "id": 74, - "parameterSlots": 0, - "returnSlots": 1 - }, - "@decreaseAllowance_269": { - "entryPoint": 1150, - "id": 269, - "parameterSlots": 2, - "returnSlots": 1 - }, - "@increaseAllowance_228": { - "entryPoint": 877, - "id": 228, - "parameterSlots": 2, - "returnSlots": 1 - }, - "@name_54": { - "entryPoint": 630, - "id": 54, - "parameterSlots": 0, - "returnSlots": 1 - }, - "@symbol_64": { - "entryPoint": 1004, - "id": 64, - "parameterSlots": 0, - "returnSlots": 1 - }, - "@totalSupply_84": { - "entryPoint": 811, - "id": 84, - "parameterSlots": 0, - "returnSlots": 1 - }, - "@transferFrom_199": { - "entryPoint": 821, - "id": 199, - "parameterSlots": 3, - "returnSlots": 1 - }, - "@transfer_123": { - "entryPoint": 1269, - "id": 123, - "parameterSlots": 2, - "returnSlots": 1 - }, - "abi_decode_t_address": { - "entryPoint": 2940, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "abi_decode_t_uint256": { - "entryPoint": 2994, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "abi_decode_tuple_t_address": { - "entryPoint": 3313, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "abi_decode_tuple_t_addresst_address": { - "entryPoint": 3358, - "id": null, - "parameterSlots": 2, - "returnSlots": 2 - }, - "abi_decode_tuple_t_addresst_addresst_uint256": { - "entryPoint": 3175, - "id": null, - "parameterSlots": 2, - "returnSlots": 3 - }, - "abi_decode_tuple_t_addresst_uint256": { - "entryPoint": 3015, - "id": null, - "parameterSlots": 2, - "returnSlots": 2 - }, - "abi_encode_t_bool_to_t_bool_fromStack": { - "entryPoint": 3091, - "id": null, - "parameterSlots": 2, - "returnSlots": 0 - }, - "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack": { - "entryPoint": 2771, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "abi_encode_t_stringliteral_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f_to_t_string_memory_ptr_fromStack": { - "entryPoint": 4388, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_t_stringliteral_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029_to_t_string_memory_ptr_fromStack": { - "entryPoint": 3988, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_t_stringliteral_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe_to_t_string_memory_ptr_fromStack": { - "entryPoint": 4096, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_t_stringliteral_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6_to_t_string_memory_ptr_fromStack": { - "entryPoint": 4534, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_t_stringliteral_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea_to_t_string_memory_ptr_fromStack": { - "entryPoint": 4242, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_t_stringliteral_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208_to_t_string_memory_ptr_fromStack": { - "entryPoint": 3842, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_t_stringliteral_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8_to_t_string_memory_ptr_fromStack": { - "entryPoint": 3696, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_t_uint256_to_t_uint256_fromStack": { - "entryPoint": 3133, - "id": null, - "parameterSlots": 2, - "returnSlots": 0 - }, - "abi_encode_t_uint8_to_t_uint8_fromStack": { - "entryPoint": 3271, - "id": null, - "parameterSlots": 2, - "returnSlots": 0 - }, - "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed": { - "entryPoint": 3106, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "abi_encode_tuple_t_string_memory_ptr__to_t_string_memory_ptr__fromStack_reversed": { - "entryPoint": 2828, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "abi_encode_tuple_t_stringliteral_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f__to_t_string_memory_ptr__fromStack_reversed": { - "entryPoint": 4423, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_tuple_t_stringliteral_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029__to_t_string_memory_ptr__fromStack_reversed": { - "entryPoint": 4023, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_tuple_t_stringliteral_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe__to_t_string_memory_ptr__fromStack_reversed": { - "entryPoint": 4131, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_tuple_t_stringliteral_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6__to_t_string_memory_ptr__fromStack_reversed": { - "entryPoint": 4569, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_tuple_t_stringliteral_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea__to_t_string_memory_ptr__fromStack_reversed": { - "entryPoint": 4277, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_tuple_t_stringliteral_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208__to_t_string_memory_ptr__fromStack_reversed": { - "entryPoint": 3877, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_tuple_t_stringliteral_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8__to_t_string_memory_ptr__fromStack_reversed": { - "entryPoint": 3731, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": { - "entryPoint": 3148, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "abi_encode_tuple_t_uint8__to_t_uint8__fromStack_reversed": { - "entryPoint": 3286, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "allocate_unbounded": { - "entryPoint": null, - "id": null, - "parameterSlots": 0, - "returnSlots": 1 - }, - "array_length_t_string_memory_ptr": { - "entryPoint": 2684, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "array_storeLengthForEncoding_t_string_memory_ptr_fromStack": { - "entryPoint": 2695, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "checked_add_t_uint256": { - "entryPoint": 3565, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 - }, - "cleanup_t_address": { - "entryPoint": 2899, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "cleanup_t_bool": { - "entryPoint": 3079, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "cleanup_t_uint160": { - "entryPoint": 2867, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "cleanup_t_uint256": { - "entryPoint": 2961, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "cleanup_t_uint8": { - "entryPoint": 3258, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "copy_memory_to_memory_with_cleanup": { - "entryPoint": 2712, - "id": null, - "parameterSlots": 3, - "returnSlots": 0 - }, - "extract_byte_array_length": { - "entryPoint": 3469, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "panic_error_0x11": { - "entryPoint": 3518, - "id": null, - "parameterSlots": 0, - "returnSlots": 0 - }, - "panic_error_0x22": { - "entryPoint": 3422, - "id": null, - "parameterSlots": 0, - "returnSlots": 0 - }, - "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": { - "entryPoint": null, - "id": null, - "parameterSlots": 0, - "returnSlots": 0 - }, - "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { - "entryPoint": 2862, - "id": null, - "parameterSlots": 0, - "returnSlots": 0 - }, - "round_up_to_mul_of_32": { - "entryPoint": 2754, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 - }, - "store_literal_in_memory_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f": { - "entryPoint": 4309, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - }, - "store_literal_in_memory_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029": { - "entryPoint": 3909, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - }, - "store_literal_in_memory_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe": { - "entryPoint": 4055, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - }, - "store_literal_in_memory_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6": { - "entryPoint": 4455, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - }, - "store_literal_in_memory_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea": { - "entryPoint": 4163, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - }, - "store_literal_in_memory_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208": { - "entryPoint": 3763, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - }, - "store_literal_in_memory_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8": { - "entryPoint": 3617, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - }, - "validator_revert_t_address": { - "entryPoint": 2917, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - }, - "validator_revert_t_uint256": { - "entryPoint": 2971, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - } - }, - "generatedSources": [ - { - "ast": { - "nodeType": "YulBlock", - "src": "0:13699:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "66:40:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "77:22:5", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "93:5:5" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "87:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "87:12:5" - }, - "variableNames": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "77:6:5" - } - ] - } - ] - }, - "name": "array_length_t_string_memory_ptr", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "49:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "length", - "nodeType": "YulTypedName", - "src": "59:6:5", - "type": "" - } - ], - "src": "7:99:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "208:73:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "225:3:5" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "230:6:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "218:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "218:19:5" - }, - "nodeType": "YulExpressionStatement", - "src": "218:19:5" - }, - { - "nodeType": "YulAssignment", - "src": "246:29:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "265:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "270:4:5", - "type": "", - "value": "0x20" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "261:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "261:14:5" - }, - "variableNames": [ - { - "name": "updated_pos", - "nodeType": "YulIdentifier", - "src": "246:11:5" - } - ] - } - ] - }, - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "180:3:5", - "type": "" - }, - { - "name": "length", - "nodeType": "YulTypedName", - "src": "185:6:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "updated_pos", - "nodeType": "YulTypedName", - "src": "196:11:5", - "type": "" - } - ], - "src": "112:169:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "349:184:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "359:10:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "368:1:5", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "i", - "nodeType": "YulTypedName", - "src": "363:1:5", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "428:63:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "dst", - "nodeType": "YulIdentifier", - "src": "453:3:5" - }, - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "458:1:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "449:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "449:11:5" - }, - { - "arguments": [ - { - "arguments": [ - { - "name": "src", - "nodeType": "YulIdentifier", - "src": "472:3:5" - }, - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "477:1:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "468:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "468:11:5" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "462:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "462:18:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "442:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "442:39:5" - }, - "nodeType": "YulExpressionStatement", - "src": "442:39:5" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "389:1:5" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "392:6:5" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "386:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "386:13:5" - }, - "nodeType": "YulForLoop", - "post": { - "nodeType": "YulBlock", - "src": "400:19:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "402:15:5", - "value": { - "arguments": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "411:1:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "414:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "407:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "407:10:5" - }, - "variableNames": [ - { - "name": "i", - "nodeType": "YulIdentifier", - "src": "402:1:5" - } - ] - } - ] - }, - "pre": { - "nodeType": "YulBlock", - "src": "382:3:5", - "statements": [] - }, - "src": "378:113:5" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "dst", - "nodeType": "YulIdentifier", - "src": "511:3:5" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "516:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "507:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "507:16:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "525:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "500:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "500:27:5" - }, - "nodeType": "YulExpressionStatement", - "src": "500:27:5" - } - ] - }, - "name": "copy_memory_to_memory_with_cleanup", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "src", - "nodeType": "YulTypedName", - "src": "331:3:5", - "type": "" - }, - { - "name": "dst", - "nodeType": "YulTypedName", - "src": "336:3:5", - "type": "" - }, - { - "name": "length", - "nodeType": "YulTypedName", - "src": "341:6:5", - "type": "" - } - ], - "src": "287:246:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "587:54:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "597:38:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "615:5:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "622:2:5", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "611:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "611:14:5" - }, - { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "631:2:5", - "type": "", - "value": "31" - } - ], - "functionName": { - "name": "not", - "nodeType": "YulIdentifier", - "src": "627:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "627:7:5" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "607:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "607:28:5" - }, - "variableNames": [ - { - "name": "result", - "nodeType": "YulIdentifier", - "src": "597:6:5" - } - ] - } - ] - }, - "name": "round_up_to_mul_of_32", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "570:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "result", - "nodeType": "YulTypedName", - "src": "580:6:5", - "type": "" - } - ], - "src": "539:102:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "739:285:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "749:53:5", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "796:5:5" - } - ], - "functionName": { - "name": "array_length_t_string_memory_ptr", - "nodeType": "YulIdentifier", - "src": "763:32:5" - }, - "nodeType": "YulFunctionCall", - "src": "763:39:5" - }, - "variables": [ - { - "name": "length", - "nodeType": "YulTypedName", - "src": "753:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "811:78:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "877:3:5" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "882:6:5" - } - ], - "functionName": { - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "818:58:5" - }, - "nodeType": "YulFunctionCall", - "src": "818:71:5" - }, - "variableNames": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "811:3:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "937:5:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "944:4:5", - "type": "", - "value": "0x20" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "933:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "933:16:5" - }, - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "951:3:5" - }, - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "956:6:5" - } - ], - "functionName": { - "name": "copy_memory_to_memory_with_cleanup", - "nodeType": "YulIdentifier", - "src": "898:34:5" - }, - "nodeType": "YulFunctionCall", - "src": "898:65:5" - }, - "nodeType": "YulExpressionStatement", - "src": "898:65:5" - }, - { - "nodeType": "YulAssignment", - "src": "972:46:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "983:3:5" - }, - { - "arguments": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "1010:6:5" - } - ], - "functionName": { - "name": "round_up_to_mul_of_32", - "nodeType": "YulIdentifier", - "src": "988:21:5" - }, - "nodeType": "YulFunctionCall", - "src": "988:29:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "979:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "979:39:5" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "972:3:5" - } - ] - } - ] - }, - "name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "720:5:5", - "type": "" - }, - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "727:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "735:3:5", - "type": "" - } - ], - "src": "647:377:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1148:195:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1158:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1170:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1181:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1166:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1166:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "1158:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1205:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1216:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "1201:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1201:17:5" - }, - { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "1224:4:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "1230:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "1220:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1220:20:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "1194:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "1194:47:5" - }, - "nodeType": "YulExpressionStatement", - "src": "1194:47:5" - }, - { - "nodeType": "YulAssignment", - "src": "1250:86:5", - "value": { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "1322:6:5" - }, - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "1331:4:5" - } - ], - "functionName": { - "name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "1258:63:5" - }, - "nodeType": "YulFunctionCall", - "src": "1258:78:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "1250:4:5" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_string_memory_ptr__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "1120:9:5", - "type": "" - }, - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "1132:6:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "1143:4:5", - "type": "" - } - ], - "src": "1030:313:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1389:35:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1399:19:5", - "value": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1415:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "1409:5:5" - }, - "nodeType": "YulFunctionCall", - "src": "1409:9:5" - }, - "variableNames": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "1399:6:5" - } - ] - } - ] - }, - "name": "allocate_unbounded", - "nodeType": "YulFunctionDefinition", - "returnVariables": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "1382:6:5", - "type": "" - } - ], - "src": "1349:75:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1519:28:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1536:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1539:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "1529:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "1529:12:5" - }, - "nodeType": "YulExpressionStatement", - "src": "1529:12:5" - } - ] - }, - "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", - "nodeType": "YulFunctionDefinition", - "src": "1430:117:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1642:28:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1659:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1662:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "1652:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "1652:12:5" - }, - "nodeType": "YulExpressionStatement", - "src": "1652:12:5" - } - ] - }, - "name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db", - "nodeType": "YulFunctionDefinition", - "src": "1553:117:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1721:81:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1731:65:5", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1746:5:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1753:42:5", - "type": "", - "value": "0xffffffffffffffffffffffffffffffffffffffff" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "1742:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "1742:54:5" - }, - "variableNames": [ - { - "name": "cleaned", - "nodeType": "YulIdentifier", - "src": "1731:7:5" - } - ] - } - ] - }, - "name": "cleanup_t_uint160", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1703:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "cleaned", - "nodeType": "YulTypedName", - "src": "1713:7:5", - "type": "" - } - ], - "src": "1676:126:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1853:51:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "1863:35:5", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1892:5:5" - } - ], - "functionName": { - "name": "cleanup_t_uint160", - "nodeType": "YulIdentifier", - "src": "1874:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "1874:24:5" - }, - "variableNames": [ - { - "name": "cleaned", - "nodeType": "YulIdentifier", - "src": "1863:7:5" - } - ] - } - ] - }, - "name": "cleanup_t_address", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1835:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "cleaned", - "nodeType": "YulTypedName", - "src": "1845:7:5", - "type": "" - } - ], - "src": "1808:96:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1953:79:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "2010:16:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2019:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2022:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "2012:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "2012:12:5" - }, - "nodeType": "YulExpressionStatement", - "src": "2012:12:5" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1976:5:5" - }, - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2001:5:5" - } - ], - "functionName": { - "name": "cleanup_t_address", - "nodeType": "YulIdentifier", - "src": "1983:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "1983:24:5" - } - ], - "functionName": { - "name": "eq", - "nodeType": "YulIdentifier", - "src": "1973:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "1973:35:5" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "1966:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "1966:43:5" - }, - "nodeType": "YulIf", - "src": "1963:63:5" - } - ] - }, - "name": "validator_revert_t_address", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1946:5:5", - "type": "" - } - ], - "src": "1910:122:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2090:87:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "2100:29:5", - "value": { - "arguments": [ - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "2122:6:5" - } - ], - "functionName": { - "name": "calldataload", - "nodeType": "YulIdentifier", - "src": "2109:12:5" - }, - "nodeType": "YulFunctionCall", - "src": "2109:20:5" - }, - "variableNames": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2100:5:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2165:5:5" - } - ], - "functionName": { - "name": "validator_revert_t_address", - "nodeType": "YulIdentifier", - "src": "2138:26:5" - }, - "nodeType": "YulFunctionCall", - "src": "2138:33:5" - }, - "nodeType": "YulExpressionStatement", - "src": "2138:33:5" - } - ] - }, - "name": "abi_decode_t_address", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "2068:6:5", - "type": "" - }, - { - "name": "end", - "nodeType": "YulTypedName", - "src": "2076:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "2084:5:5", - "type": "" - } - ], - "src": "2038:139:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2228:32:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "2238:16:5", - "value": { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2249:5:5" - }, - "variableNames": [ - { - "name": "cleaned", - "nodeType": "YulIdentifier", - "src": "2238:7:5" - } - ] - } - ] - }, - "name": "cleanup_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "2210:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "cleaned", - "nodeType": "YulTypedName", - "src": "2220:7:5", - "type": "" - } - ], - "src": "2183:77:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2309:79:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "2366:16:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2375:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2378:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "2368:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "2368:12:5" - }, - "nodeType": "YulExpressionStatement", - "src": "2368:12:5" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2332:5:5" - }, - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2357:5:5" - } - ], - "functionName": { - "name": "cleanup_t_uint256", - "nodeType": "YulIdentifier", - "src": "2339:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "2339:24:5" - } - ], - "functionName": { - "name": "eq", - "nodeType": "YulIdentifier", - "src": "2329:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "2329:35:5" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "2322:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "2322:43:5" - }, - "nodeType": "YulIf", - "src": "2319:63:5" - } - ] - }, - "name": "validator_revert_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "2302:5:5", - "type": "" - } - ], - "src": "2266:122:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2446:87:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "2456:29:5", - "value": { - "arguments": [ - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "2478:6:5" - } - ], - "functionName": { - "name": "calldataload", - "nodeType": "YulIdentifier", - "src": "2465:12:5" - }, - "nodeType": "YulFunctionCall", - "src": "2465:20:5" - }, - "variableNames": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2456:5:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "2521:5:5" - } - ], - "functionName": { - "name": "validator_revert_t_uint256", - "nodeType": "YulIdentifier", - "src": "2494:26:5" - }, - "nodeType": "YulFunctionCall", - "src": "2494:33:5" - }, - "nodeType": "YulExpressionStatement", - "src": "2494:33:5" - } - ] - }, - "name": "abi_decode_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "2424:6:5", - "type": "" - }, - { - "name": "end", - "nodeType": "YulTypedName", - "src": "2432:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "2440:5:5", - "type": "" - } - ], - "src": "2394:139:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "2622:391:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "2668:83:5", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", - "nodeType": "YulIdentifier", - "src": "2670:77:5" - }, - "nodeType": "YulFunctionCall", - "src": "2670:79:5" - }, - "nodeType": "YulExpressionStatement", - "src": "2670:79:5" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "2643:7:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2652:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "2639:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "2639:23:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2664:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "2635:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "2635:32:5" - }, - "nodeType": "YulIf", - "src": "2632:119:5" - }, - { - "nodeType": "YulBlock", - "src": "2761:117:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "2776:15:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2790:1:5", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "2780:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "2805:63:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2840:9:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "2851:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2836:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "2836:22:5" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "2860:7:5" - } - ], - "functionName": { - "name": "abi_decode_t_address", - "nodeType": "YulIdentifier", - "src": "2815:20:5" - }, - "nodeType": "YulFunctionCall", - "src": "2815:53:5" - }, - "variableNames": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "2805:6:5" - } - ] - } - ] - }, - { - "nodeType": "YulBlock", - "src": "2888:118:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "2903:16:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "2917:2:5", - "type": "", - "value": "32" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "2907:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "2933:63:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "2968:9:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "2979:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "2964:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "2964:22:5" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "2988:7:5" - } - ], - "functionName": { - "name": "abi_decode_t_uint256", - "nodeType": "YulIdentifier", - "src": "2943:20:5" - }, - "nodeType": "YulFunctionCall", - "src": "2943:53:5" - }, - "variableNames": [ - { - "name": "value1", - "nodeType": "YulIdentifier", - "src": "2933:6:5" - } - ] - } - ] - } - ] - }, - "name": "abi_decode_tuple_t_addresst_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "2584:9:5", - "type": "" - }, - { - "name": "dataEnd", - "nodeType": "YulTypedName", - "src": "2595:7:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "2607:6:5", - "type": "" - }, - { - "name": "value1", - "nodeType": "YulTypedName", - "src": "2615:6:5", - "type": "" - } - ], - "src": "2539:474:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3061:48:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "3071:32:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "3096:5:5" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "3089:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "3089:13:5" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "3082:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "3082:21:5" - }, - "variableNames": [ - { - "name": "cleaned", - "nodeType": "YulIdentifier", - "src": "3071:7:5" - } - ] - } - ] - }, - "name": "cleanup_t_bool", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "3043:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "cleaned", - "nodeType": "YulTypedName", - "src": "3053:7:5", - "type": "" - } - ], - "src": "3019:90:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3174:50:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "3191:3:5" - }, - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "3211:5:5" - } - ], - "functionName": { - "name": "cleanup_t_bool", - "nodeType": "YulIdentifier", - "src": "3196:14:5" - }, - "nodeType": "YulFunctionCall", - "src": "3196:21:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "3184:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "3184:34:5" - }, - "nodeType": "YulExpressionStatement", - "src": "3184:34:5" - } - ] - }, - "name": "abi_encode_t_bool_to_t_bool_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "3162:5:5", - "type": "" - }, - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "3169:3:5", - "type": "" - } - ], - "src": "3115:109:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3322:118:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "3332:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3344:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3355:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3340:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3340:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "3332:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "3406:6:5" - }, - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3419:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3430:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3415:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3415:17:5" - } - ], - "functionName": { - "name": "abi_encode_t_bool_to_t_bool_fromStack", - "nodeType": "YulIdentifier", - "src": "3368:37:5" - }, - "nodeType": "YulFunctionCall", - "src": "3368:65:5" - }, - "nodeType": "YulExpressionStatement", - "src": "3368:65:5" - } - ] - }, - "name": "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "3294:9:5", - "type": "" - }, - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "3306:6:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "3317:4:5", - "type": "" - } - ], - "src": "3230:210:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3511:53:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "3528:3:5" - }, - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "3551:5:5" - } - ], - "functionName": { - "name": "cleanup_t_uint256", - "nodeType": "YulIdentifier", - "src": "3533:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "3533:24:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "3521:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "3521:37:5" - }, - "nodeType": "YulExpressionStatement", - "src": "3521:37:5" - } - ] - }, - "name": "abi_encode_t_uint256_to_t_uint256_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "3499:5:5", - "type": "" - }, - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "3506:3:5", - "type": "" - } - ], - "src": "3446:118:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3668:124:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "3678:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3690:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3701:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3686:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3686:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "3678:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "3758:6:5" - }, - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3771:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3782:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "3767:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3767:17:5" - } - ], - "functionName": { - "name": "abi_encode_t_uint256_to_t_uint256_fromStack", - "nodeType": "YulIdentifier", - "src": "3714:43:5" - }, - "nodeType": "YulFunctionCall", - "src": "3714:71:5" - }, - "nodeType": "YulExpressionStatement", - "src": "3714:71:5" - } - ] - }, - "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "3640:9:5", - "type": "" - }, - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "3652:6:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "3663:4:5", - "type": "" - } - ], - "src": "3570:222:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "3898:519:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "3944:83:5", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", - "nodeType": "YulIdentifier", - "src": "3946:77:5" - }, - "nodeType": "YulFunctionCall", - "src": "3946:79:5" - }, - "nodeType": "YulExpressionStatement", - "src": "3946:79:5" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "3919:7:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "3928:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "3915:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3915:23:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "3940:2:5", - "type": "", - "value": "96" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "3911:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "3911:32:5" - }, - "nodeType": "YulIf", - "src": "3908:119:5" - }, - { - "nodeType": "YulBlock", - "src": "4037:117:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "4052:15:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4066:1:5", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "4056:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "4081:63:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4116:9:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "4127:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4112:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4112:22:5" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "4136:7:5" - } - ], - "functionName": { - "name": "abi_decode_t_address", - "nodeType": "YulIdentifier", - "src": "4091:20:5" - }, - "nodeType": "YulFunctionCall", - "src": "4091:53:5" - }, - "variableNames": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "4081:6:5" - } - ] - } - ] - }, - { - "nodeType": "YulBlock", - "src": "4164:118:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "4179:16:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4193:2:5", - "type": "", - "value": "32" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "4183:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "4209:63:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4244:9:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "4255:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4240:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4240:22:5" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "4264:7:5" - } - ], - "functionName": { - "name": "abi_decode_t_address", - "nodeType": "YulIdentifier", - "src": "4219:20:5" - }, - "nodeType": "YulFunctionCall", - "src": "4219:53:5" - }, - "variableNames": [ - { - "name": "value1", - "nodeType": "YulIdentifier", - "src": "4209:6:5" - } - ] - } - ] - }, - { - "nodeType": "YulBlock", - "src": "4292:118:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "4307:16:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4321:2:5", - "type": "", - "value": "64" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "4311:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "4337:63:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4372:9:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "4383:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4368:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4368:22:5" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "4392:7:5" - } - ], - "functionName": { - "name": "abi_decode_t_uint256", - "nodeType": "YulIdentifier", - "src": "4347:20:5" - }, - "nodeType": "YulFunctionCall", - "src": "4347:53:5" - }, - "variableNames": [ - { - "name": "value2", - "nodeType": "YulIdentifier", - "src": "4337:6:5" - } - ] - } - ] - } - ] - }, - "name": "abi_decode_tuple_t_addresst_addresst_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "3852:9:5", - "type": "" - }, - { - "name": "dataEnd", - "nodeType": "YulTypedName", - "src": "3863:7:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "3875:6:5", - "type": "" - }, - { - "name": "value1", - "nodeType": "YulTypedName", - "src": "3883:6:5", - "type": "" - }, - { - "name": "value2", - "nodeType": "YulTypedName", - "src": "3891:6:5", - "type": "" - } - ], - "src": "3798:619:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4466:43:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "4476:27:5", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "4491:5:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4498:4:5", - "type": "", - "value": "0xff" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "4487:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4487:16:5" - }, - "variableNames": [ - { - "name": "cleaned", - "nodeType": "YulIdentifier", - "src": "4476:7:5" - } - ] - } - ] - }, - "name": "cleanup_t_uint8", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "4448:5:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "cleaned", - "nodeType": "YulTypedName", - "src": "4458:7:5", - "type": "" - } - ], - "src": "4423:86:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4576:51:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "4593:3:5" - }, - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "4614:5:5" - } - ], - "functionName": { - "name": "cleanup_t_uint8", - "nodeType": "YulIdentifier", - "src": "4598:15:5" - }, - "nodeType": "YulFunctionCall", - "src": "4598:22:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "4586:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "4586:35:5" - }, - "nodeType": "YulExpressionStatement", - "src": "4586:35:5" - } - ] - }, - "name": "abi_encode_t_uint8_to_t_uint8_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "4564:5:5", - "type": "" - }, - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "4571:3:5", - "type": "" - } - ], - "src": "4515:112:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4727:120:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "4737:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4749:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4760:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4745:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4745:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "4737:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "4813:6:5" - }, - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4826:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4837:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "4822:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4822:17:5" - } - ], - "functionName": { - "name": "abi_encode_t_uint8_to_t_uint8_fromStack", - "nodeType": "YulIdentifier", - "src": "4773:39:5" - }, - "nodeType": "YulFunctionCall", - "src": "4773:67:5" - }, - "nodeType": "YulExpressionStatement", - "src": "4773:67:5" - } - ] - }, - "name": "abi_encode_tuple_t_uint8__to_t_uint8__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "4699:9:5", - "type": "" - }, - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "4711:6:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "4722:4:5", - "type": "" - } - ], - "src": "4633:214:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "4919:263:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "4965:83:5", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", - "nodeType": "YulIdentifier", - "src": "4967:77:5" - }, - "nodeType": "YulFunctionCall", - "src": "4967:79:5" - }, - "nodeType": "YulExpressionStatement", - "src": "4967:79:5" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "4940:7:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "4949:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "4936:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4936:23:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "4961:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "4932:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "4932:32:5" - }, - "nodeType": "YulIf", - "src": "4929:119:5" - }, - { - "nodeType": "YulBlock", - "src": "5058:117:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "5073:15:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5087:1:5", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "5077:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "5102:63:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5137:9:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "5148:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5133:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "5133:22:5" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "5157:7:5" - } - ], - "functionName": { - "name": "abi_decode_t_address", - "nodeType": "YulIdentifier", - "src": "5112:20:5" - }, - "nodeType": "YulFunctionCall", - "src": "5112:53:5" - }, - "variableNames": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "5102:6:5" - } - ] - } - ] - } - ] - }, - "name": "abi_decode_tuple_t_address", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "4889:9:5", - "type": "" - }, - { - "name": "dataEnd", - "nodeType": "YulTypedName", - "src": "4900:7:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "4912:6:5", - "type": "" - } - ], - "src": "4853:329:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "5271:391:5", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "5317:83:5", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", - "nodeType": "YulIdentifier", - "src": "5319:77:5" - }, - "nodeType": "YulFunctionCall", - "src": "5319:79:5" - }, - "nodeType": "YulExpressionStatement", - "src": "5319:79:5" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "5292:7:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5301:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "5288:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "5288:23:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5313:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "5284:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "5284:32:5" - }, - "nodeType": "YulIf", - "src": "5281:119:5" - }, - { - "nodeType": "YulBlock", - "src": "5410:117:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "5425:15:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5439:1:5", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "5429:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "5454:63:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5489:9:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "5500:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5485:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "5485:22:5" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "5509:7:5" - } - ], - "functionName": { - "name": "abi_decode_t_address", - "nodeType": "YulIdentifier", - "src": "5464:20:5" - }, - "nodeType": "YulFunctionCall", - "src": "5464:53:5" - }, - "variableNames": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "5454:6:5" - } - ] - } - ] - }, - { - "nodeType": "YulBlock", - "src": "5537:118:5", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "5552:16:5", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5566:2:5", - "type": "", - "value": "32" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "5556:6:5", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "5582:63:5", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "5617:9:5" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "5628:6:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "5613:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "5613:22:5" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "5637:7:5" - } - ], - "functionName": { - "name": "abi_decode_t_address", - "nodeType": "YulIdentifier", - "src": "5592:20:5" - }, - "nodeType": "YulFunctionCall", - "src": "5592:53:5" - }, - "variableNames": [ - { - "name": "value1", - "nodeType": "YulIdentifier", - "src": "5582:6:5" - } - ] - } - ] - } - ] - }, - "name": "abi_decode_tuple_t_addresst_address", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "5233:9:5", - "type": "" - }, - { - "name": "dataEnd", - "nodeType": "YulTypedName", - "src": "5244:7:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "5256:6:5", - "type": "" - }, - { - "name": "value1", - "nodeType": "YulTypedName", - "src": "5264:6:5", - "type": "" - } - ], - "src": "5188:474:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "5696:152:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5713:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5716:77:5", - "type": "", - "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5706:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "5706:88:5" - }, - "nodeType": "YulExpressionStatement", - "src": "5706:88:5" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5810:1:5", - "type": "", - "value": "4" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5813:4:5", - "type": "", - "value": "0x22" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "5803:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "5803:15:5" - }, - "nodeType": "YulExpressionStatement", - "src": "5803:15:5" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5834:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5837:4:5", - "type": "", - "value": "0x24" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "5827:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "5827:15:5" - }, - "nodeType": "YulExpressionStatement", - "src": "5827:15:5" - } - ] - }, - "name": "panic_error_0x22", - "nodeType": "YulFunctionDefinition", - "src": "5668:180:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "5905:269:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "5915:22:5", - "value": { - "arguments": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "5929:4:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5935:1:5", - "type": "", - "value": "2" - } - ], - "functionName": { - "name": "div", - "nodeType": "YulIdentifier", - "src": "5925:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "5925:12:5" - }, - "variableNames": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "5915:6:5" - } - ] - }, - { - "nodeType": "YulVariableDeclaration", - "src": "5946:38:5", - "value": { - "arguments": [ - { - "name": "data", - "nodeType": "YulIdentifier", - "src": "5976:4:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "5982:1:5", - "type": "", - "value": "1" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "5972:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "5972:12:5" - }, - "variables": [ - { - "name": "outOfPlaceEncoding", - "nodeType": "YulTypedName", - "src": "5950:18:5", - "type": "" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "6023:51:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "6037:27:5", - "value": { - "arguments": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "6051:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6059:4:5", - "type": "", - "value": "0x7f" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "6047:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "6047:17:5" - }, - "variableNames": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "6037:6:5" - } - ] - } - ] - }, - "condition": { - "arguments": [ - { - "name": "outOfPlaceEncoding", - "nodeType": "YulIdentifier", - "src": "6003:18:5" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "5996:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "5996:26:5" - }, - "nodeType": "YulIf", - "src": "5993:81:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "6126:42:5", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "panic_error_0x22", - "nodeType": "YulIdentifier", - "src": "6140:16:5" - }, - "nodeType": "YulFunctionCall", - "src": "6140:18:5" - }, - "nodeType": "YulExpressionStatement", - "src": "6140:18:5" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "outOfPlaceEncoding", - "nodeType": "YulIdentifier", - "src": "6090:18:5" - }, - { - "arguments": [ - { - "name": "length", - "nodeType": "YulIdentifier", - "src": "6113:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6121:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "lt", - "nodeType": "YulIdentifier", - "src": "6110:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "6110:14:5" - } - ], - "functionName": { - "name": "eq", - "nodeType": "YulIdentifier", - "src": "6087:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "6087:38:5" - }, - "nodeType": "YulIf", - "src": "6084:84:5" - } - ] - }, - "name": "extract_byte_array_length", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "data", - "nodeType": "YulTypedName", - "src": "5889:4:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "length", - "nodeType": "YulTypedName", - "src": "5898:6:5", - "type": "" - } - ], - "src": "5854:320:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "6208:152:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6225:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6228:77:5", - "type": "", - "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "6218:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "6218:88:5" - }, - "nodeType": "YulExpressionStatement", - "src": "6218:88:5" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6322:1:5", - "type": "", - "value": "4" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6325:4:5", - "type": "", - "value": "0x11" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "6315:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "6315:15:5" - }, - "nodeType": "YulExpressionStatement", - "src": "6315:15:5" - }, - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6346:1:5", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6349:4:5", - "type": "", - "value": "0x24" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "6339:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "6339:15:5" - }, - "nodeType": "YulExpressionStatement", - "src": "6339:15:5" - } - ] - }, - "name": "panic_error_0x11", - "nodeType": "YulFunctionDefinition", - "src": "6180:180:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "6410:147:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "6420:25:5", - "value": { - "arguments": [ - { - "name": "x", - "nodeType": "YulIdentifier", - "src": "6443:1:5" - } - ], - "functionName": { - "name": "cleanup_t_uint256", - "nodeType": "YulIdentifier", - "src": "6425:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "6425:20:5" - }, - "variableNames": [ - { - "name": "x", - "nodeType": "YulIdentifier", - "src": "6420:1:5" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "6454:25:5", - "value": { - "arguments": [ - { - "name": "y", - "nodeType": "YulIdentifier", - "src": "6477:1:5" - } - ], - "functionName": { - "name": "cleanup_t_uint256", - "nodeType": "YulIdentifier", - "src": "6459:17:5" - }, - "nodeType": "YulFunctionCall", - "src": "6459:20:5" - }, - "variableNames": [ - { - "name": "y", - "nodeType": "YulIdentifier", - "src": "6454:1:5" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "6488:16:5", - "value": { - "arguments": [ - { - "name": "x", - "nodeType": "YulIdentifier", - "src": "6499:1:5" - }, - { - "name": "y", - "nodeType": "YulIdentifier", - "src": "6502:1:5" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "6495:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "6495:9:5" - }, - "variableNames": [ - { - "name": "sum", - "nodeType": "YulIdentifier", - "src": "6488:3:5" - } - ] - }, - { - "body": { - "nodeType": "YulBlock", - "src": "6528:22:5", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "panic_error_0x11", - "nodeType": "YulIdentifier", - "src": "6530:16:5" - }, - "nodeType": "YulFunctionCall", - "src": "6530:18:5" - }, - "nodeType": "YulExpressionStatement", - "src": "6530:18:5" - } - ] - }, - "condition": { - "arguments": [ - { - "name": "x", - "nodeType": "YulIdentifier", - "src": "6520:1:5" - }, - { - "name": "sum", - "nodeType": "YulIdentifier", - "src": "6523:3:5" - } - ], - "functionName": { - "name": "gt", - "nodeType": "YulIdentifier", - "src": "6517:2:5" - }, - "nodeType": "YulFunctionCall", - "src": "6517:10:5" - }, - "nodeType": "YulIf", - "src": "6514:36:5" - } - ] - }, - "name": "checked_add_t_uint256", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "x", - "nodeType": "YulTypedName", - "src": "6397:1:5", - "type": "" - }, - { - "name": "y", - "nodeType": "YulTypedName", - "src": "6400:1:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "sum", - "nodeType": "YulTypedName", - "src": "6406:3:5", - "type": "" - } - ], - "src": "6366:191:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "6669:118:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "6691:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6699:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "6687:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "6687:14:5" - }, - { - "hexValue": "45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77", - "kind": "string", - "nodeType": "YulLiteral", - "src": "6703:34:5", - "type": "", - "value": "ERC20: decreased allowance below" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "6680:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "6680:58:5" - }, - "nodeType": "YulExpressionStatement", - "src": "6680:58:5" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "6759:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "6767:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "6755:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "6755:15:5" - }, - { - "hexValue": "207a65726f", - "kind": "string", - "nodeType": "YulLiteral", - "src": "6772:7:5", - "type": "", - "value": " zero" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "6748:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "6748:32:5" - }, - "nodeType": "YulExpressionStatement", - "src": "6748:32:5" - } - ] - }, - "name": "store_literal_in_memory_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "6661:6:5", - "type": "" - } - ], - "src": "6563:224:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "6939:220:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "6949:74:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "7015:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "7020:2:5", - "type": "", - "value": "37" - } - ], - "functionName": { - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "6956:58:5" - }, - "nodeType": "YulFunctionCall", - "src": "6956:67:5" - }, - "variableNames": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "6949:3:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "7121:3:5" - } - ], - "functionName": { - "name": "store_literal_in_memory_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8", - "nodeType": "YulIdentifier", - "src": "7032:88:5" - }, - "nodeType": "YulFunctionCall", - "src": "7032:93:5" - }, - "nodeType": "YulExpressionStatement", - "src": "7032:93:5" - }, - { - "nodeType": "YulAssignment", - "src": "7134:19:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "7145:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "7150:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "7141:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "7141:12:5" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "7134:3:5" - } - ] - } - ] - }, - "name": "abi_encode_t_stringliteral_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8_to_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "6927:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "6935:3:5", - "type": "" - } - ], - "src": "6793:366:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "7336:248:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "7346:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "7358:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "7369:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "7354:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "7354:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "7346:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "7393:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "7404:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "7389:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "7389:17:5" - }, - { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "7412:4:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "7418:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "7408:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "7408:20:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "7382:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "7382:47:5" - }, - "nodeType": "YulExpressionStatement", - "src": "7382:47:5" - }, - { - "nodeType": "YulAssignment", - "src": "7438:139:5", - "value": { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "7572:4:5" - } - ], - "functionName": { - "name": "abi_encode_t_stringliteral_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8_to_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "7446:124:5" - }, - "nodeType": "YulFunctionCall", - "src": "7446:131:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "7438:4:5" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "7316:9:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "7331:4:5", - "type": "" - } - ], - "src": "7165:419:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "7696:117:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "7718:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "7726:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "7714:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "7714:14:5" - }, - { - "hexValue": "45524332303a20617070726f76652066726f6d20746865207a65726f20616464", - "kind": "string", - "nodeType": "YulLiteral", - "src": "7730:34:5", - "type": "", - "value": "ERC20: approve from the zero add" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "7707:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "7707:58:5" - }, - "nodeType": "YulExpressionStatement", - "src": "7707:58:5" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "7786:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "7794:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "7782:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "7782:15:5" - }, - { - "hexValue": "72657373", - "kind": "string", - "nodeType": "YulLiteral", - "src": "7799:6:5", - "type": "", - "value": "ress" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "7775:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "7775:31:5" - }, - "nodeType": "YulExpressionStatement", - "src": "7775:31:5" - } - ] - }, - "name": "store_literal_in_memory_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "7688:6:5", - "type": "" - } - ], - "src": "7590:223:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "7965:220:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "7975:74:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "8041:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "8046:2:5", - "type": "", - "value": "36" - } - ], - "functionName": { - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "7982:58:5" - }, - "nodeType": "YulFunctionCall", - "src": "7982:67:5" - }, - "variableNames": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "7975:3:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "8147:3:5" - } - ], - "functionName": { - "name": "store_literal_in_memory_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208", - "nodeType": "YulIdentifier", - "src": "8058:88:5" - }, - "nodeType": "YulFunctionCall", - "src": "8058:93:5" - }, - "nodeType": "YulExpressionStatement", - "src": "8058:93:5" - }, - { - "nodeType": "YulAssignment", - "src": "8160:19:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "8171:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "8176:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "8167:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "8167:12:5" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "8160:3:5" - } - ] - } - ] - }, - "name": "abi_encode_t_stringliteral_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208_to_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "7953:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "7961:3:5", - "type": "" - } - ], - "src": "7819:366:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "8362:248:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "8372:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "8384:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "8395:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "8380:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "8380:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "8372:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "8419:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "8430:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "8415:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "8415:17:5" - }, - { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "8438:4:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "8444:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "8434:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "8434:20:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "8408:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "8408:47:5" - }, - "nodeType": "YulExpressionStatement", - "src": "8408:47:5" - }, - { - "nodeType": "YulAssignment", - "src": "8464:139:5", - "value": { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "8598:4:5" - } - ], - "functionName": { - "name": "abi_encode_t_stringliteral_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208_to_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "8472:124:5" - }, - "nodeType": "YulFunctionCall", - "src": "8472:131:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "8464:4:5" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "8342:9:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "8357:4:5", - "type": "" - } - ], - "src": "8191:419:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "8722:115:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "8744:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "8752:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "8740:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "8740:14:5" - }, - { - "hexValue": "45524332303a20617070726f766520746f20746865207a65726f206164647265", - "kind": "string", - "nodeType": "YulLiteral", - "src": "8756:34:5", - "type": "", - "value": "ERC20: approve to the zero addre" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "8733:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "8733:58:5" - }, - "nodeType": "YulExpressionStatement", - "src": "8733:58:5" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "8812:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "8820:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "8808:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "8808:15:5" - }, - { - "hexValue": "7373", - "kind": "string", - "nodeType": "YulLiteral", - "src": "8825:4:5", - "type": "", - "value": "ss" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "8801:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "8801:29:5" - }, - "nodeType": "YulExpressionStatement", - "src": "8801:29:5" - } - ] - }, - "name": "store_literal_in_memory_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "8714:6:5", - "type": "" - } - ], - "src": "8616:221:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "8989:220:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "8999:74:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "9065:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "9070:2:5", - "type": "", - "value": "34" - } - ], - "functionName": { - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "9006:58:5" - }, - "nodeType": "YulFunctionCall", - "src": "9006:67:5" - }, - "variableNames": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "8999:3:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "9171:3:5" - } - ], - "functionName": { - "name": "store_literal_in_memory_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029", - "nodeType": "YulIdentifier", - "src": "9082:88:5" - }, - "nodeType": "YulFunctionCall", - "src": "9082:93:5" - }, - "nodeType": "YulExpressionStatement", - "src": "9082:93:5" - }, - { - "nodeType": "YulAssignment", - "src": "9184:19:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "9195:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "9200:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "9191:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "9191:12:5" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "9184:3:5" - } - ] - } - ] - }, - "name": "abi_encode_t_stringliteral_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029_to_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "8977:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "8985:3:5", - "type": "" - } - ], - "src": "8843:366:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "9386:248:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "9396:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "9408:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "9419:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "9404:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "9404:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "9396:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "9443:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "9454:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "9439:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "9439:17:5" - }, - { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "9462:4:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "9468:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "9458:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "9458:20:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "9432:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "9432:47:5" - }, - "nodeType": "YulExpressionStatement", - "src": "9432:47:5" - }, - { - "nodeType": "YulAssignment", - "src": "9488:139:5", - "value": { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "9622:4:5" - } - ], - "functionName": { - "name": "abi_encode_t_stringliteral_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029_to_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "9496:124:5" - }, - "nodeType": "YulFunctionCall", - "src": "9496:131:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "9488:4:5" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "9366:9:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "9381:4:5", - "type": "" - } - ], - "src": "9215:419:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "9746:73:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "9768:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "9776:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "9764:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "9764:14:5" - }, - { - "hexValue": "45524332303a20696e73756666696369656e7420616c6c6f77616e6365", - "kind": "string", - "nodeType": "YulLiteral", - "src": "9780:31:5", - "type": "", - "value": "ERC20: insufficient allowance" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "9757:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "9757:55:5" - }, - "nodeType": "YulExpressionStatement", - "src": "9757:55:5" - } - ] - }, - "name": "store_literal_in_memory_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "9738:6:5", - "type": "" - } - ], - "src": "9640:179:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "9971:220:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "9981:74:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "10047:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "10052:2:5", - "type": "", - "value": "29" - } - ], - "functionName": { - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "9988:58:5" - }, - "nodeType": "YulFunctionCall", - "src": "9988:67:5" - }, - "variableNames": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "9981:3:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "10153:3:5" - } - ], - "functionName": { - "name": "store_literal_in_memory_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe", - "nodeType": "YulIdentifier", - "src": "10064:88:5" - }, - "nodeType": "YulFunctionCall", - "src": "10064:93:5" - }, - "nodeType": "YulExpressionStatement", - "src": "10064:93:5" - }, - { - "nodeType": "YulAssignment", - "src": "10166:19:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "10177:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "10182:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "10173:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "10173:12:5" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "10166:3:5" - } - ] - } - ] - }, - "name": "abi_encode_t_stringliteral_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe_to_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "9959:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "9967:3:5", - "type": "" - } - ], - "src": "9825:366:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "10368:248:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "10378:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "10390:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "10401:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "10386:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "10386:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "10378:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "10425:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "10436:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "10421:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "10421:17:5" - }, - { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "10444:4:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "10450:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "10440:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "10440:20:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "10414:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "10414:47:5" - }, - "nodeType": "YulExpressionStatement", - "src": "10414:47:5" - }, - { - "nodeType": "YulAssignment", - "src": "10470:139:5", - "value": { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "10604:4:5" - } - ], - "functionName": { - "name": "abi_encode_t_stringliteral_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe_to_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "10478:124:5" - }, - "nodeType": "YulFunctionCall", - "src": "10478:131:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "10470:4:5" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "10348:9:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "10363:4:5", - "type": "" - } - ], - "src": "10197:419:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "10728:118:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "10750:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "10758:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "10746:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "10746:14:5" - }, - { - "hexValue": "45524332303a207472616e736665722066726f6d20746865207a65726f206164", - "kind": "string", - "nodeType": "YulLiteral", - "src": "10762:34:5", - "type": "", - "value": "ERC20: transfer from the zero ad" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "10739:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "10739:58:5" - }, - "nodeType": "YulExpressionStatement", - "src": "10739:58:5" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "10818:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "10826:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "10814:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "10814:15:5" - }, - { - "hexValue": "6472657373", - "kind": "string", - "nodeType": "YulLiteral", - "src": "10831:7:5", - "type": "", - "value": "dress" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "10807:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "10807:32:5" - }, - "nodeType": "YulExpressionStatement", - "src": "10807:32:5" - } - ] - }, - "name": "store_literal_in_memory_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "10720:6:5", - "type": "" - } - ], - "src": "10622:224:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "10998:220:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "11008:74:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "11074:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "11079:2:5", - "type": "", - "value": "37" - } - ], - "functionName": { - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "11015:58:5" - }, - "nodeType": "YulFunctionCall", - "src": "11015:67:5" - }, - "variableNames": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "11008:3:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "11180:3:5" - } - ], - "functionName": { - "name": "store_literal_in_memory_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea", - "nodeType": "YulIdentifier", - "src": "11091:88:5" - }, - "nodeType": "YulFunctionCall", - "src": "11091:93:5" - }, - "nodeType": "YulExpressionStatement", - "src": "11091:93:5" - }, - { - "nodeType": "YulAssignment", - "src": "11193:19:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "11204:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "11209:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "11200:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "11200:12:5" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "11193:3:5" - } - ] - } - ] - }, - "name": "abi_encode_t_stringliteral_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea_to_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "10986:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "10994:3:5", - "type": "" - } - ], - "src": "10852:366:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "11395:248:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "11405:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "11417:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "11428:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "11413:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "11413:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "11405:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "11452:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "11463:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "11448:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "11448:17:5" - }, - { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "11471:4:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "11477:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "11467:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "11467:20:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "11441:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "11441:47:5" - }, - "nodeType": "YulExpressionStatement", - "src": "11441:47:5" - }, - { - "nodeType": "YulAssignment", - "src": "11497:139:5", - "value": { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "11631:4:5" - } - ], - "functionName": { - "name": "abi_encode_t_stringliteral_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea_to_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "11505:124:5" - }, - "nodeType": "YulFunctionCall", - "src": "11505:131:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "11497:4:5" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "11375:9:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "11390:4:5", - "type": "" - } - ], - "src": "11224:419:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "11755:116:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "11777:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "11785:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "11773:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "11773:14:5" - }, - { - "hexValue": "45524332303a207472616e7366657220746f20746865207a65726f2061646472", - "kind": "string", - "nodeType": "YulLiteral", - "src": "11789:34:5", - "type": "", - "value": "ERC20: transfer to the zero addr" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "11766:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "11766:58:5" - }, - "nodeType": "YulExpressionStatement", - "src": "11766:58:5" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "11845:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "11853:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "11841:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "11841:15:5" - }, - { - "hexValue": "657373", - "kind": "string", - "nodeType": "YulLiteral", - "src": "11858:5:5", - "type": "", - "value": "ess" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "11834:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "11834:30:5" - }, - "nodeType": "YulExpressionStatement", - "src": "11834:30:5" - } - ] - }, - "name": "store_literal_in_memory_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "11747:6:5", - "type": "" - } - ], - "src": "11649:222:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "12023:220:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "12033:74:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "12099:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "12104:2:5", - "type": "", - "value": "35" - } - ], - "functionName": { - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "12040:58:5" - }, - "nodeType": "YulFunctionCall", - "src": "12040:67:5" - }, - "variableNames": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "12033:3:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "12205:3:5" - } - ], - "functionName": { - "name": "store_literal_in_memory_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f", - "nodeType": "YulIdentifier", - "src": "12116:88:5" - }, - "nodeType": "YulFunctionCall", - "src": "12116:93:5" - }, - "nodeType": "YulExpressionStatement", - "src": "12116:93:5" - }, - { - "nodeType": "YulAssignment", - "src": "12218:19:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "12229:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "12234:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "12225:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "12225:12:5" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "12218:3:5" - } - ] - } - ] - }, - "name": "abi_encode_t_stringliteral_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f_to_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "12011:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "12019:3:5", - "type": "" - } - ], - "src": "11877:366:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "12420:248:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "12430:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "12442:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "12453:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "12438:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "12438:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "12430:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "12477:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "12488:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "12473:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "12473:17:5" - }, - { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "12496:4:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "12502:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "12492:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "12492:20:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "12466:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "12466:47:5" - }, - "nodeType": "YulExpressionStatement", - "src": "12466:47:5" - }, - { - "nodeType": "YulAssignment", - "src": "12522:139:5", - "value": { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "12656:4:5" - } - ], - "functionName": { - "name": "abi_encode_t_stringliteral_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f_to_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "12530:124:5" - }, - "nodeType": "YulFunctionCall", - "src": "12530:131:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "12522:4:5" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "12400:9:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "12415:4:5", - "type": "" - } - ], - "src": "12249:419:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "12780:119:5", - "statements": [ - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "12802:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "12810:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "12798:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "12798:14:5" - }, - { - "hexValue": "45524332303a207472616e7366657220616d6f756e7420657863656564732062", - "kind": "string", - "nodeType": "YulLiteral", - "src": "12814:34:5", - "type": "", - "value": "ERC20: transfer amount exceeds b" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "12791:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "12791:58:5" - }, - "nodeType": "YulExpressionStatement", - "src": "12791:58:5" - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "12870:6:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "12878:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "12866:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "12866:15:5" - }, - { - "hexValue": "616c616e6365", - "kind": "string", - "nodeType": "YulLiteral", - "src": "12883:8:5", - "type": "", - "value": "alance" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "12859:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "12859:33:5" - }, - "nodeType": "YulExpressionStatement", - "src": "12859:33:5" - } - ] - }, - "name": "store_literal_in_memory_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "12772:6:5", - "type": "" - } - ], - "src": "12674:225:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "13051:220:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "13061:74:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "13127:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "13132:2:5", - "type": "", - "value": "38" - } - ], - "functionName": { - "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "13068:58:5" - }, - "nodeType": "YulFunctionCall", - "src": "13068:67:5" - }, - "variableNames": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "13061:3:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "13233:3:5" - } - ], - "functionName": { - "name": "store_literal_in_memory_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6", - "nodeType": "YulIdentifier", - "src": "13144:88:5" - }, - "nodeType": "YulFunctionCall", - "src": "13144:93:5" - }, - "nodeType": "YulExpressionStatement", - "src": "13144:93:5" - }, - { - "nodeType": "YulAssignment", - "src": "13246:19:5", - "value": { - "arguments": [ - { - "name": "pos", - "nodeType": "YulIdentifier", - "src": "13257:3:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "13262:2:5", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "13253:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "13253:12:5" - }, - "variableNames": [ - { - "name": "end", - "nodeType": "YulIdentifier", - "src": "13246:3:5" - } - ] - } - ] - }, - "name": "abi_encode_t_stringliteral_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6_to_t_string_memory_ptr_fromStack", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "pos", - "nodeType": "YulTypedName", - "src": "13039:3:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "end", - "nodeType": "YulTypedName", - "src": "13047:3:5", - "type": "" - } - ], - "src": "12905:366:5" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "13448:248:5", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "13458:26:5", - "value": { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "13470:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "13481:2:5", - "type": "", - "value": "32" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "13466:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "13466:18:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "13458:4:5" - } - ] - }, - { - "expression": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "13505:9:5" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "13516:1:5", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "13501:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "13501:17:5" - }, - { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "13524:4:5" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "13530:9:5" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "13520:3:5" - }, - "nodeType": "YulFunctionCall", - "src": "13520:20:5" - } - ], - "functionName": { - "name": "mstore", - "nodeType": "YulIdentifier", - "src": "13494:6:5" - }, - "nodeType": "YulFunctionCall", - "src": "13494:47:5" - }, - "nodeType": "YulExpressionStatement", - "src": "13494:47:5" - }, - { - "nodeType": "YulAssignment", - "src": "13550:139:5", - "value": { - "arguments": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "13684:4:5" - } - ], - "functionName": { - "name": "abi_encode_t_stringliteral_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6_to_t_string_memory_ptr_fromStack", - "nodeType": "YulIdentifier", - "src": "13558:124:5" - }, - "nodeType": "YulFunctionCall", - "src": "13558:131:5" - }, - "variableNames": [ - { - "name": "tail", - "nodeType": "YulIdentifier", - "src": "13550:4:5" - } - ] - } - ] - }, - "name": "abi_encode_tuple_t_stringliteral_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6__to_t_string_memory_ptr__fromStack_reversed", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "13428:9:5", - "type": "" - } - ], - "returnVariables": [ - { - "name": "tail", - "nodeType": "YulTypedName", - "src": "13443:4:5", - "type": "" - } - ], - "src": "13277:419:5" - } - ] - }, - "contents": "{\n\n function array_length_t_string_memory_ptr(value) -> length {\n\n length := mload(value)\n\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function copy_memory_to_memory_with_cleanup(src, dst, length) {\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(dst, i), mload(add(src, i)))\n }\n mstore(add(dst, length), 0)\n }\n\n function round_up_to_mul_of_32(value) -> result {\n result := and(add(value, 31), not(31))\n }\n\n function abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value, pos) -> end {\n let length := array_length_t_string_memory_ptr(value)\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length)\n copy_memory_to_memory_with_cleanup(add(value, 0x20), pos, length)\n end := add(pos, round_up_to_mul_of_32(length))\n }\n\n function abi_encode_tuple_t_string_memory_ptr__to_t_string_memory_ptr__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value0, tail)\n\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function validator_revert_t_address(value) {\n if iszero(eq(value, cleanup_t_address(value))) { revert(0, 0) }\n }\n\n function abi_decode_t_address(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_address(value)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_addresst_uint256(headStart, dataEnd) -> value0, value1 {\n if slt(sub(dataEnd, headStart), 64) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 32\n\n value1 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function cleanup_t_bool(value) -> cleaned {\n cleaned := iszero(iszero(value))\n }\n\n function abi_encode_t_bool_to_t_bool_fromStack(value, pos) {\n mstore(pos, cleanup_t_bool(value))\n }\n\n function abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_bool_to_t_bool_fromStack(value0, add(headStart, 0))\n\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n function abi_decode_tuple_t_addresst_addresst_uint256(headStart, dataEnd) -> value0, value1, value2 {\n if slt(sub(dataEnd, headStart), 96) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 32\n\n value1 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 64\n\n value2 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function cleanup_t_uint8(value) -> cleaned {\n cleaned := and(value, 0xff)\n }\n\n function abi_encode_t_uint8_to_t_uint8_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint8(value))\n }\n\n function abi_encode_tuple_t_uint8__to_t_uint8__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint8_to_t_uint8_fromStack(value0, add(headStart, 0))\n\n }\n\n function abi_decode_tuple_t_address(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_decode_tuple_t_addresst_address(headStart, dataEnd) -> value0, value1 {\n if slt(sub(dataEnd, headStart), 64) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 32\n\n value1 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n sum := add(x, y)\n\n if gt(x, sum) { panic_error_0x11() }\n\n }\n\n function store_literal_in_memory_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8(memPtr) {\n\n mstore(add(memPtr, 0), \"ERC20: decreased allowance below\")\n\n mstore(add(memPtr, 32), \" zero\")\n\n }\n\n function abi_encode_t_stringliteral_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 37)\n store_literal_in_memory_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8(pos)\n end := add(pos, 64)\n }\n\n function abi_encode_tuple_t_stringliteral_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_f8b476f7d28209d77d4a4ac1fe36b9f8259aa1bb6bddfa6e89de7e51615cf8a8_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function store_literal_in_memory_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208(memPtr) {\n\n mstore(add(memPtr, 0), \"ERC20: approve from the zero add\")\n\n mstore(add(memPtr, 32), \"ress\")\n\n }\n\n function abi_encode_t_stringliteral_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 36)\n store_literal_in_memory_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208(pos)\n end := add(pos, 64)\n }\n\n function abi_encode_tuple_t_stringliteral_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_c953f4879035ed60e766b34720f656aab5c697b141d924c283124ecedb91c208_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function store_literal_in_memory_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029(memPtr) {\n\n mstore(add(memPtr, 0), \"ERC20: approve to the zero addre\")\n\n mstore(add(memPtr, 32), \"ss\")\n\n }\n\n function abi_encode_t_stringliteral_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 34)\n store_literal_in_memory_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029(pos)\n end := add(pos, 64)\n }\n\n function abi_encode_tuple_t_stringliteral_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_24883cc5fe64ace9d0df1893501ecb93c77180f0ff69cca79affb3c316dc8029_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function store_literal_in_memory_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe(memPtr) {\n\n mstore(add(memPtr, 0), \"ERC20: insufficient allowance\")\n\n }\n\n function abi_encode_t_stringliteral_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 29)\n store_literal_in_memory_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_tuple_t_stringliteral_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_3b6607e091cba9325f958656d2b5e0622ab7dc0eac71a26ac788cb25bc19f4fe_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function store_literal_in_memory_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea(memPtr) {\n\n mstore(add(memPtr, 0), \"ERC20: transfer from the zero ad\")\n\n mstore(add(memPtr, 32), \"dress\")\n\n }\n\n function abi_encode_t_stringliteral_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 37)\n store_literal_in_memory_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea(pos)\n end := add(pos, 64)\n }\n\n function abi_encode_tuple_t_stringliteral_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_baecc556b46f4ed0f2b4cb599d60785ac8563dd2dc0a5bf12edea1c39e5e1fea_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function store_literal_in_memory_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f(memPtr) {\n\n mstore(add(memPtr, 0), \"ERC20: transfer to the zero addr\")\n\n mstore(add(memPtr, 32), \"ess\")\n\n }\n\n function abi_encode_t_stringliteral_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 35)\n store_literal_in_memory_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f(pos)\n end := add(pos, 64)\n }\n\n function abi_encode_tuple_t_stringliteral_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_0557e210f7a69a685100a7e4e3d0a7024c546085cee28910fd17d0b081d9516f_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function store_literal_in_memory_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6(memPtr) {\n\n mstore(add(memPtr, 0), \"ERC20: transfer amount exceeds b\")\n\n mstore(add(memPtr, 32), \"alance\")\n\n }\n\n function abi_encode_t_stringliteral_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 38)\n store_literal_in_memory_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6(pos)\n end := add(pos, 64)\n }\n\n function abi_encode_tuple_t_stringliteral_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_4107e8a8b9e94bf8ff83080ddec1c0bffe897ebc2241b89d44f66b3d274088b6_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n}\n", - "id": 5, - "language": "Yul", - "name": "#utility.yul" - } - ], - "immutableReferences": {}, - "linkReferences": {}, - "object": "608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea2646970667358221220d8197461cfcf76643d85773e2b13b928ad86533df5fdb26a8122e9a71272bcc364736f6c63430008120033", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0xA9 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x39509351 GT PUSH2 0x71 JUMPI DUP1 PUSH4 0x39509351 EQ PUSH2 0x168 JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x198 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x1C8 JUMPI DUP1 PUSH4 0xA457C2D7 EQ PUSH2 0x1E6 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x216 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x246 JUMPI PUSH2 0xA9 JUMP JUMPDEST DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xAE JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xCC JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0xFC JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x11A JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x14A JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xB6 PUSH2 0x276 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xC3 SWAP2 SWAP1 PUSH2 0xB0C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0xE6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xE1 SWAP2 SWAP1 PUSH2 0xBC7 JUMP JUMPDEST PUSH2 0x308 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xF3 SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x104 PUSH2 0x32B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x111 SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x134 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x12F SWAP2 SWAP1 PUSH2 0xC67 JUMP JUMPDEST PUSH2 0x335 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x141 SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x152 PUSH2 0x364 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x15F SWAP2 SWAP1 PUSH2 0xCD6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x182 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x17D SWAP2 SWAP1 PUSH2 0xBC7 JUMP JUMPDEST PUSH2 0x36D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x18F SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x1B2 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x1AD SWAP2 SWAP1 PUSH2 0xCF1 JUMP JUMPDEST PUSH2 0x3A4 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BF SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x1D0 PUSH2 0x3EC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1DD SWAP2 SWAP1 PUSH2 0xB0C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x200 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x1FB SWAP2 SWAP1 PUSH2 0xBC7 JUMP JUMPDEST PUSH2 0x47E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x20D SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x230 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x22B SWAP2 SWAP1 PUSH2 0xBC7 JUMP JUMPDEST PUSH2 0x4F5 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x23D SWAP2 SWAP1 PUSH2 0xC22 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x260 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x25B SWAP2 SWAP1 PUSH2 0xD1E JUMP JUMPDEST PUSH2 0x518 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x26D SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD PUSH2 0x285 SWAP1 PUSH2 0xD8D JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x2B1 SWAP1 PUSH2 0xD8D JUMP JUMPDEST DUP1 ISZERO PUSH2 0x2FE JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x2D3 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x2FE JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x2E1 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x313 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH2 0x320 DUP2 DUP6 DUP6 PUSH2 0x5A7 JUMP JUMPDEST PUSH1 0x1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x340 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH2 0x34D DUP6 DUP3 DUP6 PUSH2 0x770 JUMP JUMPDEST PUSH2 0x358 DUP6 DUP6 DUP6 PUSH2 0x7FC JUMP JUMPDEST PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x12 SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x378 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH2 0x399 DUP2 DUP6 DUP6 PUSH2 0x38A DUP6 DUP10 PUSH2 0x518 JUMP JUMPDEST PUSH2 0x394 SWAP2 SWAP1 PUSH2 0xDED JUMP JUMPDEST PUSH2 0x5A7 JUMP JUMPDEST PUSH1 0x1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x4 DUP1 SLOAD PUSH2 0x3FB SWAP1 PUSH2 0xD8D JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x427 SWAP1 PUSH2 0xD8D JUMP JUMPDEST DUP1 ISZERO PUSH2 0x474 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x449 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x474 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x457 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x489 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x497 DUP3 DUP7 PUSH2 0x518 JUMP JUMPDEST SWAP1 POP DUP4 DUP2 LT ISZERO PUSH2 0x4DC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x4D3 SWAP1 PUSH2 0xE93 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x4E9 DUP3 DUP7 DUP7 DUP5 SUB PUSH2 0x5A7 JUMP JUMPDEST PUSH1 0x1 SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x500 PUSH2 0x59F JUMP JUMPDEST SWAP1 POP PUSH2 0x50D DUP2 DUP6 DUP6 PUSH2 0x7FC JUMP JUMPDEST PUSH1 0x1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 CALLER SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SUB PUSH2 0x616 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x60D SWAP1 PUSH2 0xF25 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SUB PUSH2 0x685 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x67C SWAP1 PUSH2 0xFB7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP4 PUSH1 0x40 MLOAD PUSH2 0x763 SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x77C DUP5 DUP5 PUSH2 0x518 JUMP JUMPDEST SWAP1 POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 EQ PUSH2 0x7F6 JUMPI DUP2 DUP2 LT ISZERO PUSH2 0x7E8 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x7DF SWAP1 PUSH2 0x1023 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x7F5 DUP5 DUP5 DUP5 DUP5 SUB PUSH2 0x5A7 JUMP JUMPDEST JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SUB PUSH2 0x86B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x862 SWAP1 PUSH2 0x10B5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SUB PUSH2 0x8DA JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x8D1 SWAP1 PUSH2 0x1147 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x8E5 DUP4 DUP4 DUP4 PUSH2 0xA72 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP2 DUP2 LT ISZERO PUSH2 0x96B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x962 SWAP1 PUSH2 0x11D9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP2 DUP2 SUB PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xA59 SWAP2 SWAP1 PUSH2 0xC4C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH2 0xA6C DUP5 DUP5 DUP5 PUSH2 0xA77 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST POP POP POP JUMP JUMPDEST POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xAB6 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xA9B JUMP JUMPDEST PUSH1 0x0 DUP5 DUP5 ADD MSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xADE DUP3 PUSH2 0xA7C JUMP JUMPDEST PUSH2 0xAE8 DUP2 DUP6 PUSH2 0xA87 JUMP JUMPDEST SWAP4 POP PUSH2 0xAF8 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0xA98 JUMP JUMPDEST PUSH2 0xB01 DUP2 PUSH2 0xAC2 JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0xB26 DUP2 DUP5 PUSH2 0xAD3 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xB5E DUP3 PUSH2 0xB33 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xB6E DUP2 PUSH2 0xB53 JUMP JUMPDEST DUP2 EQ PUSH2 0xB79 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xB8B DUP2 PUSH2 0xB65 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xBA4 DUP2 PUSH2 0xB91 JUMP JUMPDEST DUP2 EQ PUSH2 0xBAF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xBC1 DUP2 PUSH2 0xB9B JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0xBDE JUMPI PUSH2 0xBDD PUSH2 0xB2E JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xBEC DUP6 DUP3 DUP7 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0xBFD DUP6 DUP3 DUP7 ADD PUSH2 0xBB2 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xC1C DUP2 PUSH2 0xC07 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xC37 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xC13 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xC46 DUP2 PUSH2 0xB91 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xC61 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xC3D JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0xC80 JUMPI PUSH2 0xC7F PUSH2 0xB2E JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xC8E DUP7 DUP3 DUP8 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0xC9F DUP7 DUP3 DUP8 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0xCB0 DUP7 DUP3 DUP8 ADD PUSH2 0xBB2 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 PUSH1 0xFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xCD0 DUP2 PUSH2 0xCBA JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0xCEB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xCC7 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xD07 JUMPI PUSH2 0xD06 PUSH2 0xB2E JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xD15 DUP5 DUP3 DUP6 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0xD35 JUMPI PUSH2 0xD34 PUSH2 0xB2E JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xD43 DUP6 DUP3 DUP7 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0xD54 DUP6 DUP3 DUP7 ADD PUSH2 0xB7C JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0xDA5 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 SUB PUSH2 0xDB8 JUMPI PUSH2 0xDB7 PUSH2 0xD5E JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH2 0xDF8 DUP3 PUSH2 0xB91 JUMP JUMPDEST SWAP2 POP PUSH2 0xE03 DUP4 PUSH2 0xB91 JUMP JUMPDEST SWAP3 POP DUP3 DUP3 ADD SWAP1 POP DUP1 DUP3 GT ISZERO PUSH2 0xE1B JUMPI PUSH2 0xE1A PUSH2 0xDBE JUMP JUMPDEST JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH32 0x45524332303A2064656372656173656420616C6C6F77616E63652062656C6F77 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x207A65726F000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xE7D PUSH1 0x25 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0xE88 DUP3 PUSH2 0xE21 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0xEAC DUP2 PUSH2 0xE70 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A20617070726F76652066726F6D20746865207A65726F20616464 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x7265737300000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xF0F PUSH1 0x24 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0xF1A DUP3 PUSH2 0xEB3 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0xF3E DUP2 PUSH2 0xF02 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A20617070726F766520746F20746865207A65726F206164647265 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x7373000000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xFA1 PUSH1 0x22 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0xFAC DUP3 PUSH2 0xF45 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0xFD0 DUP2 PUSH2 0xF94 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A20696E73756666696369656E7420616C6C6F77616E6365000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x100D PUSH1 0x1D DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0x1018 DUP3 PUSH2 0xFD7 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x103C DUP2 PUSH2 0x1000 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A207472616E736665722066726F6D20746865207A65726F206164 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x6472657373000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x109F PUSH1 0x25 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0x10AA DUP3 PUSH2 0x1043 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x10CE DUP2 PUSH2 0x1092 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A207472616E7366657220746F20746865207A65726F2061646472 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x6573730000000000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1131 PUSH1 0x23 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0x113C DUP3 PUSH2 0x10D5 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x1160 DUP2 PUSH2 0x1124 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x45524332303A207472616E7366657220616D6F756E7420657863656564732062 PUSH1 0x0 DUP3 ADD MSTORE PUSH32 0x616C616E63650000000000000000000000000000000000000000000000000000 PUSH1 0x20 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11C3 PUSH1 0x26 DUP4 PUSH2 0xA87 JUMP JUMPDEST SWAP2 POP PUSH2 0x11CE DUP3 PUSH2 0x1167 JUMP JUMPDEST PUSH1 0x40 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x11F2 DUP2 PUSH2 0x11B6 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xD8 NOT PUSH21 0x61CFCF76643D85773E2B13B928AD86533DF5FDB26A DUP2 0x22 0xE9 0xA7 SLT PUSH19 0xBCC364736F6C63430008120033000000000000 ", - "sourceMap": "120:82:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2158:98:0;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4444:197;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3255:106;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;5203:256;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3104:91;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;5854:234;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3419:125;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;2369:102;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;6575:427;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3740:189;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3987:149;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;2158:98;2212:13;2244:5;2237:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2158:98;:::o;4444:197::-;4527:4;4543:13;4559:12;:10;:12::i;:::-;4543:28;;4581:32;4590:5;4597:7;4606:6;4581:8;:32::i;:::-;4630:4;4623:11;;;4444:197;;;;:::o;3255:106::-;3316:7;3342:12;;3335:19;;3255:106;:::o;5203:256::-;5300:4;5316:15;5334:12;:10;:12::i;:::-;5316:30;;5356:38;5372:4;5378:7;5387:6;5356:15;:38::i;:::-;5404:27;5414:4;5420:2;5424:6;5404:9;:27::i;:::-;5448:4;5441:11;;;5203:256;;;;;:::o;3104:91::-;3162:5;3186:2;3179:9;;3104:91;:::o;5854:234::-;5942:4;5958:13;5974:12;:10;:12::i;:::-;5958:28;;5996:64;6005:5;6012:7;6049:10;6021:25;6031:5;6038:7;6021:9;:25::i;:::-;:38;;;;:::i;:::-;5996:8;:64::i;:::-;6077:4;6070:11;;;5854:234;;;;:::o;3419:125::-;3493:7;3519:9;:18;3529:7;3519:18;;;;;;;;;;;;;;;;3512:25;;3419:125;;;:::o;2369:102::-;2425:13;2457:7;2450:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2369:102;:::o;6575:427::-;6668:4;6684:13;6700:12;:10;:12::i;:::-;6684:28;;6722:24;6749:25;6759:5;6766:7;6749:9;:25::i;:::-;6722:52;;6812:15;6792:16;:35;;6784:85;;;;;;;;;;;;:::i;:::-;;;;;;;;;6903:60;6912:5;6919:7;6947:15;6928:16;:34;6903:8;:60::i;:::-;6991:4;6984:11;;;;6575:427;;;;:::o;3740:189::-;3819:4;3835:13;3851:12;:10;:12::i;:::-;3835:28;;3873;3883:5;3890:2;3894:6;3873:9;:28::i;:::-;3918:4;3911:11;;;3740:189;;;;:::o;3987:149::-;4076:7;4102:11;:18;4114:5;4102:18;;;;;;;;;;;;;;;:27;4121:7;4102:27;;;;;;;;;;;;;;;;4095:34;;3987:149;;;;:::o;640:96:3:-;693:7;719:10;712:17;;640:96;:::o;10457:340:0:-;10575:1;10558:19;;:5;:19;;;10550:68;;;;;;;;;;;;:::i;:::-;;;;;;;;;10655:1;10636:21;;:7;:21;;;10628:68;;;;;;;;;;;;:::i;:::-;;;;;;;;;10737:6;10707:11;:18;10719:5;10707:18;;;;;;;;;;;;;;;:27;10726:7;10707:27;;;;;;;;;;;;;;;:36;;;;10774:7;10758:32;;10767:5;10758:32;;;10783:6;10758:32;;;;;;:::i;:::-;;;;;;;;10457:340;;;:::o;11078:411::-;11178:24;11205:25;11215:5;11222:7;11205:9;:25::i;:::-;11178:52;;11264:17;11244:16;:37;11240:243;;11325:6;11305:16;:26;;11297:68;;;;;;;;;;;;:::i;:::-;;;;;;;;;11407:51;11416:5;11423:7;11451:6;11432:16;:25;11407:8;:51::i;:::-;11240:243;11168:321;11078:411;;;:::o;7456:788::-;7568:1;7552:18;;:4;:18;;;7544:68;;;;;;;;;;;;:::i;:::-;;;;;;;;;7644:1;7630:16;;:2;:16;;;7622:64;;;;;;;;;;;;:::i;:::-;;;;;;;;;7697:38;7718:4;7724:2;7728:6;7697:20;:38::i;:::-;7746:19;7768:9;:15;7778:4;7768:15;;;;;;;;;;;;;;;;7746:37;;7816:6;7801:11;:21;;7793:72;;;;;;;;;;;;:::i;:::-;;;;;;;;;7931:6;7917:11;:20;7899:9;:15;7909:4;7899:15;;;;;;;;;;;;;;;:38;;;;8131:6;8114:9;:13;8124:2;8114:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;8178:2;8163:26;;8172:4;8163:26;;;8182:6;8163:26;;;;;;:::i;:::-;;;;;;;;8200:37;8220:4;8226:2;8230:6;8200:19;:37::i;:::-;7534:710;7456:788;;;:::o;12073:91::-;;;;:::o;12752:90::-;;;;:::o;7:99:5:-;59:6;93:5;87:12;77:22;;7:99;;;:::o;112:169::-;196:11;230:6;225:3;218:19;270:4;265:3;261:14;246:29;;112:169;;;;:::o;287:246::-;368:1;378:113;392:6;389:1;386:13;378:113;;;477:1;472:3;468:11;462:18;458:1;453:3;449:11;442:39;414:2;411:1;407:10;402:15;;378:113;;;525:1;516:6;511:3;507:16;500:27;349:184;287:246;;;:::o;539:102::-;580:6;631:2;627:7;622:2;615:5;611:14;607:28;597:38;;539:102;;;:::o;647:377::-;735:3;763:39;796:5;763:39;:::i;:::-;818:71;882:6;877:3;818:71;:::i;:::-;811:78;;898:65;956:6;951:3;944:4;937:5;933:16;898:65;:::i;:::-;988:29;1010:6;988:29;:::i;:::-;983:3;979:39;972:46;;739:285;647:377;;;;:::o;1030:313::-;1143:4;1181:2;1170:9;1166:18;1158:26;;1230:9;1224:4;1220:20;1216:1;1205:9;1201:17;1194:47;1258:78;1331:4;1322:6;1258:78;:::i;:::-;1250:86;;1030:313;;;;:::o;1430:117::-;1539:1;1536;1529:12;1676:126;1713:7;1753:42;1746:5;1742:54;1731:65;;1676:126;;;:::o;1808:96::-;1845:7;1874:24;1892:5;1874:24;:::i;:::-;1863:35;;1808:96;;;:::o;1910:122::-;1983:24;2001:5;1983:24;:::i;:::-;1976:5;1973:35;1963:63;;2022:1;2019;2012:12;1963:63;1910:122;:::o;2038:139::-;2084:5;2122:6;2109:20;2100:29;;2138:33;2165:5;2138:33;:::i;:::-;2038:139;;;;:::o;2183:77::-;2220:7;2249:5;2238:16;;2183:77;;;:::o;2266:122::-;2339:24;2357:5;2339:24;:::i;:::-;2332:5;2329:35;2319:63;;2378:1;2375;2368:12;2319:63;2266:122;:::o;2394:139::-;2440:5;2478:6;2465:20;2456:29;;2494:33;2521:5;2494:33;:::i;:::-;2394:139;;;;:::o;2539:474::-;2607:6;2615;2664:2;2652:9;2643:7;2639:23;2635:32;2632:119;;;2670:79;;:::i;:::-;2632:119;2790:1;2815:53;2860:7;2851:6;2840:9;2836:22;2815:53;:::i;:::-;2805:63;;2761:117;2917:2;2943:53;2988:7;2979:6;2968:9;2964:22;2943:53;:::i;:::-;2933:63;;2888:118;2539:474;;;;;:::o;3019:90::-;3053:7;3096:5;3089:13;3082:21;3071:32;;3019:90;;;:::o;3115:109::-;3196:21;3211:5;3196:21;:::i;:::-;3191:3;3184:34;3115:109;;:::o;3230:210::-;3317:4;3355:2;3344:9;3340:18;3332:26;;3368:65;3430:1;3419:9;3415:17;3406:6;3368:65;:::i;:::-;3230:210;;;;:::o;3446:118::-;3533:24;3551:5;3533:24;:::i;:::-;3528:3;3521:37;3446:118;;:::o;3570:222::-;3663:4;3701:2;3690:9;3686:18;3678:26;;3714:71;3782:1;3771:9;3767:17;3758:6;3714:71;:::i;:::-;3570:222;;;;:::o;3798:619::-;3875:6;3883;3891;3940:2;3928:9;3919:7;3915:23;3911:32;3908:119;;;3946:79;;:::i;:::-;3908:119;4066:1;4091:53;4136:7;4127:6;4116:9;4112:22;4091:53;:::i;:::-;4081:63;;4037:117;4193:2;4219:53;4264:7;4255:6;4244:9;4240:22;4219:53;:::i;:::-;4209:63;;4164:118;4321:2;4347:53;4392:7;4383:6;4372:9;4368:22;4347:53;:::i;:::-;4337:63;;4292:118;3798:619;;;;;:::o;4423:86::-;4458:7;4498:4;4491:5;4487:16;4476:27;;4423:86;;;:::o;4515:112::-;4598:22;4614:5;4598:22;:::i;:::-;4593:3;4586:35;4515:112;;:::o;4633:214::-;4722:4;4760:2;4749:9;4745:18;4737:26;;4773:67;4837:1;4826:9;4822:17;4813:6;4773:67;:::i;:::-;4633:214;;;;:::o;4853:329::-;4912:6;4961:2;4949:9;4940:7;4936:23;4932:32;4929:119;;;4967:79;;:::i;:::-;4929:119;5087:1;5112:53;5157:7;5148:6;5137:9;5133:22;5112:53;:::i;:::-;5102:63;;5058:117;4853:329;;;;:::o;5188:474::-;5256:6;5264;5313:2;5301:9;5292:7;5288:23;5284:32;5281:119;;;5319:79;;:::i;:::-;5281:119;5439:1;5464:53;5509:7;5500:6;5489:9;5485:22;5464:53;:::i;:::-;5454:63;;5410:117;5566:2;5592:53;5637:7;5628:6;5617:9;5613:22;5592:53;:::i;:::-;5582:63;;5537:118;5188:474;;;;;:::o;5668:180::-;5716:77;5713:1;5706:88;5813:4;5810:1;5803:15;5837:4;5834:1;5827:15;5854:320;5898:6;5935:1;5929:4;5925:12;5915:22;;5982:1;5976:4;5972:12;6003:18;5993:81;;6059:4;6051:6;6047:17;6037:27;;5993:81;6121:2;6113:6;6110:14;6090:18;6087:38;6084:84;;6140:18;;:::i;:::-;6084:84;5905:269;5854:320;;;:::o;6180:180::-;6228:77;6225:1;6218:88;6325:4;6322:1;6315:15;6349:4;6346:1;6339:15;6366:191;6406:3;6425:20;6443:1;6425:20;:::i;:::-;6420:25;;6459:20;6477:1;6459:20;:::i;:::-;6454:25;;6502:1;6499;6495:9;6488:16;;6523:3;6520:1;6517:10;6514:36;;;6530:18;;:::i;:::-;6514:36;6366:191;;;;:::o;6563:224::-;6703:34;6699:1;6691:6;6687:14;6680:58;6772:7;6767:2;6759:6;6755:15;6748:32;6563:224;:::o;6793:366::-;6935:3;6956:67;7020:2;7015:3;6956:67;:::i;:::-;6949:74;;7032:93;7121:3;7032:93;:::i;:::-;7150:2;7145:3;7141:12;7134:19;;6793:366;;;:::o;7165:419::-;7331:4;7369:2;7358:9;7354:18;7346:26;;7418:9;7412:4;7408:20;7404:1;7393:9;7389:17;7382:47;7446:131;7572:4;7446:131;:::i;:::-;7438:139;;7165:419;;;:::o;7590:223::-;7730:34;7726:1;7718:6;7714:14;7707:58;7799:6;7794:2;7786:6;7782:15;7775:31;7590:223;:::o;7819:366::-;7961:3;7982:67;8046:2;8041:3;7982:67;:::i;:::-;7975:74;;8058:93;8147:3;8058:93;:::i;:::-;8176:2;8171:3;8167:12;8160:19;;7819:366;;;:::o;8191:419::-;8357:4;8395:2;8384:9;8380:18;8372:26;;8444:9;8438:4;8434:20;8430:1;8419:9;8415:17;8408:47;8472:131;8598:4;8472:131;:::i;:::-;8464:139;;8191:419;;;:::o;8616:221::-;8756:34;8752:1;8744:6;8740:14;8733:58;8825:4;8820:2;8812:6;8808:15;8801:29;8616:221;:::o;8843:366::-;8985:3;9006:67;9070:2;9065:3;9006:67;:::i;:::-;8999:74;;9082:93;9171:3;9082:93;:::i;:::-;9200:2;9195:3;9191:12;9184:19;;8843:366;;;:::o;9215:419::-;9381:4;9419:2;9408:9;9404:18;9396:26;;9468:9;9462:4;9458:20;9454:1;9443:9;9439:17;9432:47;9496:131;9622:4;9496:131;:::i;:::-;9488:139;;9215:419;;;:::o;9640:179::-;9780:31;9776:1;9768:6;9764:14;9757:55;9640:179;:::o;9825:366::-;9967:3;9988:67;10052:2;10047:3;9988:67;:::i;:::-;9981:74;;10064:93;10153:3;10064:93;:::i;:::-;10182:2;10177:3;10173:12;10166:19;;9825:366;;;:::o;10197:419::-;10363:4;10401:2;10390:9;10386:18;10378:26;;10450:9;10444:4;10440:20;10436:1;10425:9;10421:17;10414:47;10478:131;10604:4;10478:131;:::i;:::-;10470:139;;10197:419;;;:::o;10622:224::-;10762:34;10758:1;10750:6;10746:14;10739:58;10831:7;10826:2;10818:6;10814:15;10807:32;10622:224;:::o;10852:366::-;10994:3;11015:67;11079:2;11074:3;11015:67;:::i;:::-;11008:74;;11091:93;11180:3;11091:93;:::i;:::-;11209:2;11204:3;11200:12;11193:19;;10852:366;;;:::o;11224:419::-;11390:4;11428:2;11417:9;11413:18;11405:26;;11477:9;11471:4;11467:20;11463:1;11452:9;11448:17;11441:47;11505:131;11631:4;11505:131;:::i;:::-;11497:139;;11224:419;;;:::o;11649:222::-;11789:34;11785:1;11777:6;11773:14;11766:58;11858:5;11853:2;11845:6;11841:15;11834:30;11649:222;:::o;11877:366::-;12019:3;12040:67;12104:2;12099:3;12040:67;:::i;:::-;12033:74;;12116:93;12205:3;12116:93;:::i;:::-;12234:2;12229:3;12225:12;12218:19;;11877:366;;;:::o;12249:419::-;12415:4;12453:2;12442:9;12438:18;12430:26;;12502:9;12496:4;12492:20;12488:1;12477:9;12473:17;12466:47;12530:131;12656:4;12530:131;:::i;:::-;12522:139;;12249:419;;;:::o;12674:225::-;12814:34;12810:1;12802:6;12798:14;12791:58;12883:8;12878:2;12870:6;12866:15;12859:33;12674:225;:::o;12905:366::-;13047:3;13068:67;13132:2;13127:3;13068:67;:::i;:::-;13061:74;;13144:93;13233:3;13144:93;:::i;:::-;13262:2;13257:3;13253:12;13246:19;;12905:366;;;:::o;13277:419::-;13443:4;13481:2;13470:9;13466:18;13458:26;;13530:9;13524:4;13520:20;13516:1;13505:9;13501:17;13494:47;13558:131;13684:4;13558:131;:::i;:::-;13550:139;;13277:419;;;:::o" - }, - "Assembly": ".code\n PUSH 80\t\t\tcontract ERC20Token is ERC20 {...\n PUSH 40\t\t\tcontract ERC20Token is ERC20 {...\n MSTORE \t\t\tcontract ERC20Token is ERC20 {...\n CALLVALUE \t\t\tconstructor() ERC20(\"ERC20Toke...\n DUP1 \t\t\tconstructor() ERC20(\"ERC20Toke...\n ISZERO \t\t\tconstructor() ERC20(\"ERC20Toke...\n PUSH [tag] 1\t\t\tconstructor() ERC20(\"ERC20Toke...\n JUMPI \t\t\tconstructor() ERC20(\"ERC20Toke...\n PUSH 0\t\t\tconstructor() ERC20(\"ERC20Toke...\n DUP1 \t\t\tconstructor() ERC20(\"ERC20Toke...\n REVERT \t\t\tconstructor() ERC20(\"ERC20Toke...\ntag 1\t\t\tconstructor() ERC20(\"ERC20Toke...\n JUMPDEST \t\t\tconstructor() ERC20(\"ERC20Toke...\n POP \t\t\tconstructor() ERC20(\"ERC20Toke...\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n PUSH 40\t\t\t\n ADD \t\t\t\n PUSH 40\t\t\t\n MSTORE \t\t\t\n DUP1 \t\t\t\n PUSH A\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 4552433230546F6B656E00000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n PUSH 40\t\t\t\n ADD \t\t\t\n PUSH 40\t\t\t\n MSTORE \t\t\t\n DUP1 \t\t\t\n PUSH 5\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 4552433230000000000000000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n PUSH 3\t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n PUSH [tag] 5\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 6\t\t\t\n JUMP \t\t\t\ntag 5\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n DUP1 \t\t\t\n PUSH 4\t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n PUSH [tag] 7\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 6\t\t\t\n JUMP \t\t\t\ntag 7\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n PUSH [tag] 9\t\t\tcontract ERC20Token is ERC20 {...\n JUMP \t\t\tcontract ERC20Token is ERC20 {...\ntag 10\t\t\t-License-Identifier: MIT\\nprag...\n JUMPDEST \t\t\t-License-Identifier: MIT\\nprag...\n PUSH 0\t\t\tport \"\n DUP2 \t\t\t2/tok\n MLOAD \t\t\ts@4.9.2/toke\n SWAP1 \t\t\tn/contracts@4.9.2/toke\n POP \t\t\tn/contracts@4.9.2/toke\n SWAP2 \t\t\t-License-Identifier: MIT\\nprag...\n SWAP1 \t\t\t-License-Identifier: MIT\\nprag...\n POP \t\t\t-License-Identifier: MIT\\nprag...\n JUMP \t\t\t-License-Identifier: MIT\\nprag...\ntag 11\t\t\t.sol\";\\n\\ncontract ERC20Token ...\n JUMPDEST \t\t\t.sol\";\\n\\ncontract ERC20Token ...\n PUSH 4E487B7100000000000000000000000000000000000000000000000000000000\t\t\tructor() ERC20(\"ERC20Token\", \"...\n PUSH 0\t\t\tn\n MSTORE \t\t\t\\n constructor() ERC20(\"ERC...\n PUSH 41\t\t\t\n PUSH 4\t\t\t\n MSTORE \t\t\t\n PUSH 24\t\t\t\n PUSH 0\t\t\t\n REVERT \t\t\t\ntag 12\t\t\t\n JUMPDEST \t\t\t\n PUSH 4E487B7100000000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 0\t\t\t\n MSTORE \t\t\t\n PUSH 22\t\t\t\n PUSH 4\t\t\t\n MSTORE \t\t\t\n PUSH 24\t\t\t\n PUSH 0\t\t\t\n REVERT \t\t\t\ntag 13\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 2\t\t\t\n DUP3 \t\t\t\n DIV \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH 1\t\t\t\n DUP3 \t\t\t\n AND \t\t\t\n DUP1 \t\t\t\n PUSH [tag] 35\t\t\t\n JUMPI \t\t\t\n PUSH 7F\t\t\t\n DUP3 \t\t\t\n AND \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\ntag 35\t\t\t\n JUMPDEST \t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n LT \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH [tag] 36\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 37\t\t\t\n PUSH [tag] 12\t\t\t\n JUMP \t\t\t\ntag 37\t\t\t\n JUMPDEST \t\t\t\ntag 36\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 14\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n PUSH 0\t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 15\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n PUSH 1F\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n DIV \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 16\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n DUP3 \t\t\t\n SHL \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 17\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 8\t\t\t\n DUP4 \t\t\t\n MUL \t\t\t\n PUSH [tag] 42\t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 16\t\t\t\n JUMP \t\t\t\ntag 42\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 43\t\t\t\n DUP7 \t\t\t\n DUP4 \t\t\t\n PUSH [tag] 16\t\t\t\n JUMP \t\t\t\ntag 43\t\t\t\n JUMPDEST \t\t\t\n SWAP6 \t\t\t\n POP \t\t\t\n DUP1 \t\t\t\n NOT \t\t\t\n DUP5 \t\t\t\n AND \t\t\t\n SWAP4 \t\t\t\n POP \t\t\t\n DUP1 \t\t\t\n DUP7 \t\t\t\n AND \t\t\t\n DUP5 \t\t\t\n OR \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP4 \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 18\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 19\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 20\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 47\t\t\t\n PUSH [tag] 48\t\t\t\n PUSH [tag] 49\t\t\t\n DUP5 \t\t\t\n PUSH [tag] 18\t\t\t\n JUMP \t\t\t\ntag 49\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 19\t\t\t\n JUMP \t\t\t\ntag 48\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 18\t\t\t\n JUMP \t\t\t\ntag 47\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 21\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 22\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 52\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 20\t\t\t\n JUMP \t\t\t\ntag 52\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 53\t\t\t\n PUSH [tag] 54\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 21\t\t\t\n JUMP \t\t\t\ntag 54\t\t\t\n JUMPDEST \t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n SLOAD \t\t\t\n PUSH [tag] 17\t\t\t\n JUMP \t\t\t\ntag 53\t\t\t\n JUMPDEST \t\t\t\n DUP3 \t\t\t\n SSTORE \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 23\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n SWAP1 \t\t\t\n JUMP \t\t\t\ntag 24\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 57\t\t\t\n PUSH [tag] 23\t\t\t\n JUMP \t\t\t\ntag 57\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 58\t\t\t\n DUP2 \t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n PUSH [tag] 22\t\t\t\n JUMP \t\t\t\ntag 58\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 25\t\t\t\n JUMPDEST \t\t\t\ntag 60\t\t\t\n JUMPDEST \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n LT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 62\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 63\t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 24\t\t\t\n JUMP \t\t\t\ntag 63\t\t\t\n JUMPDEST \t\t\t\n PUSH 1\t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 60\t\t\t\n JUMP \t\t\t\ntag 62\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 26\t\t\t\n JUMPDEST \t\t\t\n PUSH 1F\t\t\t\n DUP3 \t\t\t\n GT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 65\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 66\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 14\t\t\t\n JUMP \t\t\t\ntag 66\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 67\t\t\t\n DUP5 \t\t\t\n PUSH [tag] 15\t\t\t\n JUMP \t\t\t\ntag 67\t\t\t\n JUMPDEST \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n PUSH 20\t\t\t\n DUP6 \t\t\t\n LT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 68\t\t\t\n JUMPI \t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\ntag 68\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 69\t\t\t\n PUSH [tag] 70\t\t\t\n DUP6 \t\t\t\n PUSH [tag] 15\t\t\t\n JUMP \t\t\t\ntag 70\t\t\t\n JUMPDEST \t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n DUP3 \t\t\t\n PUSH [tag] 25\t\t\t\n JUMP \t\t\t\ntag 69\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\ntag 65\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 27\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n DUP3 \t\t\t\n SHR \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 28\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 73\t\t\t\n PUSH 0\t\t\t\n NOT \t\t\t\n DUP5 \t\t\t\n PUSH 8\t\t\t\n MUL \t\t\t\n PUSH [tag] 27\t\t\t\n JUMP \t\t\t\ntag 73\t\t\t\n JUMPDEST \t\t\t\n NOT \t\t\t\n DUP1 \t\t\t\n DUP4 \t\t\t\n AND \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 29\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 75\t\t\t\n DUP4 \t\t\t\n DUP4 \t\t\t\n PUSH [tag] 28\t\t\t\n JUMP \t\t\t\ntag 75\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n DUP3 \t\t\t\n PUSH 2\t\t\t\n MUL \t\t\t\n DUP3 \t\t\t\n OR \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 6\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 77\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 10\t\t\t\n JUMP \t\t\t\ntag 77\t\t\t\n JUMPDEST \t\t\t\n PUSH FFFFFFFFFFFFFFFF\t\t\t\n DUP2 \t\t\t\n GT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 78\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 79\t\t\t\n PUSH [tag] 11\t\t\t\n JUMP \t\t\t\ntag 79\t\t\t\n JUMPDEST \t\t\t\ntag 78\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 80\t\t\t\n DUP3 \t\t\t\n SLOAD \t\t\t\n PUSH [tag] 13\t\t\t\n JUMP \t\t\t\ntag 80\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 81\t\t\t\n DUP3 \t\t\t\n DUP3 \t\t\t\n DUP6 \t\t\t\n PUSH [tag] 26\t\t\t\n JUMP \t\t\t\ntag 81\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH 1F\t\t\t\n DUP4 \t\t\t\n GT \t\t\t\n PUSH 1\t\t\t\n DUP2 \t\t\t\n EQ \t\t\t\n PUSH [tag] 83\t\t\t\n JUMPI \t\t\t\n PUSH 0\t\t\t\n DUP5 \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 84\t\t\t\n JUMPI \t\t\t\n DUP3 \t\t\t\n DUP8 \t\t\t\n ADD \t\t\t\n MLOAD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\ntag 84\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 85\t\t\t\n DUP6 \t\t\t\n DUP3 \t\t\t\n PUSH [tag] 29\t\t\t\n JUMP \t\t\t\ntag 85\t\t\t\n JUMPDEST \t\t\t\n DUP7 \t\t\t\n SSTORE \t\t\t\n POP \t\t\t\n PUSH [tag] 82\t\t\t\n JUMP \t\t\t\ntag 83\t\t\t\n JUMPDEST \t\t\t\n PUSH 1F\t\t\t\n NOT \t\t\t\n DUP5 \t\t\t\n AND \t\t\t\n PUSH [tag] 86\t\t\t\n DUP7 \t\t\t\n PUSH [tag] 14\t\t\t\n JUMP \t\t\t\ntag 86\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\ntag 87\t\t\t\n JUMPDEST \t\t\t\n DUP3 \t\t\t\n DUP2 \t\t\t\n LT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 89\t\t\t\n JUMPI \t\t\t\n DUP5 \t\t\t\n DUP10 \t\t\t\n ADD \t\t\t\n MLOAD \t\t\t\n DUP3 \t\t\t\n SSTORE \t\t\t\n PUSH 1\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH 20\t\t\t\n DUP6 \t\t\t\n ADD \t\t\t\n SWAP5 \t\t\t\n POP \t\t\t\n PUSH 20\t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 87\t\t\t\n JUMP \t\t\t\ntag 89\t\t\t\n JUMPDEST \t\t\t\n DUP7 \t\t\t\n DUP4 \t\t\t\n LT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 90\t\t\t\n JUMPI \t\t\t\n DUP5 \t\t\t\n DUP10 \t\t\t\n ADD \t\t\t\n MLOAD \t\t\t\n PUSH [tag] 91\t\t\t\n PUSH 1F\t\t\t\n DUP10 \t\t\t\n AND \t\t\t\n DUP3 \t\t\t\n PUSH [tag] 28\t\t\t\n JUMP \t\t\t\ntag 91\t\t\t\n JUMPDEST \t\t\t\n DUP4 \t\t\t\n SSTORE \t\t\t\n POP \t\t\t\ntag 90\t\t\t\n JUMPDEST \t\t\t\n PUSH 1\t\t\t\n PUSH 2\t\t\t\n DUP9 \t\t\t\n MUL \t\t\t\n ADD \t\t\t\n DUP9 \t\t\t\n SSTORE \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\ntag 82\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\ntag 9\t\t\tcontract ERC20Token is ERC20 {...\n JUMPDEST \t\t\tcontract ERC20Token is ERC20 {...\n PUSH #[$] 0000000000000000000000000000000000000000000000000000000000000000\t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [$] 0000000000000000000000000000000000000000000000000000000000000000\t\t\tcontract ERC20Token is ERC20 {...\n PUSH 0\t\t\tcontract ERC20Token is ERC20 {...\n CODECOPY \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 0\t\t\tcontract ERC20Token is ERC20 {...\n RETURN \t\t\tcontract ERC20Token is ERC20 {...\n.data\n 0:\n .code\n PUSH 80\t\t\tcontract ERC20Token is ERC20 {...\n PUSH 40\t\t\tcontract ERC20Token is ERC20 {...\n MSTORE \t\t\tcontract ERC20Token is ERC20 {...\n CALLVALUE \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n ISZERO \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 1\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 0\t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n REVERT \t\t\tcontract ERC20Token is ERC20 {...\n tag 1\t\t\tcontract ERC20Token is ERC20 {...\n JUMPDEST \t\t\tcontract ERC20Token is ERC20 {...\n POP \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 4\t\t\tcontract ERC20Token is ERC20 {...\n CALLDATASIZE \t\t\tcontract ERC20Token is ERC20 {...\n LT \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 2\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 0\t\t\tcontract ERC20Token is ERC20 {...\n CALLDATALOAD \t\t\tcontract ERC20Token is ERC20 {...\n PUSH E0\t\t\tcontract ERC20Token is ERC20 {...\n SHR \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 39509351\t\t\tcontract ERC20Token is ERC20 {...\n GT \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 14\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 39509351\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 8\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 70A08231\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 9\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 95D89B41\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 10\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH A457C2D7\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 11\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH A9059CBB\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 12\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH DD62ED3E\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 13\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 2\t\t\tcontract ERC20Token is ERC20 {...\n JUMP \t\t\tcontract ERC20Token is ERC20 {...\n tag 14\t\t\tcontract ERC20Token is ERC20 {...\n JUMPDEST \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 6FDDE03\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 3\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 95EA7B3\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 4\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 18160DDD\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 5\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 23B872DD\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 6\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 313CE567\t\t\tcontract ERC20Token is ERC20 {...\n EQ \t\t\tcontract ERC20Token is ERC20 {...\n PUSH [tag] 7\t\t\tcontract ERC20Token is ERC20 {...\n JUMPI \t\t\tcontract ERC20Token is ERC20 {...\n tag 2\t\t\tcontract ERC20Token is ERC20 {...\n JUMPDEST \t\t\tcontract ERC20Token is ERC20 {...\n PUSH 0\t\t\tcontract ERC20Token is ERC20 {...\n DUP1 \t\t\tcontract ERC20Token is ERC20 {...\n REVERT \t\t\tcontract ERC20Token is ERC20 {...\n tag 3\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 15\t\t\t\n PUSH [tag] 16\t\t\t\n JUMP \t\t\t\n tag 15\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 17\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 18\t\t\t\n JUMP \t\t\t\n tag 17\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 4\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 19\t\t\t\n PUSH 4\t\t\t\n DUP1 \t\t\t\n CALLDATASIZE \t\t\t\n SUB \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 20\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 21\t\t\t\n JUMP \t\t\t\n tag 20\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 22\t\t\t\n JUMP \t\t\t\n tag 19\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 23\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 24\t\t\t\n JUMP \t\t\t\n tag 23\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 5\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 25\t\t\t\n PUSH [tag] 26\t\t\t\n JUMP \t\t\t\n tag 25\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 27\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 28\t\t\t\n JUMP \t\t\t\n tag 27\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 6\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 29\t\t\t\n PUSH 4\t\t\t\n DUP1 \t\t\t\n CALLDATASIZE \t\t\t\n SUB \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 30\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 31\t\t\t\n JUMP \t\t\t\n tag 30\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 32\t\t\t\n JUMP \t\t\t\n tag 29\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 33\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 24\t\t\t\n JUMP \t\t\t\n tag 33\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 7\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 34\t\t\t\n PUSH [tag] 35\t\t\t\n JUMP \t\t\t\n tag 34\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 36\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 37\t\t\t\n JUMP \t\t\t\n tag 36\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 8\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 38\t\t\t\n PUSH 4\t\t\t\n DUP1 \t\t\t\n CALLDATASIZE \t\t\t\n SUB \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 39\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 21\t\t\t\n JUMP \t\t\t\n tag 39\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 40\t\t\t\n JUMP \t\t\t\n tag 38\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 41\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 24\t\t\t\n JUMP \t\t\t\n tag 41\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 9\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 42\t\t\t\n PUSH 4\t\t\t\n DUP1 \t\t\t\n CALLDATASIZE \t\t\t\n SUB \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 43\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 44\t\t\t\n JUMP \t\t\t\n tag 43\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 45\t\t\t\n JUMP \t\t\t\n tag 42\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 46\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 28\t\t\t\n JUMP \t\t\t\n tag 46\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 10\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 47\t\t\t\n PUSH [tag] 48\t\t\t\n JUMP \t\t\t\n tag 47\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 49\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 18\t\t\t\n JUMP \t\t\t\n tag 49\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 11\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 50\t\t\t\n PUSH 4\t\t\t\n DUP1 \t\t\t\n CALLDATASIZE \t\t\t\n SUB \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 51\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 21\t\t\t\n JUMP \t\t\t\n tag 51\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 52\t\t\t\n JUMP \t\t\t\n tag 50\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 53\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 24\t\t\t\n JUMP \t\t\t\n tag 53\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 12\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 54\t\t\t\n PUSH 4\t\t\t\n DUP1 \t\t\t\n CALLDATASIZE \t\t\t\n SUB \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 55\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 21\t\t\t\n JUMP \t\t\t\n tag 55\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 56\t\t\t\n JUMP \t\t\t\n tag 54\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 57\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 24\t\t\t\n JUMP \t\t\t\n tag 57\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 13\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 58\t\t\t\n PUSH 4\t\t\t\n DUP1 \t\t\t\n CALLDATASIZE \t\t\t\n SUB \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 59\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 60\t\t\t\n JUMP \t\t\t\n tag 59\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 61\t\t\t\n JUMP \t\t\t\n tag 58\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 62\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 28\t\t\t\n JUMP \t\t\t\n tag 62\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n RETURN \t\t\t\n tag 16\t\t\t\n JUMPDEST \t\t\t\n PUSH 60\t\t\t\n PUSH 3\t\t\t\n DUP1 \t\t\t\n SLOAD \t\t\t\n PUSH [tag] 64\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 65\t\t\t\n JUMP \t\t\t\n tag 64\t\t\t\n JUMPDEST \t\t\t\n DUP1 \t\t\t\n PUSH 1F\t\t\t\n ADD \t\t\t\n PUSH 20\t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n DIV \t\t\t\n MUL \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n PUSH 40\t\t\t\n MSTORE \t\t\t\n DUP1 \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n DUP3 \t\t\t\n DUP1 \t\t\t\n SLOAD \t\t\t\n PUSH [tag] 66\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 65\t\t\t\n JUMP \t\t\t\n tag 66\t\t\t\n JUMPDEST \t\t\t\n DUP1 \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 67\t\t\t\n JUMPI \t\t\t\n DUP1 \t\t\t\n PUSH 1F\t\t\t\n LT \t\t\t\n PUSH [tag] 68\t\t\t\n JUMPI \t\t\t\n PUSH 100\t\t\t\n DUP1 \t\t\t\n DUP4 \t\t\t\n SLOAD \t\t\t\n DIV \t\t\t\n MUL \t\t\t\n DUP4 \t\t\t\n MSTORE \t\t\t\n SWAP2 \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP2 \t\t\t\n PUSH [tag] 67\t\t\t\n JUMP \t\t\t\n tag 68\t\t\t\n JUMPDEST \t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH 0\t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n SWAP1 \t\t\t\n tag 69\t\t\t\n JUMPDEST \t\t\t\n DUP2 \t\t\t\n SLOAD \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n SWAP1 \t\t\t\n PUSH 1\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n DUP1 \t\t\t\n DUP4 \t\t\t\n GT \t\t\t\n PUSH [tag] 69\t\t\t\n JUMPI \t\t\t\n DUP3 \t\t\t\n SWAP1 \t\t\t\n SUB \t\t\t\n PUSH 1F\t\t\t\n AND \t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP2 \t\t\t\n tag 67\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP1 \t\t\t\n JUMP \t\t\t\n tag 22\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH [tag] 71\t\t\t\n PUSH [tag] 72\t\t\t\n JUMP \t\t\t\n tag 71\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 73\t\t\t\n DUP2 \t\t\t\n DUP6 \t\t\t\n DUP6 \t\t\t\n PUSH [tag] 74\t\t\t\n JUMP \t\t\t\n tag 73\t\t\t\n JUMPDEST \t\t\t\n PUSH 1\t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 26\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 2\t\t\t\n SLOAD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP1 \t\t\t\n JUMP \t\t\t\n tag 32\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH [tag] 77\t\t\t\n PUSH [tag] 72\t\t\t\n JUMP \t\t\t\n tag 77\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 78\t\t\t\n DUP6 \t\t\t\n DUP3 \t\t\t\n DUP6 \t\t\t\n PUSH [tag] 79\t\t\t\n JUMP \t\t\t\n tag 78\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 80\t\t\t\n DUP6 \t\t\t\n DUP6 \t\t\t\n DUP6 \t\t\t\n PUSH [tag] 81\t\t\t\n JUMP \t\t\t\n tag 80\t\t\t\n JUMPDEST \t\t\t\n PUSH 1\t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP4 \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 35\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 12\t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP1 \t\t\t\n JUMP \t\t\t\n tag 40\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH [tag] 84\t\t\t\n PUSH [tag] 72\t\t\t\n JUMP \t\t\t\n tag 84\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 85\t\t\t\n DUP2 \t\t\t\n DUP6 \t\t\t\n DUP6 \t\t\t\n PUSH [tag] 86\t\t\t\n DUP6 \t\t\t\n DUP10 \t\t\t\n PUSH [tag] 61\t\t\t\n JUMP \t\t\t\n tag 86\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 87\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 88\t\t\t\n JUMP \t\t\t\n tag 87\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 74\t\t\t\n JUMP \t\t\t\n tag 85\t\t\t\n JUMPDEST \t\t\t\n PUSH 1\t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 45\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n SLOAD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 48\t\t\t\n JUMPDEST \t\t\t\n PUSH 60\t\t\t\n PUSH 4\t\t\t\n DUP1 \t\t\t\n SLOAD \t\t\t\n PUSH [tag] 91\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 65\t\t\t\n JUMP \t\t\t\n tag 91\t\t\t\n JUMPDEST \t\t\t\n DUP1 \t\t\t\n PUSH 1F\t\t\t\n ADD \t\t\t\n PUSH 20\t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n DIV \t\t\t\n MUL \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n PUSH 40\t\t\t\n MSTORE \t\t\t\n DUP1 \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n DUP3 \t\t\t\n DUP1 \t\t\t\n SLOAD \t\t\t\n PUSH [tag] 92\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 65\t\t\t\n JUMP \t\t\t\n tag 92\t\t\t\n JUMPDEST \t\t\t\n DUP1 \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 93\t\t\t\n JUMPI \t\t\t\n DUP1 \t\t\t\n PUSH 1F\t\t\t\n LT \t\t\t\n PUSH [tag] 94\t\t\t\n JUMPI \t\t\t\n PUSH 100\t\t\t\n DUP1 \t\t\t\n DUP4 \t\t\t\n SLOAD \t\t\t\n DIV \t\t\t\n MUL \t\t\t\n DUP4 \t\t\t\n MSTORE \t\t\t\n SWAP2 \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP2 \t\t\t\n PUSH [tag] 93\t\t\t\n JUMP \t\t\t\n tag 94\t\t\t\n JUMPDEST \t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH 0\t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n SWAP1 \t\t\t\n tag 95\t\t\t\n JUMPDEST \t\t\t\n DUP2 \t\t\t\n SLOAD \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n SWAP1 \t\t\t\n PUSH 1\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n DUP1 \t\t\t\n DUP4 \t\t\t\n GT \t\t\t\n PUSH [tag] 95\t\t\t\n JUMPI \t\t\t\n DUP3 \t\t\t\n SWAP1 \t\t\t\n SUB \t\t\t\n PUSH 1F\t\t\t\n AND \t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP2 \t\t\t\n tag 93\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP1 \t\t\t\n JUMP \t\t\t\n tag 52\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH [tag] 97\t\t\t\n PUSH [tag] 72\t\t\t\n JUMP \t\t\t\n tag 97\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 98\t\t\t\n DUP3 \t\t\t\n DUP7 \t\t\t\n PUSH [tag] 61\t\t\t\n JUMP \t\t\t\n tag 98\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP4 \t\t\t\n DUP2 \t\t\t\n LT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 99\t\t\t\n JUMPI \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH 8C379A000000000000000000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 4\t\t\t\n ADD \t\t\t\n PUSH [tag] 100\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 101\t\t\t\n JUMP \t\t\t\n tag 100\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n REVERT \t\t\t\n tag 99\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 102\t\t\t\n DUP3 \t\t\t\n DUP7 \t\t\t\n DUP7 \t\t\t\n DUP5 \t\t\t\n SUB \t\t\t\n PUSH [tag] 74\t\t\t\n JUMP \t\t\t\n tag 102\t\t\t\n JUMPDEST \t\t\t\n PUSH 1\t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 56\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH [tag] 104\t\t\t\n PUSH [tag] 72\t\t\t\n JUMP \t\t\t\n tag 104\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 105\t\t\t\n DUP2 \t\t\t\n DUP6 \t\t\t\n DUP6 \t\t\t\n PUSH [tag] 81\t\t\t\n JUMP \t\t\t\n tag 105\t\t\t\n JUMPDEST \t\t\t\n PUSH 1\t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 61\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 1\t\t\t\n PUSH 0\t\t\t\n DUP5 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n SLOAD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 72\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n CALLER \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP1 \t\t\t\n JUMP \t\t\t\n tag 74\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP4 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n SUB \t\t\t\n PUSH [tag] 109\t\t\t\n JUMPI \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH 8C379A000000000000000000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 4\t\t\t\n ADD \t\t\t\n PUSH [tag] 110\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 111\t\t\t\n JUMP \t\t\t\n tag 110\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n REVERT \t\t\t\n tag 109\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP3 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n SUB \t\t\t\n PUSH [tag] 112\t\t\t\n JUMPI \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH 8C379A000000000000000000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 4\t\t\t\n ADD \t\t\t\n PUSH [tag] 113\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 114\t\t\t\n JUMP \t\t\t\n tag 113\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n REVERT \t\t\t\n tag 112\t\t\t\n JUMPDEST \t\t\t\n DUP1 \t\t\t\n PUSH 1\t\t\t\n PUSH 0\t\t\t\n DUP6 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n PUSH 0\t\t\t\n DUP5 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n SSTORE \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP4 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH 8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925\t\t\t\n DUP4 \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 115\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 28\t\t\t\n JUMP \t\t\t\n tag 115\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n LOG3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 79\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 117\t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n PUSH [tag] 61\t\t\t\n JUMP \t\t\t\n tag 117\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n DUP2 \t\t\t\n EQ \t\t\t\n PUSH [tag] 118\t\t\t\n JUMPI \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n LT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 119\t\t\t\n JUMPI \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH 8C379A000000000000000000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 4\t\t\t\n ADD \t\t\t\n PUSH [tag] 120\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 121\t\t\t\n JUMP \t\t\t\n tag 120\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n REVERT \t\t\t\n tag 119\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 122\t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n SUB \t\t\t\n PUSH [tag] 74\t\t\t\n JUMP \t\t\t\n tag 122\t\t\t\n JUMPDEST \t\t\t\n tag 118\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 81\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP4 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n SUB \t\t\t\n PUSH [tag] 124\t\t\t\n JUMPI \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH 8C379A000000000000000000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 4\t\t\t\n ADD \t\t\t\n PUSH [tag] 125\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 126\t\t\t\n JUMP \t\t\t\n tag 125\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n REVERT \t\t\t\n tag 124\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP3 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n SUB \t\t\t\n PUSH [tag] 127\t\t\t\n JUMPI \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH 8C379A000000000000000000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 4\t\t\t\n ADD \t\t\t\n PUSH [tag] 128\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 129\t\t\t\n JUMP \t\t\t\n tag 128\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n REVERT \t\t\t\n tag 127\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 130\t\t\t\n DUP4 \t\t\t\n DUP4 \t\t\t\n DUP4 \t\t\t\n PUSH [tag] 131\t\t\t\n JUMP \t\t\t\n tag 130\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH 0\t\t\t\n DUP6 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n SLOAD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n LT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 132\t\t\t\n JUMPI \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH 8C379A000000000000000000000000000000000000000000000000000000000\t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 4\t\t\t\n ADD \t\t\t\n PUSH [tag] 133\t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 134\t\t\t\n JUMP \t\t\t\n tag 133\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n REVERT \t\t\t\n tag 132\t\t\t\n JUMPDEST \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n DUP7 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n SSTORE \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n DUP6 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n DUP2 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n ADD \t\t\t\n PUSH 0\t\t\t\n KECCAK256 \t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n DUP3 \t\t\t\n SLOAD \t\t\t\n ADD \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n SSTORE \t\t\t\n POP \t\t\t\n DUP3 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n DUP5 \t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n AND \t\t\t\n PUSH DDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF\t\t\t\n DUP5 \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n PUSH [tag] 135\t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n PUSH [tag] 28\t\t\t\n JUMP \t\t\t\n tag 135\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n MLOAD \t\t\t\n DUP1 \t\t\t\n SWAP2 \t\t\t\n SUB \t\t\t\n SWAP1 \t\t\t\n LOG3 \t\t\t\n PUSH [tag] 136\t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n PUSH [tag] 137\t\t\t\n JUMP \t\t\t\n tag 136\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 131\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 137\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 140\t\t\t-License-Identifier: MIT\\nprag...\n JUMPDEST \t\t\t-License-Identifier: MIT\\nprag...\n PUSH 0\t\t\tport \"\n DUP2 \t\t\t2/tok\n MLOAD \t\t\ts@4.9.2/toke\n SWAP1 \t\t\tn/contracts@4.9.2/toke\n POP \t\t\tn/contracts@4.9.2/toke\n SWAP2 \t\t\t-License-Identifier: MIT\\nprag...\n SWAP1 \t\t\t-License-Identifier: MIT\\nprag...\n POP \t\t\t-License-Identifier: MIT\\nprag...\n JUMP \t\t\t-License-Identifier: MIT\\nprag...\n tag 141\t\t\t.sol\";\\n\\ncontract ERC20Token ...\n JUMPDEST \t\t\t.sol\";\\n\\ncontract ERC20Token ...\n PUSH 0\t\t\t) {}\\n}\\n\n DUP3 \t\t\t\n DUP3 \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t.sol\";\\n\\ncontract ERC20Token ...\n SWAP2 \t\t\t.sol\";\\n\\ncontract ERC20Token ...\n POP \t\t\t.sol\";\\n\\ncontract ERC20Token ...\n POP \t\t\t.sol\";\\n\\ncontract ERC20Token ...\n JUMP \t\t\t.sol\";\\n\\ncontract ERC20Token ...\n tag 142\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n tag 180\t\t\t\n JUMPDEST \t\t\t\n DUP4 \t\t\t\n DUP2 \t\t\t\n LT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 182\t\t\t\n JUMPI \t\t\t\n DUP1 \t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MLOAD \t\t\t\n DUP2 \t\t\t\n DUP5 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH 20\t\t\t\n DUP2 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 180\t\t\t\n JUMP \t\t\t\n tag 182\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP5 \t\t\t\n DUP5 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 143\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 1F\t\t\t\n NOT \t\t\t\n PUSH 1F\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n AND \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 144\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 185\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 140\t\t\t\n JUMP \t\t\t\n tag 185\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 186\t\t\t\n DUP2 \t\t\t\n DUP6 \t\t\t\n PUSH [tag] 141\t\t\t\n JUMP \t\t\t\n tag 186\t\t\t\n JUMPDEST \t\t\t\n SWAP4 \t\t\t\n POP \t\t\t\n PUSH [tag] 187\t\t\t\n DUP2 \t\t\t\n DUP6 \t\t\t\n PUSH 20\t\t\t\n DUP7 \t\t\t\n ADD \t\t\t\n PUSH [tag] 142\t\t\t\n JUMP \t\t\t\n tag 187\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 188\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 143\t\t\t\n JUMP \t\t\t\n tag 188\t\t\t\n JUMPDEST \t\t\t\n DUP5 \t\t\t\n ADD \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 18\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH [tag] 190\t\t\t\n DUP2 \t\t\t\n DUP5 \t\t\t\n PUSH [tag] 144\t\t\t\n JUMP \t\t\t\n tag 190\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 146\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n REVERT \t\t\t\n tag 148\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\t\t\t\n DUP3 \t\t\t\n AND \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 149\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 196\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 148\t\t\t\n JUMP \t\t\t\n tag 196\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 150\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 198\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 149\t\t\t\n JUMP \t\t\t\n tag 198\t\t\t\n JUMPDEST \t\t\t\n DUP2 \t\t\t\n EQ \t\t\t\n PUSH [tag] 199\t\t\t\n JUMPI \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n REVERT \t\t\t\n tag 199\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 151\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP2 \t\t\t\n CALLDATALOAD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 201\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 150\t\t\t\n JUMP \t\t\t\n tag 201\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 152\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 153\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 204\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 152\t\t\t\n JUMP \t\t\t\n tag 204\t\t\t\n JUMPDEST \t\t\t\n DUP2 \t\t\t\n EQ \t\t\t\n PUSH [tag] 205\t\t\t\n JUMPI \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n REVERT \t\t\t\n tag 205\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 154\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP2 \t\t\t\n CALLDATALOAD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 207\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 153\t\t\t\n JUMP \t\t\t\n tag 207\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 21\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH 40\t\t\t\n DUP4 \t\t\t\n DUP6 \t\t\t\n SUB \t\t\t\n SLT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 209\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 210\t\t\t\n PUSH [tag] 146\t\t\t\n JUMP \t\t\t\n tag 210\t\t\t\n JUMPDEST \t\t\t\n tag 209\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 211\t\t\t\n DUP6 \t\t\t\n DUP3 \t\t\t\n DUP7 \t\t\t\n ADD \t\t\t\n PUSH [tag] 151\t\t\t\n JUMP \t\t\t\n tag 211\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n PUSH 20\t\t\t\n PUSH [tag] 212\t\t\t\n DUP6 \t\t\t\n DUP3 \t\t\t\n DUP7 \t\t\t\n ADD \t\t\t\n PUSH [tag] 154\t\t\t\n JUMP \t\t\t\n tag 212\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 155\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP2 \t\t\t\n ISZERO \t\t\t\n ISZERO \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 156\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 215\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 155\t\t\t\n JUMP \t\t\t\n tag 215\t\t\t\n JUMPDEST \t\t\t\n DUP3 \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 24\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 217\t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n DUP5 \t\t\t\n PUSH [tag] 156\t\t\t\n JUMP \t\t\t\n tag 217\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 157\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 219\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 152\t\t\t\n JUMP \t\t\t\n tag 219\t\t\t\n JUMPDEST \t\t\t\n DUP3 \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 28\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 221\t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n DUP5 \t\t\t\n PUSH [tag] 157\t\t\t\n JUMP \t\t\t\n tag 221\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 31\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH 0\t\t\t\n PUSH 60\t\t\t\n DUP5 \t\t\t\n DUP7 \t\t\t\n SUB \t\t\t\n SLT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 223\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 224\t\t\t\n PUSH [tag] 146\t\t\t\n JUMP \t\t\t\n tag 224\t\t\t\n JUMPDEST \t\t\t\n tag 223\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 225\t\t\t\n DUP7 \t\t\t\n DUP3 \t\t\t\n DUP8 \t\t\t\n ADD \t\t\t\n PUSH [tag] 151\t\t\t\n JUMP \t\t\t\n tag 225\t\t\t\n JUMPDEST \t\t\t\n SWAP4 \t\t\t\n POP \t\t\t\n POP \t\t\t\n PUSH 20\t\t\t\n PUSH [tag] 226\t\t\t\n DUP7 \t\t\t\n DUP3 \t\t\t\n DUP8 \t\t\t\n ADD \t\t\t\n PUSH [tag] 151\t\t\t\n JUMP \t\t\t\n tag 226\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n PUSH 40\t\t\t\n PUSH [tag] 227\t\t\t\n DUP7 \t\t\t\n DUP3 \t\t\t\n DUP8 \t\t\t\n ADD \t\t\t\n PUSH [tag] 154\t\t\t\n JUMP \t\t\t\n tag 227\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n JUMP \t\t\t\n tag 158\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH FF\t\t\t\n DUP3 \t\t\t\n AND \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 159\t\t\t\n JUMPDEST \t\t\t\n PUSH [tag] 230\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 158\t\t\t\n JUMP \t\t\t\n tag 230\t\t\t\n JUMPDEST \t\t\t\n DUP3 \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 37\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH [tag] 232\t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n DUP5 \t\t\t\n PUSH [tag] 159\t\t\t\n JUMP \t\t\t\n tag 232\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 44\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n DUP5 \t\t\t\n SUB \t\t\t\n SLT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 234\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 235\t\t\t\n PUSH [tag] 146\t\t\t\n JUMP \t\t\t\n tag 235\t\t\t\n JUMPDEST \t\t\t\n tag 234\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 236\t\t\t\n DUP5 \t\t\t\n DUP3 \t\t\t\n DUP6 \t\t\t\n ADD \t\t\t\n PUSH [tag] 151\t\t\t\n JUMP \t\t\t\n tag 236\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 60\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n DUP1 \t\t\t\n PUSH 40\t\t\t\n DUP4 \t\t\t\n DUP6 \t\t\t\n SUB \t\t\t\n SLT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 238\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 239\t\t\t\n PUSH [tag] 146\t\t\t\n JUMP \t\t\t\n tag 239\t\t\t\n JUMPDEST \t\t\t\n tag 238\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 240\t\t\t\n DUP6 \t\t\t\n DUP3 \t\t\t\n DUP7 \t\t\t\n ADD \t\t\t\n PUSH [tag] 151\t\t\t\n JUMP \t\t\t\n tag 240\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n POP \t\t\t\n PUSH 20\t\t\t\n PUSH [tag] 241\t\t\t\n DUP6 \t\t\t\n DUP3 \t\t\t\n DUP7 \t\t\t\n ADD \t\t\t\n PUSH [tag] 151\t\t\t\n JUMP \t\t\t\n tag 241\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n SWAP3 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 160\t\t\t\n JUMPDEST \t\t\t\n PUSH 4E487B7100000000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 0\t\t\t\n MSTORE \t\t\t\n PUSH 22\t\t\t\n PUSH 4\t\t\t\n MSTORE \t\t\t\n PUSH 24\t\t\t\n PUSH 0\t\t\t\n REVERT \t\t\t\n tag 65\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 2\t\t\t\n DUP3 \t\t\t\n DIV \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n PUSH 1\t\t\t\n DUP3 \t\t\t\n AND \t\t\t\n DUP1 \t\t\t\n PUSH [tag] 244\t\t\t\n JUMPI \t\t\t\n PUSH 7F\t\t\t\n DUP3 \t\t\t\n AND \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n tag 244\t\t\t\n JUMPDEST \t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n LT \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH [tag] 245\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 246\t\t\t\n PUSH [tag] 160\t\t\t\n JUMP \t\t\t\n tag 246\t\t\t\n JUMPDEST \t\t\t\n tag 245\t\t\t\n JUMPDEST \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 161\t\t\t\n JUMPDEST \t\t\t\n PUSH 4E487B7100000000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 0\t\t\t\n MSTORE \t\t\t\n PUSH 11\t\t\t\n PUSH 4\t\t\t\n MSTORE \t\t\t\n PUSH 24\t\t\t\n PUSH 0\t\t\t\n REVERT \t\t\t\n tag 88\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 249\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 152\t\t\t\n JUMP \t\t\t\n tag 249\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH [tag] 250\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 152\t\t\t\n JUMP \t\t\t\n tag 250\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n POP \t\t\t\n DUP3 \t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP1 \t\t\t\n DUP3 \t\t\t\n GT \t\t\t\n ISZERO \t\t\t\n PUSH [tag] 251\t\t\t\n JUMPI \t\t\t\n PUSH [tag] 252\t\t\t\n PUSH [tag] 161\t\t\t\n JUMP \t\t\t\n tag 252\t\t\t\n JUMPDEST \t\t\t\n tag 251\t\t\t\n JUMPDEST \t\t\t\n SWAP3 \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 162\t\t\t\n JUMPDEST \t\t\t\n PUSH 45524332303A2064656372656173656420616C6C6F77616E63652062656C6F77\t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH 207A65726F000000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 163\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 255\t\t\t\n PUSH 25\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 141\t\t\t\n JUMP \t\t\t\n tag 255\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH [tag] 256\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 162\t\t\t\n JUMP \t\t\t\n tag 256\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 101\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH [tag] 258\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 163\t\t\t\n JUMP \t\t\t\n tag 258\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 164\t\t\t\n JUMPDEST \t\t\t\n PUSH 45524332303A20617070726F76652066726F6D20746865207A65726F20616464\t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH 7265737300000000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 165\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 261\t\t\t\n PUSH 24\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 141\t\t\t\n JUMP \t\t\t\n tag 261\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH [tag] 262\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 164\t\t\t\n JUMP \t\t\t\n tag 262\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 111\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH [tag] 264\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 165\t\t\t\n JUMP \t\t\t\n tag 264\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 166\t\t\t\n JUMPDEST \t\t\t\n PUSH 45524332303A20617070726F766520746F20746865207A65726F206164647265\t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH 7373000000000000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 167\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 267\t\t\t\n PUSH 22\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 141\t\t\t\n JUMP \t\t\t\n tag 267\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH [tag] 268\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 166\t\t\t\n JUMP \t\t\t\n tag 268\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 114\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH [tag] 270\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 167\t\t\t\n JUMP \t\t\t\n tag 270\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 168\t\t\t\n JUMPDEST \t\t\t\n PUSH 45524332303A20696E73756666696369656E7420616C6C6F77616E6365000000\t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 169\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 273\t\t\t\n PUSH 1D\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 141\t\t\t\n JUMP \t\t\t\n tag 273\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH [tag] 274\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 168\t\t\t\n JUMP \t\t\t\n tag 274\t\t\t\n JUMPDEST \t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 121\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH [tag] 276\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 169\t\t\t\n JUMP \t\t\t\n tag 276\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 170\t\t\t\n JUMPDEST \t\t\t\n PUSH 45524332303A207472616E736665722066726F6D20746865207A65726F206164\t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH 6472657373000000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 171\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 279\t\t\t\n PUSH 25\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 141\t\t\t\n JUMP \t\t\t\n tag 279\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH [tag] 280\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 170\t\t\t\n JUMP \t\t\t\n tag 280\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 126\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH [tag] 282\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 171\t\t\t\n JUMP \t\t\t\n tag 282\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 172\t\t\t\n JUMPDEST \t\t\t\n PUSH 45524332303A207472616E7366657220746F20746865207A65726F2061646472\t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH 6573730000000000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 173\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 285\t\t\t\n PUSH 23\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 141\t\t\t\n JUMP \t\t\t\n tag 285\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH [tag] 286\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 172\t\t\t\n JUMP \t\t\t\n tag 286\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 129\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH [tag] 288\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 173\t\t\t\n JUMP \t\t\t\n tag 288\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 174\t\t\t\n JUMPDEST \t\t\t\n PUSH 45524332303A207472616E7366657220616D6F756E7420657863656564732062\t\t\t\n PUSH 0\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH 616C616E63650000000000000000000000000000000000000000000000000000\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 175\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH [tag] 291\t\t\t\n PUSH 26\t\t\t\n DUP4 \t\t\t\n PUSH [tag] 141\t\t\t\n JUMP \t\t\t\n tag 291\t\t\t\n JUMPDEST \t\t\t\n SWAP2 \t\t\t\n POP \t\t\t\n PUSH [tag] 292\t\t\t\n DUP3 \t\t\t\n PUSH [tag] 174\t\t\t\n JUMP \t\t\t\n tag 292\t\t\t\n JUMPDEST \t\t\t\n PUSH 40\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n tag 134\t\t\t\n JUMPDEST \t\t\t\n PUSH 0\t\t\t\n PUSH 20\t\t\t\n DUP3 \t\t\t\n ADD \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n DUP2 \t\t\t\n DUP2 \t\t\t\n SUB \t\t\t\n PUSH 0\t\t\t\n DUP4 \t\t\t\n ADD \t\t\t\n MSTORE \t\t\t\n PUSH [tag] 294\t\t\t\n DUP2 \t\t\t\n PUSH [tag] 175\t\t\t\n JUMP \t\t\t\n tag 294\t\t\t\n JUMPDEST \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n SWAP2 \t\t\t\n SWAP1 \t\t\t\n POP \t\t\t\n JUMP \t\t\t\n .data\n" -} diff --git a/resources/testing/erc20/MyToken.json b/resources/testing/erc20/MyToken.json deleted file mode 100644 index 54d0cdc..0000000 --- a/resources/testing/erc20/MyToken.json +++ /dev/null @@ -1,286 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "MyToken", - "sourceName": "contracts/MyToken.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60806040523480156200001157600080fd5b506040518060400160405280600781526020017f4d79546f6b656e000000000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f4d544b000000000000000000000000000000000000000000000000000000000081525081600390816200008f9190620004e3565b508060049081620000a19190620004e3565b505050620000e333620000b9620000e960201b60201c565b600a620000c791906200075a565b620186a0620000d79190620007ab565b620000f260201b60201c565b620008e2565b60006012905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160362000164576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015b9062000857565b60405180910390fd5b62000178600083836200025f60201b60201c565b80600260008282546200018c919062000879565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200023f9190620008c5565b60405180910390a36200025b600083836200026460201b60201c565b5050565b505050565b505050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620002eb57607f821691505b602082108103620003015762000300620002a3565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200036b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200032c565b6200037786836200032c565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003c4620003be620003b8846200038f565b62000399565b6200038f565b9050919050565b6000819050919050565b620003e083620003a3565b620003f8620003ef82620003cb565b84845462000339565b825550505050565b600090565b6200040f62000400565b6200041c818484620003d5565b505050565b5b8181101562000444576200043860008262000405565b60018101905062000422565b5050565b601f82111562000493576200045d8162000307565b62000468846200031c565b8101602085101562000478578190505b6200049062000487856200031c565b83018262000421565b50505b505050565b600082821c905092915050565b6000620004b86000198460080262000498565b1980831691505092915050565b6000620004d38383620004a5565b9150826002028217905092915050565b620004ee8262000269565b67ffffffffffffffff8111156200050a576200050962000274565b5b620005168254620002d2565b6200052382828562000448565b600060209050601f8311600181146200055b576000841562000546578287015190505b620005528582620004c5565b865550620005c2565b601f1984166200056b8662000307565b60005b8281101562000595578489015182556001820191506020850194506020810190506200056e565b86831015620005b55784890151620005b1601f891682620004a5565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b6001851115620006585780860481111562000630576200062f620005ca565b5b6001851615620006405780820291505b80810290506200065085620005f9565b945062000610565b94509492505050565b60008262000673576001905062000746565b8162000683576000905062000746565b81600181146200069c5760028114620006a757620006dd565b600191505062000746565b60ff841115620006bc57620006bb620005ca565b5b8360020a915084821115620006d657620006d5620005ca565b5b5062000746565b5060208310610133831016604e8410600b8410161715620007175782820a905083811115620007115762000710620005ca565b5b62000746565b62000726848484600162000606565b9250905081840481111562000740576200073f620005ca565b5b81810290505b9392505050565b600060ff82169050919050565b600062000767826200038f565b915062000774836200074d565b9250620007a37fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848462000661565b905092915050565b6000620007b8826200038f565b9150620007c5836200038f565b9250828202620007d5816200038f565b91508282048414831517620007ef57620007ee620005ca565b5b5092915050565b600082825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b60006200083f601f83620007f6565b91506200084c8262000807565b602082019050919050565b60006020820190508181036000830152620008728162000830565b9050919050565b600062000886826200038f565b915062000893836200038f565b9250828201905080821115620008ae57620008ad620005ca565b5b92915050565b620008bf816200038f565b82525050565b6000602082019050620008dc6000830184620008b4565b92915050565b61122f80620008f26000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea2646970667358221220c56149fa14ed9e77f1de4833061cf8013c3bb8906a1ed91d58298b6e075a5c6764736f6c63430008120033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea2646970667358221220c56149fa14ed9e77f1de4833061cf8013c3bb8906a1ed91d58298b6e075a5c6764736f6c63430008120033", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/resources/testing/erc20/abi.json b/resources/testing/erc20/abi.json deleted file mode 100644 index ecdde3c..0000000 --- a/resources/testing/erc20/abi.json +++ /dev/null @@ -1,277 +0,0 @@ -[ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] From 264119068ab33a0dc84ed28e5718632c2b0eef1b Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:06:41 -0300 Subject: [PATCH 34/75] Update README Still needs more updates --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 9a83376..d172ee7 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,42 @@ - [Run the Simple Transfer Example](#run-the-simple-transfer-example) - [Conclusion](#conclusion) +## Features + +### Low-Level API + +| Feature | Status | +| ------- | ------ | +| Deposit ETH to ETH base chain | ✔️ | +| Deposit ETH to ERC20 base chain | 🏗️ | +| Deposit ERC20 to ETH base chain | 🏗️ | +| Deposit ERC20 to other ERC20 base chain | 🏗️ | +| Deposit ERC20 to same ERC20 base chain | 🏗️ | +| Withdraw ETH from ETH base chain | ✔️ | +| Withdraw ETH from ERC20 base chain | 🏗️ | +| Withdraw ERC20 from ETH base chain | 🏗️ | +| Withdraw ERC20 from other ERC20 base chain | 🏗️ | +| Withdraw ERC20 from same ERC20 base chain | 🏗️ | +| Transfer ETH | ❌ | +| Transfer ERC20 | ❌ | + +### ZKwallet + +| Feature | Status | +| ------- | ------ | +| Deposit ETH to ETH base chain | ❌ | +| Deposit ETH to ERC20 base chain | ❌ | +| Deposit ERC20 to ETH base chain | ❌ | +| Deposit ERC20 to other ERC20 base chain | ❌ | +| Deposit ERC20 to same ERC20 base chain | ❌ | +| Withdraw ETH from ETH base chain | ❌ | +| Withdraw ETH from ERC20 base chain | ❌ | +| Withdraw ERC20 from ETH base chain | ❌ | +| Withdraw ERC20 from other ERC20 base chain | ❌ | +| Withdraw ERC20 from same ERC20 base chain | ❌ | +| Transfer ETH | ❌ | +| Transfer ERC20 | ❌ | + ## Getting Started with zkSync Web3 SDK While most of the existing SDKs should work out of the box, deploying smart contracts or using unique zkSync features, like account abstraction, requires providing additional fields to those that Ethereum transactions have by default. From 87b5dd42ad59cdc9dce66d3cf1f2661a23c34264 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:07:02 -0300 Subject: [PATCH 35/75] Update deposit --- src/deposit/mod.rs | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/deposit/mod.rs b/src/deposit/mod.rs index 5202a19..7d71026 100644 --- a/src/deposit/mod.rs +++ b/src/deposit/mod.rs @@ -70,7 +70,21 @@ where .await } // Depositing ETH to a ZKChain whose base token is not ETH. - (true, false) => todo!(), + (true, false) => { + let erc20 = ERC20::new(token, Arc::>::clone(&from)); + deposit_non_base_erc20_token( + amount, + token, + from, + to, + refund_recipient, + l2_provider, + bridgehub, + erc20, + false, + ) + .await + } // We are depositing an ERC20 to a ZKChain where: // 1. ETH is the base token. // 2. An ERC20 different than the deposited is the base token. @@ -407,3 +421,25 @@ pub fn scale_gas_limit(gas_limit: U256) -> U256 { .checked_div(U256::from(L1_FEE_ESTIMATION_COEF_DENOMINATOR)) .unwrap() } + +pub async fn wait_for_finalize_deposit( + finalize_deposit_tx_hash: Hash, + l2_provider: &L2Provider, +) where + L2Provider: ZKMiddleware + Middleware, +{ + loop { + if l2_provider + .get_transaction_details(finalize_deposit_tx_hash) + .await + .unwrap() + .unwrap() + .eth_execute_tx_hash + .is_some() + { + break; + } + println!("Finalize deposit request not executed on L1 yet. Retrying in 5 seconds..."); + tokio::time::sleep(std::time::Duration::from_secs(5)).await; + } +} From 6f6ba00a4c1078fe9ca7baa6bbd78c2edeb2efba Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:07:30 -0300 Subject: [PATCH 36/75] Remove withdraw tests from withdraw module --- src/withdraw.rs | 109 +----------------------------------------------- 1 file changed, 2 insertions(+), 107 deletions(-) diff --git a/src/withdraw.rs b/src/withdraw.rs index fc45085..cf8d3ac 100644 --- a/src/withdraw.rs +++ b/src/withdraw.rs @@ -23,7 +23,7 @@ pub async fn withdraw( amount: U256, token: impl Into
, from: Arc>, - l1_provider: Arc, + l1_provider: M, ) -> Hash where M: Middleware, @@ -33,7 +33,7 @@ where let token: Address = token.into(); let bridgehub_address = from.get_bridgehub_contract().await.unwrap(); - let bridgehub = Bridgehub::new(bridgehub_address, l1_provider); + let bridgehub = Bridgehub::new(bridgehub_address, Arc::new(l1_provider)); let zk_chain_id = from.get_chainid().await.unwrap(); let zk_chain_base_token: Address = bridgehub.base_token(zk_chain_id).call().await.unwrap(); @@ -219,108 +219,3 @@ where finalize_withdrawal_tx_receipt.transaction_hash } - -#[cfg(test)] -mod withdraw_tests { - use crate::{ - utils::L2_ETH_TOKEN_ADDRESS, - withdraw::{finalize_withdrawal, wait_for_finalize_withdrawal, withdraw}, - }; - use ethers::{ - abi::Address, - middleware::SignerMiddleware, - providers::{Http, Middleware, Provider, ProviderExt}, - signers::{LocalWallet, Signer}, - types::U256, - }; - use std::{str::FromStr, sync::Arc}; - - #[tokio::test] - async fn can_withdraw_eth_from_eth_based_chain() { - let l2_provider = Provider::::connect("http://zksync-devnet-03:3050").await; - let zk_chain_id = l2_provider.get_chainid().await.unwrap().as_u64(); - let from = Arc::new(SignerMiddleware::, LocalWallet>::new( - l2_provider, - LocalWallet::from_str( - "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", - ) - .unwrap() - .with_chain_id(zk_chain_id), - )); - - let l1_provider = Provider::::connect("http://eth-sepolia").await; - let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); - let to = Arc::new(SignerMiddleware::, LocalWallet>::new( - l1_provider, - LocalWallet::from_str( - "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", - ) - .unwrap() - .with_chain_id(l1_chain_id), - )); - - let amount: U256 = ethers::utils::parse_units("0.01", "ether").unwrap().into(); - - let withdrawal_tx_hash = withdraw( - amount, - Address::from_str("0x74Bc16333Df68581324ebF3172a4dEba5D1ADd6c").unwrap(), - Arc::clone(&from), - Arc::new(to.provider().clone()), - ) - .await; - - println!("http://zksync-devnet-03:3011/tx/{withdrawal_tx_hash:?}"); - - wait_for_finalize_withdrawal(withdrawal_tx_hash, from.provider()).await; - - let finalize_withdrawal_l1_tx_hash = - finalize_withdrawal(to, withdrawal_tx_hash, from.provider()).await; - - println!("https://sepolia.etherscan.io/tx/{finalize_withdrawal_l1_tx_hash:?}"); - } - - #[tokio::test] - async fn can_withdraw_2() { - let l2_provider = - Provider::::connect("https://dev.rpc.sepolia.shyft.lambdaclass.com").await; - let zk_chain_id = l2_provider.get_chainid().await.unwrap().as_u64(); - let from = Arc::new(SignerMiddleware::, LocalWallet>::new( - l2_provider, - LocalWallet::from_str( - "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", - ) - .unwrap() - .with_chain_id(zk_chain_id), - )); - - let l1_provider = Provider::::connect("http://eth-sepolia").await; - let l1_chain_id = l1_provider.get_chainid().await.unwrap().as_u64(); - let to = Arc::new(SignerMiddleware::, LocalWallet>::new( - l1_provider, - LocalWallet::from_str( - "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924", - ) - .unwrap() - .with_chain_id(l1_chain_id), - )); - - let amount: U256 = ethers::utils::parse_units("0.01", "ether").unwrap().into(); - - let withdrawal_tx_hash = withdraw( - amount, - L2_ETH_TOKEN_ADDRESS, - Arc::clone(&from), - Arc::new(to.provider().clone()), - ) - .await; - - println!("https://dev.explorer.sepolia.shyft.lambdaclass.com/tx/{withdrawal_tx_hash:?}"); - - wait_for_finalize_withdrawal(withdrawal_tx_hash, from.provider()).await; - - let finalize_withdrawal_l1_tx_hash = - finalize_withdrawal(to, withdrawal_tx_hash, from.provider()).await; - - println!("https://sepolia.etherscan.io/tx/{finalize_withdrawal_l1_tx_hash:?}"); - } -} From 42839a970b07142d841fea9f9f5be379ba10106e Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:07:49 -0300 Subject: [PATCH 37/75] Implement missing JSON-RPC API methods --- src/zk_middleware.rs | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/src/zk_middleware.rs b/src/zk_middleware.rs index f011579..04a12d2 100644 --- a/src/zk_middleware.rs +++ b/src/zk_middleware.rs @@ -4,6 +4,7 @@ use serde::Serialize; use serde_json::json; use std::{collections::HashMap, fmt::Debug, time::Duration}; use tokio::time::Instant; +use zksync_types::{api::ProtocolVersion, fee_model::FeeParams}; use ethers::{ abi::HumanReadableParser, @@ -112,7 +113,7 @@ pub trait ZKMiddleware { /// Returns data pertaining to a given batch. async fn get_l1_batch_details(&self, batch: T) -> Result where - T: Into + Send + Sync + Serialize + Debug; + T: Into + Send + Sync + Serialize + Debug; /// Given a transaction hash, and an index of the L2 to L1 log produced within the /// transaction, it returns the proof for the corresponding L2 to L1 log. @@ -171,6 +172,18 @@ pub trait ZKMiddleware { /// Retrieves the L1 base token address. async fn get_base_token_l1_address(&self) -> Result; + /// Returns the current L1 gas price in hexadecimal format, representing the amount of wei per unit of gas. + async fn get_l1_gas_price(&self) -> Result; + + /// Retrieves the current fee parameters. + async fn get_fee_params(&self) -> Result; + + /// Gets the protocol version. + async fn get_protocol_version( + &self, + id: Option, + ) -> Result, Self::Error>; + /// Returns debug trace of all executed calls contained in a block given by its L2 hash. async fn debug_trace_block_by_hash( &self, @@ -348,7 +361,7 @@ where async fn get_l1_batch_details(&self, batch: T) -> Result where - T: Into + Send + Sync + Serialize + Debug, + T: Into + Send + Sync + Serialize + Debug, { self.provider() .request("zks_getL1BatchDetails", [batch]) @@ -451,6 +464,30 @@ where .map_err(M::convert_err) } + async fn get_l1_gas_price(&self) -> Result { + self.provider() + .request("zks_getL1GasPrice", ()) + .await + .map_err(M::convert_err) + } + + async fn get_fee_params(&self) -> Result { + self.provider() + .request("zks_getFeeParams", ()) + .await + .map_err(M::convert_err) + } + + async fn get_protocol_version( + &self, + id: Option, + ) -> Result, Self::Error> { + self.provider() + .request("zks_getProtocolVersion", [id]) + .await + .map_err(M::convert_err) + } + async fn send_raw_transaction_with_detailed_output( &self, tx: Bytes, From c7d365970e475778f18be96bb10d881e468c009c Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:08:21 -0300 Subject: [PATCH 38/75] Update test helpers --- tests/common/mod.rs | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index fedfe46..919e19c 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,30 +1,36 @@ use std::{str::FromStr, sync::Arc}; use ethers::{ - abi::{Abi, Address, Hash}, + abi::{Address, Hash}, prelude::SignerMiddleware, providers::{Http, Middleware, Provider, ProviderExt}, signers::{LocalWallet, Signer}, - types::{Bytes, U256, U64}, + types::{U256, U64}, }; -use serde::Deserialize; use zksync_ethers_rs::{ utils::{L1_ETH_TOKEN_ADDRESS, L2_ETH_TOKEN_ADDRESS}, ZKMiddleware, }; -#[derive(Deserialize)] -pub struct CompiledContract { - pub abi: Abi, - pub bin: Bytes, +pub const L2_RPC_URL: &str = "http://127.0.0.1:3050"; +pub const L2_EXPLORER_URL: &str = "http://127.0.0.1:3010"; +pub const L1_EXPLORER_URL: &str = ""; +pub const L1_RPC_URL: &str = "http://127.0.0.1:8545"; + +pub fn l1_explorer_url() -> String { + std::env::var("L1_EXPLORER_URL").unwrap_or(L1_EXPLORER_URL.to_owned()) +} + +pub fn l2_explorer_url() -> String { + std::env::var("L2_EXPLORER_URL").unwrap_or(L2_EXPLORER_URL.to_owned()) } pub async fn l1_provider() -> Provider { - Provider::::connect("http://eth-sepolia").await + Provider::::connect(&std::env::var("L1_RPC_URL").unwrap_or(L1_RPC_URL.to_owned())).await } pub async fn l2_provider() -> Provider { - Provider::::connect("https://k8s.rpc.sepolia.shyft.lambdaclass.com").await + Provider::::connect(&std::env::var("L2_RPC_URL").unwrap_or(L2_RPC_URL.to_owned())).await } pub async fn signer( @@ -33,9 +39,11 @@ pub async fn signer( let chain_id = provider.get_chainid().await.unwrap().as_u64(); Arc::new(SignerMiddleware::, LocalWallet>::new( provider, - LocalWallet::from_str("0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924") - .unwrap() - .with_chain_id(chain_id), + LocalWallet::from_str(&std::env::var("PRIVATE_KEY").unwrap_or( + "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924".to_owned(), + )) + .unwrap() + .with_chain_id(chain_id), )) } From 62ef75ba151a9e7b854e4e0e9169e5672f5ddb6a Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:08:37 -0300 Subject: [PATCH 39/75] Update deposit tests --- tests/deposit.rs | 100 +++++++++++++---------------------------------- 1 file changed, 28 insertions(+), 72 deletions(-) diff --git a/tests/deposit.rs b/tests/deposit.rs index 7a07f0a..13fdaef 100644 --- a/tests/deposit.rs +++ b/tests/deposit.rs @@ -1,11 +1,15 @@ -use common::{assert_tx_succeeded, balance_of, l1_provider, l1_signer, l2_provider}; +use common::{ + assert_tx_succeeded, balance_of, l1_explorer_url, l1_provider, l1_signer, l2_explorer_url, + l2_provider, L1_EXPLORER_URL, L2_EXPLORER_URL, +}; use ethers::{ abi::Address, middleware::SignerMiddleware, providers::Middleware, signers::Signer, types::U256, }; use std::{str::FromStr, sync::Arc}; use zksync_ethers_rs::{ - deposit::{deposit, l2_deposit_tx_hash}, + deposit::{deposit, l2_deposit_tx_hash, wait_for_finalize_deposit}, utils::L2_ETH_TOKEN_ADDRESS, + ZKMiddleware, }; mod common; @@ -17,11 +21,11 @@ where { let refund_recipient = from.address(); let l2_provider = l2_provider().await; - let amount: U256 = ethers::utils::parse_units("0.001", "ether").unwrap().into(); + let amount = ethers::utils::parse_ether("0.001").unwrap().into(); let receiver_l2_balance_before = balance_of(to, token, &l2_provider).await; - let deposit_tx_hash = deposit( + let l1_tx_hash = deposit( amount, token, Arc::clone(&from), @@ -31,99 +35,51 @@ where ) .await; - println!("https://sepolia.etherscan.io/tx/{deposit_tx_hash:?}",); + println!("{}/tx/{l1_tx_hash:?}", l1_explorer_url()); - assert_tx_succeeded(deposit_tx_hash, from.provider(), "L1 transaction failed").await; + assert_tx_succeeded(l1_tx_hash, from.provider(), "L1 transaction failed").await; - let l2_tx_hash = l2_deposit_tx_hash(deposit_tx_hash, from.provider()).await; + let l2_tx_hash = l2_deposit_tx_hash(l1_tx_hash, from.provider()).await; - println!("https://explorer.sepolia.shyft.lambdaclass.com/tx/{l2_tx_hash:?}"); + println!("{}/tx/{l2_tx_hash:?}", l2_explorer_url()); assert_tx_succeeded(l2_tx_hash, &l2_provider, "L2 transaction failed").await; + wait_for_finalize_deposit(l2_tx_hash, &l2_provider).await; + let receiver_l2_balance_after = balance_of(to, token, &l2_provider).await; assert_eq!( - receiver_l2_balance_after, receiver_l2_balance_before + amount, - "Receiver's L2 balance has not increased by the deposited amount." + receiver_l2_balance_after, + "Receiver's L2 balance has not increased by the deposited amount. Before: {receiver_l2_balance_before}, After: {receiver_l2_balance_after}, Amount: {amount}" ); } #[tokio::test] -async fn can_self_deposit_eth_to_eth_based_zk_chain() { +async fn can_deposit_eth() { let from = l1_signer().await; - let to = from.address(); + let to = Address::random(); can_deposit(L2_ETH_TOKEN_ADDRESS, from, to).await; } #[tokio::test] -async fn can_self_deposit_erc20_to_eth_based_zk_chain() { +async fn can_deposit_erc20() { let some_erc20 = Address::from_str("0x7209EaD3dfe1c3a517B6b730C00bea1E7f319260").unwrap(); - let from = l1_signer().await; - let to = from.address(); - can_deposit(some_erc20, from, to).await; -} - -#[tokio::test] -#[ignore = "unimplemented"] -async fn can_self_deposit_eth_to_erc20_based_zk_chain() {} -#[tokio::test] -#[ignore = "unimplemented"] -async fn can_self_deposit_erc20_to_same_erc20_based_zk_chain() { - let from = l1_signer().await; - let to = from.address(); - let ihc_token = Address::from_str("0xd0580192e98ea6ceb9c7b6191ed2e27560911697").unwrap(); - can_deposit(ihc_token, from, to).await; -} - -#[tokio::test] -#[ignore = "unimplemented"] -async fn can_self_deposit_erc20_to_different_erc20_based_zk_chain() {} - -#[tokio::test] -#[ignore = "unimplemented"] -async fn can_deposit_eth_to_eth_based_zk_chain_to_other_account() { let from = l1_signer().await; - let to = Address::from_str("0x01bdD706463BC3A556a7efD8497A5b008D77dc71").unwrap(); - can_deposit(L2_ETH_TOKEN_ADDRESS, from, to).await; -} - -#[tokio::test] -#[ignore = "unimplemented"] -async fn can_deposit_erc20_to_eth_based_zk_chain_to_other_account() { - let some_erc20 = Address::from_str("0x7209EaD3dfe1c3a517B6b730C00bea1E7f319260").unwrap(); - let from = l1_signer().await; - let to = Address::from_str("0x01bdD706463BC3A556a7efD8497A5b008D77dc71").unwrap(); + let to = Address::random(); can_deposit(some_erc20, from, to).await; } #[tokio::test] -#[ignore = "unimplemented"] -async fn can_deposit_eth_to_erc20_based_zk_chain_to_other_account() {} - -#[tokio::test] -#[ignore = "unimplemented"] -async fn can_deposit_erc20_to_same_erc20_based_zk_chain_to_other_account() {} - -#[tokio::test] -#[ignore = "unimplemented"] -async fn can_deposit_erc20_to_different_erc20_based_zk_chain_to_other_account() {} - -#[tokio::test] -async fn testito() { - let l1_provider = l1_provider().await; - let l2_provider = l2_provider().await; - - println!( - "{:?}", - l2_deposit_tx_hash( - "0x1ba39e2ca832d5fedaf92d46220bd2582048c7e69c4a20ba74555b9ce94d5485" - .parse() - .unwrap(), - &l1_provider - ) +async fn can_deposit_base_token() { + let from = l1_signer().await; + let to = Address::random(); + let l1_base_token_address = l2_provider() .await - ); + .get_base_token_l1_address() + .await + .unwrap(); + can_deposit(l1_base_token_address, from, to).await; } From 061be3db47717d1d9524ac81102e281eb1d5cd5c Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:10:11 -0300 Subject: [PATCH 40/75] Add withdraw tests --- tests/withdraw.rs | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 tests/withdraw.rs diff --git a/tests/withdraw.rs b/tests/withdraw.rs new file mode 100644 index 0000000..77c7692 --- /dev/null +++ b/tests/withdraw.rs @@ -0,0 +1,74 @@ +use common::{ + assert_tx_succeeded, balance_of, l1_explorer_url, l1_signer, l2_explorer_url, l2_signer, + L1_EXPLORER_URL, L2_EXPLORER_URL, +}; +use ethers::{ + abi::Address, + middleware::SignerMiddleware, + providers::{Http, Middleware, Provider}, + signers::LocalWallet, + types::U256, +}; +use std::{str::FromStr, sync::Arc}; +use zksync_ethers_rs::{ + finalize_withdrawal, utils::L2_ETH_TOKEN_ADDRESS, wait_for_finalize_withdrawal, + withdraw::withdraw, ZKMiddleware, +}; + +mod common; + +async fn can_withdraw( + token: Address, + from: Arc, LocalWallet>>, + to: Arc, LocalWallet>>, +) { + let amount: U256 = ethers::utils::parse_units("0.001", "ether").unwrap().into(); + + let receiver_l1_balance_before = to.provider().get_balance(to.address(), None).await.unwrap(); + + let l2_tx_hash = withdraw(amount, token, Arc::clone(&from), to.provider().clone()).await; + + println!("{}/tx/{l2_tx_hash:?}", l2_explorer_url()); + + assert_tx_succeeded(l2_tx_hash, from.provider(), "L2 transaction failed").await; + + wait_for_finalize_withdrawal(l2_tx_hash, from.provider()).await; + + let l1_tx_hash = finalize_withdrawal(Arc::clone(&to), l2_tx_hash, from.provider()).await; + + println!("{}/tx/{l1_tx_hash}", l1_explorer_url()); + + assert_tx_succeeded(l1_tx_hash, to.provider(), "L1 transaction failed").await; + + let receiver_l1_balance_after = to.provider().get_balance(to.address(), None).await.unwrap(); + + assert_eq!( + receiver_l1_balance_after, + receiver_l1_balance_before + amount, + "Receiver's L1 balance has not increased by the withdraw amount. Before: {receiver_l1_balance_before}, After: {receiver_l1_balance_after}, Amount: {amount}" + ); +} + +#[tokio::test] +async fn can_withdraw_eth() { + let from = l2_signer().await; + let to = l1_signer().await; + can_withdraw(L2_ETH_TOKEN_ADDRESS, from, to).await; +} + +#[tokio::test] +async fn can_withdraw_erc20() { + let some_erc20 = Address::from_str("0x7209EaD3dfe1c3a517B6b730C00bea1E7f319260").unwrap(); + + let from = l2_signer().await; + let to = l1_signer().await; + can_withdraw(some_erc20, from, to).await; +} + +#[tokio::test] +async fn can_withdraw_base_token() { + let from = l2_signer().await; + let to = l1_signer().await; + let l1_base_token_address = from.provider().get_base_token_l1_address().await.unwrap(); + can_withdraw(l1_base_token_address, from, to).await; +} From ca4c4caede8c79502c7b0e74b47d9c73da0111e4 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 00:12:54 -0300 Subject: [PATCH 41/75] Cleanup --- src/types.rs | 3 +-- tests/deposit.rs | 7 ++----- tests/withdraw.rs | 5 +---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/types.rs b/src/types.rs index 51fdc93..eaf9e5b 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,5 +1,3 @@ -use ::ethers::{abi::Address, types::U256}; - pub mod zksync { pub use zksync_system_constants::*; pub use zksync_types::*; @@ -9,6 +7,7 @@ pub mod zksync { pub mod ethers { pub use ethers::types::*; } +pub use ethers::*; #[derive(Debug, Clone, Default)] pub struct L1TxOverrides { diff --git a/tests/deposit.rs b/tests/deposit.rs index 13fdaef..b488602 100644 --- a/tests/deposit.rs +++ b/tests/deposit.rs @@ -1,10 +1,7 @@ use common::{ - assert_tx_succeeded, balance_of, l1_explorer_url, l1_provider, l1_signer, l2_explorer_url, - l2_provider, L1_EXPLORER_URL, L2_EXPLORER_URL, -}; -use ethers::{ - abi::Address, middleware::SignerMiddleware, providers::Middleware, signers::Signer, types::U256, + assert_tx_succeeded, balance_of, l1_explorer_url, l1_signer, l2_explorer_url, l2_provider, }; +use ethers::{abi::Address, middleware::SignerMiddleware, providers::Middleware, signers::Signer}; use std::{str::FromStr, sync::Arc}; use zksync_ethers_rs::{ deposit::{deposit, l2_deposit_tx_hash, wait_for_finalize_deposit}, diff --git a/tests/withdraw.rs b/tests/withdraw.rs index 77c7692..6ebd6fd 100644 --- a/tests/withdraw.rs +++ b/tests/withdraw.rs @@ -1,7 +1,4 @@ -use common::{ - assert_tx_succeeded, balance_of, l1_explorer_url, l1_signer, l2_explorer_url, l2_signer, - L1_EXPLORER_URL, L2_EXPLORER_URL, -}; +use common::{assert_tx_succeeded, l1_explorer_url, l1_signer, l2_explorer_url, l2_signer}; use ethers::{ abi::Address, middleware::SignerMiddleware, From ed3111b0e096c91bce5a0f1856edd12fad19901e Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 14:00:36 -0300 Subject: [PATCH 42/75] Cleanup deposit --- src/deposit/mod.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/deposit/mod.rs b/src/deposit/mod.rs index 7d71026..d8f26a7 100644 --- a/src/deposit/mod.rs +++ b/src/deposit/mod.rs @@ -65,7 +65,6 @@ where zk_chain_id, l2_provider, bridgehub, - token_to_deposit_is_eth, ) .await } @@ -81,7 +80,6 @@ where l2_provider, bridgehub, erc20, - false, ) .await } @@ -99,14 +97,12 @@ where l2_provider, bridgehub, erc20, - false, ) .await } } } -/// Deposit ETH to a ZKChain whose base token is ETH. pub async fn deposit_base_token( amount: U256, token: Address, @@ -116,7 +112,6 @@ pub async fn deposit_base_token( zk_chain_id: U256, l2_provider: &L2Provider, bridgehub: Bridgehub>, - token_is_eth: bool, ) -> Hash where M: Middleware, @@ -246,7 +241,6 @@ pub async fn deposit_non_base_erc20_token( l2_provider: &L2Provider, bridgehub: Bridgehub>, erc20: ERC20>, - token_to_deposit_is_zk_chain_base_token: bool, ) -> Hash where M: Middleware, From 7679e83a09c47779fbec731cb6a5afe0af51ded0 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 14:00:44 -0300 Subject: [PATCH 43/75] Refactor withdraw --- src/withdraw.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/withdraw.rs b/src/withdraw.rs index cf8d3ac..40161fc 100644 --- a/src/withdraw.rs +++ b/src/withdraw.rs @@ -19,15 +19,16 @@ use crate::{ ZKMiddleware, }; -pub async fn withdraw( +pub async fn withdraw( amount: U256, token: impl Into
, from: Arc>, - l1_provider: M, + l1_provider: &L1Provider, ) -> Hash where M: Middleware, S: Signer, + L1Provider: Middleware, { // The type is converted to avoid adding Copy as a constraint bound (Address is Copy). let token: Address = token.into(); From e50234635fe2af62024f44eec5934b38a7fe0ae8 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 14:00:54 -0300 Subject: [PATCH 44/75] Add transfer low-level module --- src/lib.rs | 4 ++- src/transfer.rs | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 src/transfer.rs diff --git a/src/lib.rs b/src/lib.rs index e1350ea..fe72a28 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,8 +50,10 @@ pub mod contracts; pub mod eip712; pub mod deposit; +pub use deposit::*; pub mod withdraw; -pub use withdraw::{finalize_withdrawal, wait_for_finalize_withdrawal, withdraw}; +pub use withdraw::*; +pub mod transfer; pub mod zk_middleware; pub mod zk_wallet; diff --git a/src/transfer.rs b/src/transfer.rs new file mode 100644 index 0000000..a0cfa79 --- /dev/null +++ b/src/transfer.rs @@ -0,0 +1,89 @@ +// FIXME: Remove this after finishing the implementation. +#![allow(clippy::unwrap_used)] + +use ethers::{ + abi::{Address, Hash}, + middleware::SignerMiddleware, + providers::Middleware, + signers::Signer, + types::U256, +}; +use std::sync::Arc; +use zksync_types::L2_BASE_TOKEN_ADDRESS; + +use crate::{ + contracts::{bridgehub::Bridgehub, erc20::ERC20, l2_eth::BaseToken}, + ZKMiddleware, +}; + +pub async fn transfer( + amount: U256, + token: impl Into
, + from: Arc>, + to: Address, +) -> Hash +where + M: Middleware, + S: Signer, +{ + // The type is converted to avoid adding Copy as a constraint bound (Address is Copy). + let token: Address = token.into(); + + let bridgehub_address = from.provider().get_bridgehub_contract().await.unwrap(); + let bridgehub = Bridgehub::new( + bridgehub_address, + Arc::>::clone(&from), + ); + + let zk_chain_id = from.provider().get_chainid().await.unwrap(); + let zk_chain_base_token: Address = bridgehub.base_token(zk_chain_id).call().await.unwrap(); + + let token_to_transfer_is_zk_chain_base_token = token == zk_chain_base_token; + + if token_to_transfer_is_zk_chain_base_token { + transfer_base_token(amount, from, to).await + } else { + transfer_non_base_token(amount, token, from, to).await + } +} + +pub async fn transfer_base_token( + amount: U256, + from: Arc>, + to: Address, +) -> Hash +where + M: Middleware, + S: Signer, +{ + let base_token_transfer_receipt = BaseToken::new(L2_BASE_TOKEN_ADDRESS, Arc::clone(&from)) + .transfer_from_to(from.address(), to, amount) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap(); + base_token_transfer_receipt.transaction_hash +} + +pub async fn transfer_non_base_token( + amount: U256, + token: Address, + from: Arc>, + to: Address, +) -> Hash +where + M: Middleware, + S: Signer, +{ + let non_base_token_transfer_receipt = ERC20::new(token, Arc::clone(&from)) + .transfer(to, amount) + .send() + .await + .unwrap() + .await + .unwrap() + .unwrap(); + non_base_token_transfer_receipt.transaction_hash +} From 6671dc12df6c8012001c472a3eaca5eb6853db94 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 14:01:07 -0300 Subject: [PATCH 45/75] Fix withdraw tests --- tests/withdraw.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/withdraw.rs b/tests/withdraw.rs index 6ebd6fd..b0b0a1e 100644 --- a/tests/withdraw.rs +++ b/tests/withdraw.rs @@ -23,7 +23,7 @@ async fn can_withdraw( let receiver_l1_balance_before = to.provider().get_balance(to.address(), None).await.unwrap(); - let l2_tx_hash = withdraw(amount, token, Arc::clone(&from), to.provider().clone()).await; + let l2_tx_hash = withdraw(amount, token, Arc::clone(&from), to.provider()).await; println!("{}/tx/{l2_tx_hash:?}", l2_explorer_url()); From 8f8157d0aa36fefd1735501b3f33bcd35732788e Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 14:01:19 -0300 Subject: [PATCH 46/75] Add `ZKWallet` implementation --- src/zk_wallet.rs | 397 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 374 insertions(+), 23 deletions(-) diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index 5511a72..93b88b1 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -1,46 +1,397 @@ use ethers::{ abi::{Address, Hash}, - providers::{Middleware, MiddlewareError}, + middleware::SignerMiddleware, + providers::{Middleware, Provider}, signers::Signer, types::U256, }; +use std::sync::Arc; -use crate::ZKMiddleware; +use crate::{deposit, transfer, utils::L2_ETH_TOKEN_ADDRESS, withdraw}; -#[async_trait::async_trait] -pub trait ZKWallet { - type L1Error: MiddlewareError< - Inner = <::Inner as Middleware>::Error, - >; - type L2Error: MiddlewareError< - Inner = <::Inner as ZKMiddleware>::Error, - >; - type L1Signer: Middleware + Signer; - type L2Signer: ZKMiddleware + Signer; +#[derive(thiserror::Error, Debug)] +pub enum ZKWalletError { + #[error("Provider error: {0}")] + ProviderError(#[from] ethers::providers::ProviderError), +} + +/// A ZKsync wallet +pub struct ZKWallet { + l1_signer: Arc>, + l2_signer: Arc>, +} + +impl ZKWallet +where + M: Middleware, + S: Signer, +{ + pub fn new(l1_signer: SignerMiddleware, l2_signer: SignerMiddleware) -> Self { + Self { + l1_signer: Arc::new(l1_signer), + l2_signer: Arc::new(l2_signer), + } + } + + /// Deposits ETH to the wallet's L2 address. + /// + /// # Arguments + /// + /// * `amount` - The amount of ETH to deposit. + /// + /// # Returns + /// + /// The hash of the L1 deposit transaction. + /// + /// # Errors + /// + /// If the deposit transaction fails. + pub async fn deposit_eth(&self, amount: U256) -> Result { + self._deposit(amount, L2_ETH_TOKEN_ADDRESS, self.l2_address()) + .await + } - async fn deposit(&self, amount: U256) -> Result; + /// Deposits ETH to a specified address. + /// + /// # Arguments + /// + /// * `amount` - The amount of ETH to deposit. + /// * `to` - The address to deposit the ETH to. + /// + /// # Returns + /// + /// The hash of the L1 deposit transaction. + /// + /// # Errors + /// + /// If the deposit transaction fails. + pub async fn deposit_eth_to(&self, amount: U256, to: Address) -> Result { + self._deposit(amount, L2_ETH_TOKEN_ADDRESS, to).await + } - async fn finalize_deposit(&self) -> Result; + /// Deposits an ERC20 token to the wallet's L2 address. + /// + /// # Arguments + /// + /// * `amount` - The amount of the ERC20 token to deposit. + /// * `token` - The address of the ERC20 token to deposit. + /// + /// # Returns + /// + /// The hash of the L1 deposit transaction. + /// + /// # Errors + /// + /// If the deposit transaction fails. + pub async fn deposit_erc20(&self, amount: U256, token: Address) -> Result { + self._deposit(amount, token, self.l2_address()).await + } - async fn withdraw(&self, amount: U256) -> Result<(), Self::L2Error>; + /// Deposits an ERC20 token to a specified address. + /// + /// # Arguments + /// + /// * `amount` - The amount of the ERC20 token to deposit. + /// * `token` - The address of the ERC20 token to deposit. + /// * `to` - The address to deposit the ERC20 token to. + /// + /// # Returns + /// + /// The hash of the L1 deposit transaction. + /// + /// # Errors + /// + /// If the deposit transaction fails. + pub async fn deposit_erc20_to( + &self, + amount: U256, + token: Address, + to: Address, + ) -> Result { + self._deposit(amount, token, to).await + } - async fn finalize_withdraw(&self) -> Result; + /// Withdraws ETH from the wallet's L2 address. + /// + /// # Arguments + /// + /// * `amount` - The amount of ETH to withdraw. + /// + /// # Returns + /// + /// The hash of the L2 withdrawal transaction. + /// + /// # Errors + /// + /// If the withdrawal transaction fails. + /// + /// # Note + /// + /// The withdrawal must be finalized before the funds are available on L1. + /// Use `finalize_withdraw` to finalize the withdrawal. + pub async fn withdraw_eth(&self, amount: U256) -> Result { + self._withdraw(amount, L2_ETH_TOKEN_ADDRESS).await + } - async fn transfer(&self, to: Address, amount: U256) -> Result; + /// Withdraws an ERC20 token from the wallet's L2 address. + /// + /// # Arguments + /// + /// * `amount` - The amount of the ERC20 token to withdraw. + /// * `token` - The address of the ERC20 token to withdraw. + /// + /// # Returns + /// + /// The hash of the L2 withdrawal transaction. + /// + /// # Errors + /// + /// If the withdrawal transaction fails. + /// + /// # Note + /// + /// The withdrawal must be finalized before the funds are available on L1. + /// Use `finalize_withdraw` to finalize the withdrawal. + pub async fn withdraw_erc20( + &self, + amount: U256, + token: Address, + ) -> Result { + self._withdraw(amount, token).await + } + + /// Finalizes a withdrawal. + /// + /// # Arguments + /// + /// * `l2_withdrawal_tx_hash` - The hash of the L2 withdrawal transaction. + /// + /// # Returns + /// + /// The hash of the L1 withdrawal transaction. + /// + /// # Errors + /// + /// If the finalization transaction fails. + /// + /// # Note + /// + /// The withdrawal must be initiated before finalization. + /// Use any of the available withdraw methods to initiate the withdrawal. + pub async fn finalize_withdraw( + &self, + l2_withdrawal_tx_hash: Hash, + ) -> Result { + let l1_withdrawal_hash = withdraw::finalize_withdrawal( + self.l1_signer(), + l2_withdrawal_tx_hash, + self.l2_provider(), + ) + .await; + Ok(l1_withdrawal_hash) + } + + /// Transfers ETH to a specified address. + /// The ETH is transferred from the wallet's L2 address. + /// The transfer is done using the wallet's L2 signer. + /// + /// # Arguments + /// + /// * `amount` - The amount of ETH to transfer. + /// * `to` - The address to transfer the ETH to. + /// + /// # Returns + /// + /// The hash of the transfer transaction. + /// + /// # Errors + /// + /// If the transfer transaction fails. + pub async fn transfer_eth(&self, amount: U256, to: Address) -> Result { + self._transfer(amount, L2_ETH_TOKEN_ADDRESS, to).await + } + + /// Transfers an ERC20 token to a specified address. + /// The ERC20 token is transferred from the wallet's L2 address. + /// The transfer is done using the wallet's L2 signer. + /// + /// # Arguments + /// + /// * `amount` - The amount of the ERC20 token to transfer. + /// * `token` - The address of the ERC20 token to transfer. + /// * `to` - The address to transfer the ERC20 token to. + /// + /// # Returns + /// + /// The hash of the transfer transaction. + /// + /// # Errors + /// + /// If the transfer transaction fails. + pub async fn transfer_erc20( + &self, + amount: U256, + token: Address, + to: Address, + ) -> Result { + self._transfer(amount, token, to).await + } /* L1 Signer Getters */ - async fn l1_nonce(&self) -> Result; + /// Gets the nonce of the wallet's L1 address. + /// + /// # Returns + /// + /// The nonce of the wallet's L1 address. + /// + /// # Errors + /// + /// If the nonce cannot be retrieved. + pub async fn l1_nonce(&self) -> Result { + let nonce = self + .l1_provider() + .get_transaction_count(self.l1_address(), None) + .await?; + Ok(nonce) + } - async fn l1_balance(&self) -> Result; + /// Gets the balance of the wallet's L1 address. + /// + /// # Returns + /// + /// The balance of the wallet's L1 address. + /// + /// # Errors + /// + /// If the balance cannot be retrieved. + pub async fn l1_balance(&self) -> Result { + unimplemented!() + } - async fn l1_address(&self) -> Result; + /// Gets the wallet's L1 address. + /// + /// # Returns + /// + /// The wallet's L1 address. + pub fn l1_address(&self) -> Address { + self.l1_signer.address() + } /* L2 Signer Getters */ - async fn l2_nonce(&self) -> Result; + /// Gets the nonce of the wallet's L2 address. + /// + /// # Returns + /// + /// The nonce of the wallet's L2 address. + /// + /// # Errors + /// + /// If the nonce cannot be retrieved. + pub async fn l2_nonce(&self) -> Result { + let nonce = self + .l2_provider() + .get_transaction_count(self.l2_address(), None) + .await?; + Ok(nonce) + } + + /// Gets the balance of the wallet's L2 address. + /// + /// # Returns + /// + /// The balance of the wallet's L2 address. + /// + /// # Errors + /// + /// If the balance cannot be retrieved. + pub async fn l2_balance(&self) -> Result { + unimplemented!() + } + + /// Gets the wallet's L2 address. + /// + /// # Returns + /// + /// The wallet's L2 address. + pub fn l2_address(&self) -> Address { + self.l2_signer.address() + } + + /* Providers */ + + /// Gets the wallet's L1 provider. + /// + /// # Returns + /// + /// A reference to the wallet's L1 provider. + pub fn l1_provider(&self) -> &Provider<::Provider> { + self.l1_signer.provider() + } + + /// Gets the wallet's L2 provider. + /// + /// # Returns + /// + /// A reference to the wallet's L2 provider. + pub fn l2_provider(&self) -> &Provider<::Provider> { + self.l2_signer.provider() + } + + /* Signers */ + + /// Gets the wallet's L1 signer. + /// + /// # Returns + /// + /// An ARC reference to the wallet's L1 signer. + pub fn l1_signer(&self) -> Arc> { + self.l1_signer.clone() + } + + /// Gets the wallet's L2 signer. + /// + /// # Returns + /// + /// An ARC reference to the wallet's L2 signer. + pub fn l2_signer(&self) -> Arc> { + self.l2_signer.clone() + } + + /* Internals */ + + async fn _deposit( + &self, + amount: U256, + token: Address, + to: Address, + ) -> Result { + let l1_deposit_hash = deposit::deposit( + amount, + token, + self.l1_signer(), + to, + self.l1_address(), + self.l2_provider(), + ) + .await; + Ok(l1_deposit_hash) + } - async fn l2_balance(&self) -> Result; + async fn _withdraw(&self, amount: U256, token: Address) -> Result { + let l2_withdraw_hash = + withdraw::withdraw(amount, token, self.l2_signer(), self.l1_provider()).await; + Ok(l2_withdraw_hash) + } - async fn l2_address(&self) -> Result; + pub async fn _transfer( + &self, + amount: U256, + token: Address, + to: Address, + ) -> Result { + let transfer_hash = transfer::transfer(amount, token, self.l2_signer(), to).await; + Ok(transfer_hash) + } } From dddd9c32f596fee9bdd8ee136fef8e56102cbf92 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 15:18:40 -0300 Subject: [PATCH 47/75] Implement deposit, withdraw, and transfers of base token --- src/zk_wallet.rs | 75 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index 93b88b1..b0720cd 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -7,7 +7,7 @@ use ethers::{ }; use std::sync::Arc; -use crate::{deposit, transfer, utils::L2_ETH_TOKEN_ADDRESS, withdraw}; +use crate::{deposit, transfer, utils::L2_ETH_TOKEN_ADDRESS, withdraw, ZKMiddleware}; #[derive(thiserror::Error, Debug)] pub enum ZKWalletError { @@ -87,6 +87,29 @@ where self._deposit(amount, token, self.l2_address()).await } + /// Deposits the L2's base token from the L1 account. + /// + /// # Arguments + /// + /// * `amount` - The amount of the base token to deposit. + /// + /// # Returns + /// + /// The hash of the L1 deposit transaction. + /// + /// # Errors + /// + /// * If the deposit transaction fails. + /// * If the base token L1 address cannot be retrieved. + pub async fn deposit_base_token(&self, amount: U256) -> Result { + self._deposit( + amount, + self._l1_base_token_address().await?, + self.l2_address(), + ) + .await + } + /// Deposits an ERC20 token to a specified address. /// /// # Arguments @@ -160,6 +183,25 @@ where self._withdraw(amount, token).await } + /// Withdraws the L2's base token to the L1 account. + /// + /// # Arguments + /// + /// * `amount` - The amount of the base token to withdraw. + /// + /// # Returns + /// + /// The hash of the L2 withdrawal transaction. + /// + /// # Errors + /// + /// * If the withdrawal transaction fails. + /// * If the base token L1 address cannot be retrieved. + pub async fn withdraw_base_token(&self, amount: U256) -> Result { + self._withdraw(amount, self._l1_base_token_address().await?) + .await + } + /// Finalizes a withdrawal. /// /// # Arguments @@ -237,6 +279,30 @@ where self._transfer(amount, token, to).await } + /// Transfers the L2's base token to a specified address. + /// + /// # Arguments + /// + /// * `amount` - The amount of the base token to transfer. + /// * `to` - The address to transfer the base token to. + /// + /// # Returns + /// + /// The hash of the transfer transaction. + /// + /// # Errors + /// + /// * If the transfer transaction fails. + /// * If the base token L1 address cannot be retrieved. + pub async fn transfer_base_token( + &self, + amount: U256, + to: Address, + ) -> Result { + self._transfer(amount, self._l1_base_token_address().await?, to) + .await + } + /* L1 Signer Getters */ /// Gets the nonce of the wallet's L1 address. @@ -394,4 +460,11 @@ where let transfer_hash = transfer::transfer(amount, token, self.l2_signer(), to).await; Ok(transfer_hash) } + + pub async fn _l1_base_token_address(&self) -> Result { + self.l2_provider() + .get_base_token_l1_address() + .await + .map_err(Into::into) + } } From 528fa378b286fab7dd0917c6a0c256473557345d Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 15:23:54 -0300 Subject: [PATCH 48/75] Implement deposit_base_token_to for ZKWallet --- src/zk_wallet.rs | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index b0720cd..9680cde 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -87,6 +87,30 @@ where self._deposit(amount, token, self.l2_address()).await } + /// Deposits an ERC20 token to a specified address. + /// + /// # Arguments + /// + /// * `amount` - The amount of the ERC20 token to deposit. + /// * `token` - The address of the ERC20 token to deposit. + /// * `to` - The address to deposit the ERC20 token to. + /// + /// # Returns + /// + /// The hash of the L1 deposit transaction. + /// + /// # Errors + /// + /// If the deposit transaction fails. + pub async fn deposit_erc20_to( + &self, + amount: U256, + token: Address, + to: Address, + ) -> Result { + self._deposit(amount, token, to).await + } + /// Deposits the L2's base token from the L1 account. /// /// # Arguments @@ -110,13 +134,12 @@ where .await } - /// Deposits an ERC20 token to a specified address. + /// Deposits the L2's base token to a specified address. /// /// # Arguments /// - /// * `amount` - The amount of the ERC20 token to deposit. - /// * `token` - The address of the ERC20 token to deposit. - /// * `to` - The address to deposit the ERC20 token to. + /// * `amount` - The amount of the base token to deposit. + /// * `to` - The address to deposit the base token to. /// /// # Returns /// @@ -124,14 +147,15 @@ where /// /// # Errors /// - /// If the deposit transaction fails. - pub async fn deposit_erc20_to( + /// * If the deposit transaction fails. + /// * If the base token L1 address cannot be retrieved. + pub async fn deposit_base_token_to( &self, amount: U256, - token: Address, to: Address, ) -> Result { - self._deposit(amount, token, to).await + self._deposit(amount, self._l1_base_token_address().await?, to) + .await } /// Withdraws ETH from the wallet's L2 address. From fe08fc0ed17db5bc16b06237969c9f4bbbb061c7 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 21:04:34 -0300 Subject: [PATCH 49/75] Refactor deposit --- src/deposit/mod.rs | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/deposit/mod.rs b/src/deposit/mod.rs index d8f26a7..7d8574f 100644 --- a/src/deposit/mod.rs +++ b/src/deposit/mod.rs @@ -131,20 +131,18 @@ where .await .unwrap(); let l2_gas_per_pubdata_byte_limit = U256::from(utils::REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT); - let l2_costs = { - let operator_tip = U256::zero(); - let base_cost: U256 = bridgehub - .l_2_transaction_base_cost( - zk_chain_id, - from.get_gas_price().await.unwrap(), - estimate_l1_to_l2_gas, - l2_gas_per_pubdata_byte_limit, - ) - .call() - .await - .unwrap(); - base_cost + operator_tip + amount - }; + let operator_tip = U256::zero(); + let base_cost: U256 = bridgehub + .l_2_transaction_base_cost( + zk_chain_id, + from.get_gas_price().await.unwrap(), + estimate_l1_to_l2_gas, + l2_gas_per_pubdata_byte_limit, + ) + .call() + .await + .unwrap(); + let l2_costs = base_cost + operator_tip + amount; // There's no need to override l2_calldata for depositing ETH into an // ETH based chain. @@ -180,7 +178,7 @@ where // overrides. if allowance < amount { erc20 - .approve(l1_shared_bridge_address, amount) + .approve(l1_shared_bridge_address, amount * 2) .send() .await .unwrap() @@ -357,7 +355,7 @@ where pub async fn l2_deposit_tx_hash( l1_deposit_tx_hash: Hash, l1_provider: &L1Provider, -) -> Hash +) -> Option where L1Provider: Middleware, { @@ -378,7 +376,6 @@ where .into()) }) .map(|new_priority_request_event| Hash::from_slice(&new_priority_request_event.data.0[32..64])) - .unwrap() } pub async fn l2_tx_base_cost( From 1c9992664af4783b40c9ff8b3fccda4e12f57c6e Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 21:04:56 -0300 Subject: [PATCH 50/75] Fix base token transfers --- src/transfer.rs | 44 ++++++++++++++++++++++++++------------------ src/zk_wallet.rs | 4 ++-- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/transfer.rs b/src/transfer.rs index a0cfa79..d277fb7 100644 --- a/src/transfer.rs +++ b/src/transfer.rs @@ -6,14 +6,14 @@ use ethers::{ middleware::SignerMiddleware, providers::Middleware, signers::Signer, - types::U256, + types::{transaction::eip2718::TypedTransaction, Eip1559TransactionRequest, U256}, }; use std::sync::Arc; -use zksync_types::L2_BASE_TOKEN_ADDRESS; +use zksync_types::{L2_BASE_TOKEN_ADDRESS, MAX_L2_TX_GAS_LIMIT}; use crate::{ - contracts::{bridgehub::Bridgehub, erc20::ERC20, l2_eth::BaseToken}, - ZKMiddleware, + contracts::erc20::ERC20, + utils::{MAX_FEE_PER_GAS, MAX_PRIORITY_FEE_PER_GAS}, }; pub async fn transfer( @@ -29,16 +29,7 @@ where // The type is converted to avoid adding Copy as a constraint bound (Address is Copy). let token: Address = token.into(); - let bridgehub_address = from.provider().get_bridgehub_contract().await.unwrap(); - let bridgehub = Bridgehub::new( - bridgehub_address, - Arc::>::clone(&from), - ); - - let zk_chain_id = from.provider().get_chainid().await.unwrap(); - let zk_chain_base_token: Address = bridgehub.base_token(zk_chain_id).call().await.unwrap(); - - let token_to_transfer_is_zk_chain_base_token = token == zk_chain_base_token; + let token_to_transfer_is_zk_chain_base_token = token == L2_BASE_TOKEN_ADDRESS; if token_to_transfer_is_zk_chain_base_token { transfer_base_token(amount, from, to).await @@ -56,15 +47,32 @@ where M: Middleware, S: Signer, { - let base_token_transfer_receipt = BaseToken::new(L2_BASE_TOKEN_ADDRESS, Arc::clone(&from)) - .transfer_from_to(from.address(), to, amount) - .send() + let mut transfer_tx = Eip1559TransactionRequest::new() + .from(from.address()) + .to(to) + .value(amount) + .nonce( + from.get_transaction_count(from.address(), None) + .await + .unwrap(), + ); + // let fee = from.estimate_fee(transfer_tx.clone()).await.unwrap(); + transfer_tx = transfer_tx + .max_fee_per_gas(MAX_FEE_PER_GAS) + .max_priority_fee_per_gas(MAX_PRIORITY_FEE_PER_GAS) + .gas(MAX_L2_TX_GAS_LIMIT); + + let tx: TypedTransaction = transfer_tx.into(); + + let transfer_receipt = from + .send_transaction(tx, None) .await .unwrap() .await .unwrap() .unwrap(); - base_token_transfer_receipt.transaction_hash + + transfer_receipt.transaction_hash } pub async fn transfer_non_base_token( diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index 9680cde..dbea109 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -6,6 +6,7 @@ use ethers::{ types::U256, }; use std::sync::Arc; +use zksync_types::L2_BASE_TOKEN_ADDRESS; use crate::{deposit, transfer, utils::L2_ETH_TOKEN_ADDRESS, withdraw, ZKMiddleware}; @@ -323,8 +324,7 @@ where amount: U256, to: Address, ) -> Result { - self._transfer(amount, self._l1_base_token_address().await?, to) - .await + self._transfer(amount, L2_BASE_TOKEN_ADDRESS, to).await } /* L1 Signer Getters */ From 50e66827f0113c8d572828befc88b8d67e0b1907 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 21:05:04 -0300 Subject: [PATCH 51/75] Update test --- tests/deposit.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/deposit.rs b/tests/deposit.rs index b488602..04a4892 100644 --- a/tests/deposit.rs +++ b/tests/deposit.rs @@ -36,7 +36,9 @@ where assert_tx_succeeded(l1_tx_hash, from.provider(), "L1 transaction failed").await; - let l2_tx_hash = l2_deposit_tx_hash(l1_tx_hash, from.provider()).await; + let l2_tx_hash = l2_deposit_tx_hash(l1_tx_hash, from.provider()) + .await + .unwrap(); println!("{}/tx/{l2_tx_hash:?}", l2_explorer_url()); From 23942ec64c4c254396ada11d6f9fc17ec6bf866f Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 13 Aug 2024 21:05:12 -0300 Subject: [PATCH 52/75] Remove old tests --- tests/wallet_tests.rs | 605 ------------------------ tests/zk_middleware_tests.rs | 883 ----------------------------------- 2 files changed, 1488 deletions(-) delete mode 100644 tests/wallet_tests.rs delete mode 100644 tests/zk_middleware_tests.rs diff --git a/tests/wallet_tests.rs b/tests/wallet_tests.rs deleted file mode 100644 index 8627beb..0000000 --- a/tests/wallet_tests.rs +++ /dev/null @@ -1,605 +0,0 @@ -// use crate::zk_middleware::ZKMiddleware; -// use crate::zks_wallet::{DeployRequest, TransferRequest, WithdrawRequest, ZKSWallet}; -// use ethers::contract::abigen; -// use ethers::providers::Middleware; -// use ethers::signers::{LocalWallet, Signer}; -// use ethers::types::Address; -// use ethers::types::U256; -// use ethers::utils::parse_units; -// use std::fs::File; -// use std::path::PathBuf; -// use std::str::FromStr; -// use zksync_types::DEFAULT_ERA_CHAIN_ID; - -// abigen!( -// ERC20Token, -// r#"[ -// balanceOf(address)(uint256) -// ]"# -// ); - -// #[tokio::test] -// async fn test_transfer() { -// let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; -// let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" -// .parse() -// .unwrap(); -// let amount_to_transfer: U256 = 1_i32.into(); - -// let era_provider = era_provider(); -// let wallet = LocalWallet::from_str(sender_private_key) -// .unwrap() -// .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - -// let sender_balance_before = era_provider -// .get_balance(zk_wallet.l2_address(), None) -// .await -// .unwrap(); -// let receiver_balance_before = era_provider -// .get_balance(receiver_address, None) -// .await -// .unwrap(); - -// println!("Sender balance before: {sender_balance_before}"); -// println!("Receiver balance before: {receiver_balance_before}"); - -// let request = TransferRequest::new(amount_to_transfer) -// .to(receiver_address) -// .from(zk_wallet.l2_address()); -// let tx_hash = zk_wallet.transfer(&request, None).await.unwrap(); - -// let receipt = era_provider -// .get_transaction_receipt(tx_hash) -// .await -// .unwrap() -// .unwrap(); - -// assert_eq!(receipt.from, zk_wallet.l2_address()); -// assert_eq!(receipt.to.unwrap(), receiver_address); - -// let sender_balance_after = era_provider -// .get_balance(zk_wallet.l2_address(), None) -// .await -// .unwrap(); -// let receiver_balance_after = era_provider -// .get_balance(receiver_address, None) -// .await -// .unwrap(); - -// println!("Sender balance after: {sender_balance_after}"); -// println!("Receiver balance after: {receiver_balance_after}"); - -// assert_eq!( -// sender_balance_after, -// sender_balance_before -// - (amount_to_transfer -// + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) -// ); -// assert_eq!( -// receiver_balance_after, -// receiver_balance_before + amount_to_transfer -// ); -// } - -// // #[tokio::test] -// // async fn test_deposit() { -// // let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; -// // let request = DepositRequest::new(parse_units("0.01", "ether").unwrap().into()); -// // println!("Amount: {}", request.amount); - -// // let l1_provider = eth_provider(); -// // let l2_provider = era_provider(); -// // let wallet = LocalWallet::from_str(private_key) -// // .unwrap() -// // .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// // let zk_wallet = ZKSWallet::new( -// // wallet, -// // None, -// // Some(l2_provider.clone()), -// // Some(l1_provider.clone()), -// // ) -// // .unwrap(); - -// // let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); -// // let l2_balance_before = zk_wallet.era_balance().await.unwrap(); -// // println!("L1 balance before: {l1_balance_before}"); -// // println!("L2 balance before: {l2_balance_before}"); - -// // let tx_hash = zk_wallet.deposit(&request).await.unwrap(); -// // let receipt = l1_provider -// // .get_transaction_receipt(tx_hash) -// // .await -// // .unwrap() -// // .unwrap(); -// // assert_eq!(receipt.status.unwrap(), 1_u8.into()); - -// // let _l2_receipt = l2_provider -// // .get_transaction_receipt(receipt.transaction_hash) -// // .await -// // .unwrap(); - -// // let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); -// // let l2_balance_after = zk_wallet.era_balance().await.unwrap(); -// // println!("L1 balance after: {l1_balance_after}"); -// // println!("L2 balance after: {l2_balance_after}"); - -// // assert!( -// // l1_balance_after <= l1_balance_before - request.amount(), -// // "Balance on L1 should be decreased" -// // ); -// // assert!( -// // l2_balance_after >= l2_balance_before + request.amount(), -// // "Balance on L2 should be increased" -// // ); -// // } - -// // #[tokio::test] -// // async fn test_deposit_to_another_address() { -// // let private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; -// // let to: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" -// // .parse() -// // .unwrap(); -// // let amount = parse_units("0.01", "ether").unwrap().into(); -// // println!("Amount: {amount}"); - -// // let request = DepositRequest::new(amount).to(to); - -// // let l1_provider = eth_provider(); -// // let l2_provider = era_provider(); -// // let wallet = LocalWallet::from_str(private_key).unwrap(); -// // let zk_wallet = ZKSWallet::new( -// // wallet, -// // None, -// // Some(l2_provider.clone()), -// // Some(l1_provider.clone()), -// // ) -// // .unwrap(); - -// // let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); -// // let l2_balance_before = era_provider().get_balance(to, None).await.unwrap(); -// // println!("L1 balance before: {l1_balance_before}"); -// // println!("L2 balance before: {l2_balance_before}"); - -// // let tx_hash = zk_wallet.deposit(&request).await.unwrap(); -// // let receipt = l1_provider -// // .get_transaction_receipt(tx_hash) -// // .await -// // .unwrap() -// // .unwrap(); -// // assert_eq!(receipt.status.unwrap(), 1_u8.into()); - -// // let _l2_receipt = l2_provider -// // .get_transaction_receipt(receipt.transaction_hash) -// // .await -// // .unwrap(); - -// // let l1_balance_after = zk_wallet.eth_balance().await.unwrap(); -// // let l2_balance_after = era_provider().get_balance(to, None).await.unwrap(); -// // println!("L1 balance after: {l1_balance_after}"); -// // println!("L2 balance after: {l2_balance_after}"); - -// // assert!( -// // l1_balance_after <= l1_balance_before - request.amount(), -// // "Balance on L1 should be decreased" -// // ); -// // assert!( -// // l2_balance_after >= l2_balance_before + request.amount(), -// // "Balance on L2 should be increased" -// // ); -// // } - -// // #[ignore = "FIXME Implement a fixture that deploys an ERC20 token"] -// // #[tokio::test] -// // async fn test_deposit_erc20_token() { -// // let amount: U256 = 1_i32.into(); -// // let private_key = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; -// // let l1_provider = eth_provider(); -// // let l2_provider = era_provider(); -// // let wallet = LocalWallet::from_str(private_key).unwrap(); -// // let zk_wallet = ZKSWallet::new( -// // wallet, -// // None, -// // Some(l2_provider.clone()), -// // Some(l1_provider.clone()), -// // ) -// // .unwrap(); - -// // let token_l1_address: Address = "0xc8F8cE6491227a6a2Ab92e67a64011a4Eba1C6CF" -// // .parse() -// // .unwrap(); - -// // let contract_l1 = ERC20Token::new(token_l1_address, Arc::new(l1_provider.clone())); - -// // let balance_erc20_l1_before: U256 = contract_l1 -// // .balance_of(zk_wallet.l1_address()) -// // .call() -// // .await -// // .unwrap(); - -// // let request = DepositRequest::new(amount).token(Some(token_l1_address)); - -// // let l1_tx_hash = zk_wallet.deposit(&request).await.unwrap(); -// // let l1_receipt = zk_wallet -// // .get_eth_provider() -// // .unwrap() -// // .get_transaction_receipt(l1_tx_hash) -// // .await -// // .unwrap() -// // .unwrap(); -// // assert_eq!(l1_receipt.status.unwrap(), 1_i32.into()); - -// // let balance_erc20_l1_after: U256 = contract_l1 -// // .balance_of(zk_wallet.l1_address()) -// // .call() -// // .await -// // .unwrap(); - -// // assert_eq!(balance_erc20_l1_after, balance_erc20_l1_before - amount); -// // // FIXME check balance on l2. -// // } - -// #[tokio::test] -// async fn test_transfer_eip712() { -// let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; -// let receiver_address: Address = "0xa61464658AfeAf65CccaaFD3a512b69A83B77618" -// .parse() -// .unwrap(); -// let amount_to_transfer: U256 = 1_i32.into(); - -// let era_provider = era_provider(); -// let wallet = LocalWallet::from_str(sender_private_key) -// .unwrap() -// .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - -// let sender_balance_before = era_provider -// .get_balance(zk_wallet.l2_address(), None) -// .await -// .unwrap(); -// let receiver_balance_before = era_provider -// .get_balance(receiver_address, None) -// .await -// .unwrap(); - -// println!("Sender balance before: {sender_balance_before}"); -// println!("Receiver balance before: {receiver_balance_before}"); - -// let transfer_request = TransferRequest::new(amount_to_transfer) -// .to(receiver_address) -// .from(zk_wallet.l2_address()); -// let tx_hash = zk_wallet -// .transfer_eip712(&transfer_request, None) -// .await -// .unwrap(); - -// let receipt = era_provider -// .get_transaction_receipt(tx_hash) -// .await -// .unwrap() -// .unwrap(); -// assert_eq!(receipt.from, zk_wallet.l2_address()); -// assert_eq!(receipt.to.unwrap(), receiver_address); - -// let sender_balance_after = era_provider -// .get_balance(zk_wallet.l2_address(), None) -// .await -// .unwrap(); -// let receiver_balance_after = era_provider -// .get_balance(receiver_address, None) -// .await -// .unwrap(); - -// println!("Sender balance after: {sender_balance_after}"); -// println!("Receiver balance after: {receiver_balance_after}"); - -// assert_eq!( -// sender_balance_after, -// sender_balance_before -// - (amount_to_transfer -// + receipt.effective_gas_price.unwrap() * receipt.gas_used.unwrap()) -// ); -// assert_eq!( -// receiver_balance_after, -// receiver_balance_before + amount_to_transfer -// ); -// } - -// #[tokio::test] -// async fn test_deploy_contract_with_constructor_arg_uint() { -// let deployer_private_key = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; -// let era_provider = era_provider(); -// let wallet = LocalWallet::from_str(deployer_private_key) -// .unwrap() -// .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - -// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// contract_path.push("src/abi/test_contracts/storage_combined.json"); -// let contract: CompiledContract = -// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - -// let deploy_request = -// DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["10".to_owned()]) -// .from(zk_wallet.l2_address()); -// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// let deploy_result = era_provider.get_code(contract_address, None).await; - -// assert!(deploy_result.is_ok()); -// } - -// #[tokio::test] -// async fn test_deploy_contract_with_constructor_arg_string() { -// let deployer_private_key = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; -// let era_provider = era_provider(); -// let wallet = LocalWallet::from_str(deployer_private_key) -// .unwrap() -// .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - -// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// contract_path.push("src/abi/test_contracts/greeter_combined.json"); -// let contract: CompiledContract = -// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - -// let deploy_request = -// DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["Hey".to_owned()]) -// .from(zk_wallet.l2_address()); -// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// let deploy_result = era_provider.get_code(contract_address, None).await; - -// assert!(deploy_result.is_ok()); -// } - -// // #[tokio::test] -// // async fn test_deploy_contract_with_import() { -// // let deployer_private_key = -// // "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"; -// // let era_provider = era_provider(); -// // let wallet = LocalWallet::from_str(deployer_private_key) -// // .unwrap() -// // .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// // let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - -// // // Deploy imported contract first. -// // let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// // contract_path.push("src/abi/test_contracts/counter_combined.json"); -// // let counter_contract: CompiledContract = -// // serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - -// // let deploy_request = -// // DeployRequest::with(counter_contract.abi, counter_contract.bin.to_vec(), vec![]) -// // .from(zk_wallet.l2_address()); -// // let counter_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// // let deploy_result = era_provider.get_code(counter_contract_address, None).await; - -// // assert!(deploy_result.is_ok()); - -// // // Deploy another contract that imports the previous one. -// // let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// // contract_path.push("src/abi/test_contracts/import_combined.json"); - -// // let import_contract: CompiledContract = -// // serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - -// // let deploy_request = DeployRequest::with( -// // import_contract.abi, -// // import_contract.bin.to_vec(), -// // vec![format!("{counter_contract_address:?}")], -// // ) -// // .from(zk_wallet.l2_address()); -// // let import_contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// // let call_request = CallRequest::new( -// // import_contract_address, -// // "getCounterValue()(uint256)".to_owned(), -// // ); -// // let value = ZKMiddleware::call(&era_provider, &call_request) -// // .await -// // .unwrap(); - -// // assert_eq!(value, U256::from(0_u64).into_tokens()); -// // } - -// #[tokio::test] -// async fn test_withdraw_to_same_address() { -// let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; -// let wallet = LocalWallet::from_str(sender_private_key) -// .unwrap() -// .with_chain_id(DEFAULT_ERA_CHAIN_ID); -// let zk_wallet = -// ZKSWallet::new(wallet, None, Some(era_provider()), Some(eth_provider())).unwrap(); - -// // See balances before withdraw -// let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); -// let l2_balance_before = zk_wallet.era_balance().await.unwrap(); - -// println!("Balance on L1 before withdrawal: {l1_balance_before}"); -// println!("Balance on L2 before withdrawal: {l2_balance_before}"); - -// // Withdraw -// let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); - -// let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); -// let tx_hash = zk_wallet.withdraw(&withdraw_request).await.unwrap(); -// let tx_receipt = zk_wallet -// .get_era_provider() -// .unwrap() -// .wait_for_finalize(tx_hash, None, None) -// .await -// .unwrap(); -// assert_eq!( -// 1, -// tx_receipt.status.unwrap().as_u64(), -// "Check that transaction in L2 is successful" -// ); - -// println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); - -// let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); -// let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); - -// assert_eq!( -// l2_balance_after_withdraw, -// l2_balance_before -// - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), -// "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" -// ); - -// assert_eq!( -// l1_balance_before, l1_balance_after_withdraw, -// "Check that L1 balance has not changed" -// ); - -// let tx_finalize_hash = zk_wallet.finalize_withdraw(tx_hash).await.unwrap(); - -// let tx_finalize_receipt = zk_wallet -// .get_eth_provider() -// .unwrap() -// .get_transaction_receipt(tx_finalize_hash) -// .await -// .unwrap() -// .unwrap(); -// println!( -// "L1 Transaction hash: {:?}", -// tx_finalize_receipt.transaction_hash -// ); - -// assert_eq!( -// 1, -// tx_finalize_receipt.status.unwrap().as_u64(), -// "Check that transaction in L1 is successful" -// ); - -// // See balances after withdraw -// let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); -// let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); - -// println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); -// println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); - -// assert_eq!( -// l2_balance_after_finalize, l2_balance_after_withdraw, -// "Check that L2 balance after finalize has decreased by the used gas" -// ); - -// assert_ne!( -// l1_balance_after_finalize, l1_balance_before, -// "Check that L1 balance after finalize is not the same" -// ); -// assert_eq!( -// l1_balance_after_finalize, -// l1_balance_before -// + (amount_to_withdraw -// - tx_finalize_receipt.effective_gas_price.unwrap() -// * tx_finalize_receipt.gas_used.unwrap()), -// "Check that L1 balance after finalize has increased by the amount" -// ); -// } - -// #[tokio::test] -// async fn test_withdraw_to_other_address() { -// let sender_private_key = "0x28a574ab2de8a00364d5dd4b07c4f2f574ef7fcc2a86a197f65abaec836d1959"; -// let receiver_private_key = "0xe667e57a9b8aaa6709e51ff7d093f1c5b73b63f9987e4ab4aa9a5c699e024ee8"; -// let l2_wallet = LocalWallet::from_str(sender_private_key) -// .unwrap() -// .with_chain_id(DEFAULT_ERA_CHAIN_ID); - -// let l1_wallet = LocalWallet::from_str(receiver_private_key) -// .unwrap() -// .with_chain_id(utils::ETH_CHAIN_ID); -// let zk_wallet = ZKSWallet::new( -// l2_wallet, -// Some(l1_wallet), -// Some(era_provider()), -// Some(eth_provider()), -// ) -// .unwrap(); - -// // See balances before withdraw -// let l1_balance_before = zk_wallet.eth_balance().await.unwrap(); -// let l2_balance_before = zk_wallet.era_balance().await.unwrap(); - -// println!("Balance on L1 before withdrawal: {l1_balance_before}"); -// println!("Balance on L2 before withdrawal: {l2_balance_before}"); - -// // Withdraw -// let amount_to_withdraw: U256 = parse_units(1_u8, "ether").unwrap().into(); -// let withdraw_request = WithdrawRequest::new(amount_to_withdraw).to(zk_wallet.l1_address()); -// let tx_receipt = zk_wallet.withdraw(&withdraw_request).await.unwrap(); -// let tx_receipt = zk_wallet -// .get_era_provider() -// .unwrap() -// .wait_for_finalize(tx_receipt, None, None) -// .await -// .unwrap(); -// assert_eq!( -// 1, -// tx_receipt.status.unwrap().as_u64(), -// "Check that transaction in L2 is successful" -// ); - -// println!("L2 Transaction hash: {:?}", tx_receipt.transaction_hash); - -// let l2_balance_after_withdraw = zk_wallet.era_balance().await.unwrap(); -// let l1_balance_after_withdraw = zk_wallet.eth_balance().await.unwrap(); - -// assert_eq!( -// l2_balance_after_withdraw, -// l2_balance_before -// - (amount_to_withdraw + tx_receipt.effective_gas_price.unwrap() * tx_receipt.gas_used.unwrap()), -// "Check that L2 balance inmediately after withdrawal has decreased by the used gas and amount" -// ); - -// assert_eq!( -// l1_balance_before, l1_balance_after_withdraw, -// "Check that L1 balance has not changed" -// ); - -// let tx_finalize_hash = zk_wallet -// .finalize_withdraw(tx_receipt.transaction_hash) -// .await -// .unwrap(); - -// let tx_finalize_receipt = zk_wallet -// .get_eth_provider() -// .unwrap() -// .get_transaction_receipt(tx_finalize_hash) -// .await -// .unwrap() -// .unwrap(); -// println!( -// "L1 Transaction hash: {:?}", -// tx_finalize_receipt.transaction_hash -// ); - -// assert_eq!( -// 1, -// tx_finalize_receipt.status.unwrap().as_u64(), -// "Check that transaction in L1 is successful" -// ); - -// // See balances after withdraw -// let l1_balance_after_finalize = zk_wallet.eth_balance().await.unwrap(); -// let l2_balance_after_finalize = zk_wallet.era_balance().await.unwrap(); - -// println!("Balance on L1 after finalize withdraw: {l1_balance_after_finalize}"); -// println!("Balance on L2 after finalize withdraw: {l2_balance_after_finalize}"); - -// assert_eq!( -// l2_balance_after_finalize, l2_balance_after_withdraw, -// "Check that L2 balance after finalize has decreased by the used gas" -// ); - -// assert_ne!( -// l1_balance_after_finalize, l1_balance_before, -// "Check that L1 balance after finalize is not the same" -// ); -// assert_eq!( -// l1_balance_after_finalize, -// l1_balance_before -// + (amount_to_withdraw -// - tx_finalize_receipt.effective_gas_price.unwrap() -// * tx_finalize_receipt.gas_used.unwrap()), -// "Check that L1 balance after finalize has increased by the amount" -// ); -// } diff --git a/tests/zk_middleware_tests.rs b/tests/zk_middleware_tests.rs deleted file mode 100644 index d947559..0000000 --- a/tests/zk_middleware_tests.rs +++ /dev/null @@ -1,883 +0,0 @@ -// use ethers::{ -// abi::Tokenize, -// types::{Address, Bytes, H256, U256}, -// }; -// use serde::{Deserialize, Serialize}; -// use std::{fs::File, path::PathBuf, str::FromStr}; -// use zksync_ethers_rs::{ -// types::zksync::api::{CallTracerConfig, SupportedTracers, TracerConfig}, -// zk_middleware::ZKMiddleware, -// }; - -// #[tokio::test] -// async fn test_provider_estimate_fee() { -// let provider = era_provider(); -// #[derive(Serialize, Deserialize, Debug)] -// struct TestTransaction { -// from: String, -// to: String, -// data: String, -// } - -// let transaction = TestTransaction { -// from: "0x1111111111111111111111111111111111111111".to_owned(), -// to: "0x2222222222222222222222222222222222222222".to_owned(), -// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), -// }; - -// let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); - -// assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); -// assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); -// assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); -// assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); -// } - -// #[tokio::test] -// async fn test_provider_get_testnet_paymaster() { -// let provider = era_provider(); - -// assert!(provider.get_testnet_paymaster().await.is_ok()); -// } - -// #[tokio::test] -// async fn test_provider_estimate_gas_l1_to_l2() { -// let provider = era_provider(); -// #[derive(Serialize, Deserialize, Debug)] -// struct TestTransaction { -// from: String, -// to: String, -// data: String, -// } - -// let transaction = TestTransaction { -// from: "0x1111111111111111111111111111111111111111".to_owned(), -// to: "0x2222222222222222222222222222222222222222".to_owned(), -// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), -// }; - -// let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); - -// assert_eq!(estimated_fee, U256::from(36_768_868_u64)); -// } - -// #[tokio::test] -// // TODO: This test is flacky. It could fail in the future. -// async fn test_provider_get_all_account_balances() { -// let provider = era_provider(); -// let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" -// .parse() -// .unwrap(); -// let balance = provider.get_balance(address, None).await.unwrap(); - -// let balances = provider.get_all_account_balances(address).await.unwrap(); - -// assert_eq!( -// balances -// .get( -// &"0x0000000000000000000000000000000000000000" -// .parse::
() -// .unwrap() -// ) -// .unwrap() -// .clone(), -// balance -// ); -// } - -// #[tokio::test] -// async fn test_provider_get_block_details() { -// let provider = era_provider(); -// let existing_block = 1_u64; -// let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; - -// let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); -// let non_existing_block_details = provider -// .get_block_details(non_existing_block.as_u32()) -// .await -// .unwrap(); - -// assert!(existing_block_details.is_some()); -// assert!(non_existing_block_details.is_none()) -// } - -// #[tokio::test] -// async fn test_provider_get_bridge_contracts() { -// let provider = era_provider(); - -// assert!(provider.get_bridge_contracts().await.is_ok()); -// } - -// #[tokio::test] -// async fn test_provider_get_bytecode_by_hash() { -// let provider = era_provider(); -// let invalid_hash = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" -// .parse() -// .unwrap(); -// let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); -// let valid_hash = test_block.base.root_hash.unwrap(); - -// assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); -// assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); -// } - -// #[ignore] -// #[tokio::test] -// async fn test_provider_get_confirmed_tokens() { -// let provider = era_provider(); -// let from = 0; -// let limit = 10; - -// assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); -// } - -// // TODO: This test is flacky. It could fail in the future. -// #[tokio::test] -// async fn test_provider_get_l1_batch_block_range() { -// let provider = era_provider(); -// let batch = 1_u64; - -// assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); -// } - -// #[tokio::test] -// async fn test_provider_get_l1_batch_details() { -// let provider = era_provider(); -// let batch = 1_u64; - -// assert!(provider.get_l1_batch_details(batch).await.is_ok()); -// } - -// #[tokio::test] -// async fn test_provider_get_l2_to_l1_log_proof() { -// let provider = era_provider(); -// let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" -// .parse() -// .unwrap(); - -// assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); -// } - -// // #[tokio::test] -// // async fn test_provider_get_l2_to_l1_msg_proof() { -// // let provider = local_provider(); -// // let block = 2; -// // let sender = /* create an address object */; -// // let msg = /* create a hash object */; - -// // assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); -// // } - -// #[tokio::test] -// async fn test_provider_get_main_contract() { -// let provider = era_provider(); - -// assert!(provider.get_main_contract().await.is_ok()); -// } - -// // TODO: This test is flacky. It could fail in the future. We should create a -// // transaction, send it, and the assert that the details match. -// #[tokio::test] -// async fn test_provider_get_raw_block_transactions() { -// let provider = era_provider(); -// let block = 1_u64; - -// assert!(provider.get_raw_block_transactions(block).await.is_ok()); -// } - -// #[tokio::test] -// async fn test_provider_get_token_price() { -// let provider = era_provider(); -// let address: Address = "0x0000000000000000000000000000000000000000" -// .parse() -// .unwrap(); - -// assert!(provider.get_token_price(address).await.is_ok()); -// } - -// // TODO: This test is flacky. It could fail in the future. We should create a -// // transaction, send it, and the assert that the details match. -// #[tokio::test] -// async fn test_provider_get_transaction_details() { -// let provider = era_provider(); -// let test_block = provider.get_block_details(2_u64).await.unwrap().unwrap(); -// let hash = test_block.base.root_hash.unwrap(); - -// assert!(provider.get_transaction_details(hash).await.is_ok()); -// } - -// #[tokio::test] -// async fn test_provider_get_l1_batch_number() { -// let provider = era_provider(); - -// assert!(provider.get_l1_batch_number().await.is_ok()); -// } - -// #[tokio::test] -// async fn test_provider_get_l1_chain_id() { -// let provider = era_provider(); - -// assert!(provider.get_l1_chain_id().await.is_ok()); -// } - -// #[tokio::test] -// async fn test_provider_debug_trace_block_by_hash() { -// let provider = era_provider(); -// let block_number = provider.get_block_number().await.unwrap() - 1_u64; -// let test_block = provider -// .get_block_details(block_number.as_u32()) -// .await -// .unwrap() -// .unwrap(); -// let hash_block = test_block.base.root_hash.unwrap(); - -// let options = Some(TracerConfig { -// tracer: SupportedTracers::CallTracer, -// tracer_config: CallTracerConfig { -// only_top_call: true, -// }, -// }); - -// assert!( -// ZKMiddleware::debug_trace_block_by_hash(&provider, hash_block, None) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_block_by_hash(&provider, hash_block, options) -// .await -// .is_ok() -// ); -// } - -// #[tokio::test] -// async fn test_provider_debug_trace_block_by_number() { -// let provider = era_provider(); -// let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; -// let non_existing_block_number = existing_block_number + 100_u64; -// let options = Some(TracerConfig { -// tracer: SupportedTracers::CallTracer, -// tracer_config: CallTracerConfig { -// only_top_call: true, -// }, -// }); - -// assert!( -// ZKMiddleware::debug_trace_block_by_number(&provider, existing_block_number, None) -// .await -// .is_ok() -// ); -// assert!(ZKMiddleware::debug_trace_block_by_number( -// &provider, -// existing_block_number, -// options.clone() -// ) -// .await -// .is_ok()); -// assert!( -// ZKMiddleware::debug_trace_block_by_number(&provider, non_existing_block_number, None) -// .await -// .is_err() -// ); -// assert!(ZKMiddleware::debug_trace_block_by_number( -// &provider, -// non_existing_block_number, -// options -// ) -// .await -// .is_err()); -// } - -// #[tokio::test] -// async fn test_provider_debug_trace_call() { -// let provider = era_provider(); -// #[derive(Serialize, Deserialize, Debug)] -// struct TestTransaction { -// from: String, -// to: String, -// data: String, -// } - -// let request = TestTransaction { -// from: "0x1111111111111111111111111111111111111111".to_owned(), -// to: "0x2222222222222222222222222222222222222222".to_owned(), -// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), -// }; - -// let block = provider.get_block_number().await.ok(); -// let options = Some(TracerConfig { -// tracer: SupportedTracers::CallTracer, -// tracer_config: CallTracerConfig { -// only_top_call: true, -// }, -// }); - -// println!( -// "{:?}", -// ZKMiddleware::debug_trace_call::<&TestTransaction, u64>(&provider, &request, None, None) -// .await -// ); - -// assert!(ZKMiddleware::debug_trace_call::<&TestTransaction, u64>( -// &provider, &request, None, None -// ) -// .await -// .is_ok()); -// assert!( -// ZKMiddleware::debug_trace_call(&provider, &request, block, None) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_call(&provider, &request, block, options.clone()) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_call::<_, u64>(&provider, request, None, options) -// .await -// .is_ok() -// ); -// } - -// // TODO: This test is flacky. It could fail in the future. -// #[tokio::test] -// async fn test_provider_debug_trace_transaction() { -// let era_provider = era_provider(); -// let zk_wallet = ZKSWallet::new(local_wallet(), None, Some(era_provider.clone()), None).unwrap(); - -// let transfer_request = TransferRequest::new(1_u64.into()) -// .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) -// .from(zk_wallet.l2_address()); -// let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); -// let invalid_transaction_hash: H256 = -// "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" -// .parse() -// .unwrap(); - -// let options = Some(TracerConfig { -// tracer: SupportedTracers::CallTracer, -// tracer_config: CallTracerConfig { -// only_top_call: true, -// }, -// }); - -// assert!( -// ZKMiddleware::debug_trace_transaction(&era_provider, transaction_hash, None) -// .await -// .is_ok() -// ); -// assert!(ZKMiddleware::debug_trace_transaction( -// &era_provider, -// transaction_hash, -// options.clone() -// ) -// .await -// .is_ok()); -// assert!( -// ZKMiddleware::debug_trace_transaction(&era_provider, invalid_transaction_hash, None) -// .await -// .is_err() -// ); -// assert!(ZKMiddleware::debug_trace_transaction( -// &era_provider, -// invalid_transaction_hash, -// options -// ) -// .await -// .is_err()); -// } - -// #[tokio::test] -// async fn test_signer_estimate_fee() { -// let provider = era_signer(); -// #[derive(Serialize, Deserialize, Debug)] -// struct TestTransaction { -// from: String, -// to: String, -// data: String, -// } - -// let transaction = TestTransaction { -// from: "0x1111111111111111111111111111111111111111".to_owned(), -// to: "0x2222222222222222222222222222222222222222".to_owned(), -// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), -// }; - -// let estimated_fee = provider.estimate_fee(transaction).await.unwrap(); - -// assert_eq!(estimated_fee.gas_limit, U256::from(162_436_u32)); -// assert_eq!(estimated_fee.gas_per_pubdata_limit, U256::from(66_u32)); -// assert_eq!(estimated_fee.max_fee_per_gas, U256::from(250_000_000_u32)); -// assert_eq!(estimated_fee.max_priority_fee_per_gas, U256::from(0_u32)); -// } - -// #[tokio::test] -// async fn test_signer_get_testnet_paymaster() { -// let provider = era_signer(); - -// assert!(provider.get_testnet_paymaster().await.is_ok()); -// } - -// #[tokio::test] -// async fn test_signer_estimate_gas_l1_to_l2() { -// let provider = era_signer(); -// #[derive(Serialize, Deserialize, Debug)] -// struct TestTransaction { -// from: String, -// to: String, -// data: String, -// } - -// let transaction = TestTransaction { -// from: "0x1111111111111111111111111111111111111111".to_owned(), -// to: "0x2222222222222222222222222222222222222222".to_owned(), -// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), -// }; - -// let estimated_fee = provider.estimate_gas_l1_to_l2(transaction).await.unwrap(); - -// assert_eq!(estimated_fee, U256::from(36_768_868_u32)); -// } - -// #[tokio::test] -// // TODO: This test is flacky. It could fail in the future. -// async fn test_signer_get_all_account_balances() { -// let provider = era_signer(); -// let address: Address = "0xbd29a1b981925b94eec5c4f1125af02a2ec4d1ca" -// .parse() -// .unwrap(); -// let balance = provider.get_balance(address, None).await.unwrap(); - -// let balances = provider.get_all_account_balances(address).await.unwrap(); - -// assert_eq!( -// balances -// .get( -// &"0x0000000000000000000000000000000000000000" -// .parse::
() -// .unwrap() -// ) -// .unwrap() -// .clone(), -// balance -// ); -// } - -// #[tokio::test] -// async fn test_signer_get_block_details() { -// let provider = era_signer(); -// let existing_block = 1_u64; -// let non_existing_block = provider.get_block_number().await.unwrap() + 100_u64; - -// let existing_block_details = provider.get_block_details(existing_block).await.unwrap(); -// let non_existing_block_details = provider -// .get_block_details(non_existing_block.as_u32()) -// .await -// .unwrap(); - -// assert!(existing_block_details.is_some()); -// assert!(non_existing_block_details.is_none()) -// } - -// #[tokio::test] -// async fn test_signer_get_bridge_contracts() { -// let provider = era_signer(); - -// assert!(provider.get_bridge_contracts().await.is_ok()); -// } - -// #[tokio::test] -// async fn test_signer_get_bytecode_by_hash() { -// let provider = era_signer(); -// let invalid_hash = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" -// .parse() -// .unwrap(); -// let valid_hash: H256 = "0x7641711d8997f701a4d5929b6661185aeb5ae1fdff33288b6b5df1c05135cfc9" -// .parse() -// .unwrap(); - -// assert!(provider.get_bytecode_by_hash(invalid_hash).await.is_ok()); -// assert!(provider.get_bytecode_by_hash(valid_hash).await.is_ok()); -// } - -// #[ignore] -// #[tokio::test] -// async fn test_signer_get_confirmed_tokens() { -// let provider = era_signer(); -// let from = 0; -// let limit = 10; - -// assert!(provider.get_confirmed_tokens(from, limit).await.is_ok()); -// } - -// // TODO: This test is flacky. It could fail in the future. -// #[tokio::test] -// async fn test_signer_get_l1_batch_block_range() { -// let provider = era_signer(); -// let batch = 1_u64; - -// assert!(provider.get_l1_batch_block_range(batch).await.is_ok()); -// } - -// #[tokio::test] -// async fn test_signer_get_l1_batch_details() { -// let provider = era_signer(); -// let batch = 1_u64; - -// assert!(provider.get_l1_batch_details(batch).await.is_ok()); -// } - -// #[tokio::test] -// async fn test_signer_get_l2_to_l1_log_proof() { -// let provider = era_signer(); -// let tx_hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" -// .parse() -// .unwrap(); - -// assert!(provider.get_l2_to_l1_log_proof(tx_hash, None).await.is_ok()); -// } - -// // #[tokio::test] -// // async fn test_signer_get_l2_to_l1_msg_proof() { -// // let provider = local_signer(); -// // let block = 2; -// // let sender = /* create an address object */; -// // let msg = /* create a hash object */; - -// // assert!(provider.get_l2_to_l1_msg_proof(block, sender, msg, None).await.is_ok()); -// // } - -// #[tokio::test] -// async fn test_signer_get_main_contract() { -// let provider = era_signer(); - -// assert!(provider.get_main_contract().await.is_ok()); -// } - -// // TODO: This test is flacky. It could fail in the future. We should create a -// // transaction, send it, and the assert that the details match. -// #[tokio::test] -// async fn test_signer_get_raw_block_transactions() { -// let provider = era_signer(); -// let block = 1_u64; - -// assert!(provider.get_raw_block_transactions(block).await.is_ok()); -// } - -// #[tokio::test] -// async fn test_signer_get_token_price() { -// let provider = era_signer(); -// let address: Address = "0x0000000000000000000000000000000000000000" -// .parse() -// .unwrap(); - -// assert!(provider.get_token_price(address).await.is_ok()); -// } - -// // TODO: This test is flacky. It could fail in the future. We should create a -// // transaction, send it, and the assert that the details match. -// #[tokio::test] -// async fn test_signer_get_transaction_details() { -// let provider = era_signer(); -// let hash: H256 = "0xac9cf301af3b11760feb9d84283513f993dcd29de6e5fd28a8f41b1c7c0469ed" -// .parse() -// .unwrap(); - -// assert!(provider.get_transaction_details(hash).await.is_ok()); -// } - -// #[tokio::test] -// async fn test_signer_get_l1_batch_number() { -// let provider = era_signer(); - -// assert!(provider.get_l1_batch_number().await.is_ok()); -// } - -// #[tokio::test] -// async fn test_signer_get_l1_chain_id() { -// let provider = era_signer(); - -// assert!(provider.get_l1_chain_id().await.is_ok()); -// } - -// #[tokio::test] -// async fn test_signer_debug_trace_block_by_hash() { -// let provider = era_signer(); -// let block_number = provider.get_block_number().await.unwrap() - 1_u64; -// let test_block = provider -// .get_block_details(block_number.as_u32()) -// .await -// .unwrap() -// .unwrap(); -// let hash = test_block.base.root_hash.unwrap(); - -// let options = Some(TracerConfig { -// tracer: SupportedTracers::CallTracer, -// tracer_config: CallTracerConfig { -// only_top_call: true, -// }, -// }); - -// assert!( -// ZKMiddleware::debug_trace_block_by_hash(&provider, hash, None) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_block_by_hash(&provider, hash, options) -// .await -// .is_ok() -// ); -// } - -// #[tokio::test] -// async fn test_signer_debug_trace_block_by_number() { -// let provider = era_signer(); -// let existing_block_number = provider.get_block_number().await.unwrap() - 1_u64; -// let non_existing_block_number = existing_block_number + 100_u64; -// let options = Some(TracerConfig { -// tracer: SupportedTracers::CallTracer, -// tracer_config: CallTracerConfig { -// only_top_call: true, -// }, -// }); - -// assert!( -// ZKMiddleware::debug_trace_block_by_number(&provider, existing_block_number, None) -// .await -// .is_ok() -// ); -// assert!(ZKMiddleware::debug_trace_block_by_number( -// &provider, -// existing_block_number, -// options.clone() -// ) -// .await -// .is_ok()); -// assert!( -// ZKMiddleware::debug_trace_block_by_number(&provider, non_existing_block_number, None) -// .await -// .is_err() -// ); -// assert!(ZKMiddleware::debug_trace_block_by_number( -// &provider, -// non_existing_block_number, -// options -// ) -// .await -// .is_err()); -// } - -// #[tokio::test] -// async fn test_signer_debug_trace_call() { -// let provider = era_signer(); -// #[derive(Serialize, Deserialize, Debug)] -// struct TestTransaction { -// from: String, -// to: String, -// data: String, -// } - -// let request = TestTransaction { -// from: "0x1111111111111111111111111111111111111111".to_owned(), -// to: "0x2222222222222222222222222222222222222222".to_owned(), -// data: "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639146769014610030575b600080fd5b61003861004e565b6040516100459190610170565b60405180910390f35b60606000805461005d906101c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610089906101c1565b80156100d65780601f106100ab576101008083540402835291602001916100d6565b820191906000526020600020905b8154815290600101906020018083116100b957829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561011a5780820151818401526020810190506100ff565b60008484015250505050565b6000601f19601f8301169050919050565b6000610142826100e0565b61014c81856100eb565b935061015c8185602086016100fc565b61016581610126565b840191505092915050565b6000602082019050818103600083015261018a8184610137565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806101d957607f821691505b6020821081036101ec576101eb610192565b5b5091905056fea26469706673582212203d7f62ad5ef1f9670aa630c438f1a75844e1d2cfaf92e6985c698b7009e3dfa864736f6c63430008140033".to_owned(), -// }; - -// let block = provider.get_block_number().await.ok(); -// let options = Some(TracerConfig { -// tracer: SupportedTracers::CallTracer, -// tracer_config: CallTracerConfig { -// only_top_call: true, -// }, -// }); - -// assert!( -// ZKMiddleware::debug_trace_call::<_, u64>(&provider, &request, None, None) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_call(&provider, &request, block, None) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_call(&provider, &request, block, options.clone()) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_call::<_, u64>(&provider, request, None, options) -// .await -// .is_ok() -// ); -// } - -// #[tokio::test] -// async fn test_signer_debug_trace_transaction() { -// let era_signer = era_signer(); -// let zk_wallet = ZKSWallet::new(local_wallet(), None, Some(era_signer.clone()), None).unwrap(); - -// let transfer_request = TransferRequest::new(1_u64.into()) -// .to(Address::from_str("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049").unwrap()) -// .from(zk_wallet.l2_address()); -// let transaction_hash = zk_wallet.transfer(&transfer_request, None).await.unwrap(); -// let invalid_transaction_hash: H256 = -// "0x84472204e445cb3cd5f3ce5e23abcc2892cda5e61b35855a7f0bb1562a6e30e7" -// .parse() -// .unwrap(); - -// let options = Some(TracerConfig { -// tracer: SupportedTracers::CallTracer, -// tracer_config: CallTracerConfig { -// only_top_call: true, -// }, -// }); - -// assert!( -// ZKMiddleware::debug_trace_transaction(&era_signer, transaction_hash, None) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_transaction(&era_signer, transaction_hash, options) -// .await -// .is_ok() -// ); -// assert!( -// ZKMiddleware::debug_trace_transaction(&era_signer, invalid_transaction_hash, None) -// .await -// .is_err() -// ); -// } - -// #[ignore = "Deprecated"] -// #[tokio::test] -// async fn test_send_function_with_arguments() { -// // Deploying a test contract -// let era_provider = era_provider(); -// let wallet = local_wallet(); -// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); -// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// contract_path.push("src/abi/test_contracts/storage_combined.json"); -// let contract: CompiledContract = -// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - -// let deploy_request = -// DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["0".to_owned()]) -// .from(zk_wallet.l2_address()); -// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// let call_request = CallRequest::new(contract_address, "getValue()(uint256)".to_owned()); -// let initial_value = ZKMiddleware::call(&era_provider, &call_request) -// .await -// .unwrap(); - -// assert_eq!(initial_value, U256::from(0_i32).into_tokens()); - -// let value_to_set = String::from("10"); -// era_provider -// .send_eip712( -// &zk_wallet.l2_wallet, -// contract_address, -// "setValue(uint256)", -// Some([value_to_set.clone()].into()), -// None, -// ) -// .await -// .unwrap() -// .await -// .unwrap() -// .unwrap(); -// let set_value = ZKMiddleware::call(&era_provider, &call_request) -// .await -// .unwrap(); - -// assert_eq!( -// set_value, -// U256::from(value_to_set.parse::().unwrap()).into_tokens() -// ); - -// era_provider -// .send_eip712( -// &zk_wallet.l2_wallet, -// contract_address, -// "incrementValue()", -// None, -// None, -// ) -// .await -// .unwrap() -// .await -// .unwrap() -// .unwrap(); -// let incremented_value = ZKMiddleware::call(&era_provider, &call_request) -// .await -// .unwrap(); - -// assert_eq!( -// incremented_value, -// (value_to_set.parse::().unwrap() + 1_u64).into_tokens() -// ); -// } - -// #[ignore = "Deprecated"] -// #[tokio::test] -// async fn test_call_view_function_with_no_parameters() { -// // Deploying a test contract -// let era_provider = era_provider(); -// let wallet = local_wallet(); -// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); -// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// contract_path.push("src/abi/test_contracts/basic_combined.json"); -// let contract: CompiledContract = -// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - -// let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]); -// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// let call_request = CallRequest::new(contract_address, "str_out()(string)".to_owned()); -// let output = ZKMiddleware::call(&era_provider, &call_request) -// .await -// .unwrap(); - -// assert_eq!(output, String::from("Hello World!").into_tokens()); -// } - -// #[ignore = "Deprecated"] -// #[tokio::test] -// async fn test_call_view_function_with_arguments() { -// // Deploying a test contract -// let era_provider = era_provider(); -// let wallet = local_wallet(); -// let zk_wallet = ZKSWallet::new(wallet, None, Some(era_provider.clone()), None).unwrap(); - -// let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// contract_path.push("src/abi/test_contracts/basic_combined.json"); -// let contract: CompiledContract = -// serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); - -// let deploy_request = DeployRequest::with(contract.abi, contract.bin.to_vec(), vec![]) -// .from(zk_wallet.l2_address()); -// let contract_address = zk_wallet.deploy(&deploy_request).await.unwrap(); -// let call_request = CallRequest::new(contract_address, "plus_one(uint256)".to_owned()) -// .function_parameters(vec!["1".to_owned()]); -// let no_return_type_output = ZKMiddleware::call(&era_provider, &call_request) -// .await -// .unwrap(); - -// let call_request = call_request.function_signature("plus_one(uint256)(uint256)".to_owned()); -// let known_return_type_output = ZKMiddleware::call(&era_provider, &call_request) -// .await -// .unwrap(); - -// assert_eq!( -// no_return_type_output, -// Bytes::from([ -// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// 0, 0, 2 -// ]) -// .into_tokens() -// ); -// assert_eq!(known_return_type_output, U256::from(2_u64).into_tokens()); -// } From 25883f678cccd8308b51801cf56ed2d0da26cec8 Mon Sep 17 00:00:00 2001 From: Federico Borello <156438142+fborello-lambda@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:34:27 -0300 Subject: [PATCH 53/75] feat(l2_token_addr): add a function to get the l2 token addr (#128) --- src/contracts/l2_shared_bridge.rs | 29 +++++++++++++++++++++++++++++ tests/l2_shared_bridge.rs | 19 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 tests/l2_shared_bridge.rs diff --git a/src/contracts/l2_shared_bridge.rs b/src/contracts/l2_shared_bridge.rs index 46bf445..53e7d5e 100644 --- a/src/contracts/l2_shared_bridge.rs +++ b/src/contracts/l2_shared_bridge.rs @@ -1,3 +1,32 @@ +// FIXME: Remove this after finishing the implementation. +#![allow(clippy::unwrap_used)] + +use std::sync::Arc; + +use ethers::{abi::Address, providers::Middleware}; use ethers_contract::abigen; +use crate::ZKMiddleware; + abigen!(L2SharedBridge, "abi/IL2Bridge.json"); + +/// Gets the L2 token Address, given the L1 token Address. +/// +/// # Returns +/// +/// L2 token Address. +pub async fn get_l2_token_from_l1_address( + token: Address, + l2_provider: &L2Provider, +) -> Address +where + L2Provider: ZKMiddleware + Middleware + Clone + 'static, +{ + let bridge_addresses = l2_provider.get_bridge_contracts().await.unwrap(); + let l2_shared_bridge_addr = bridge_addresses.l2_shared_default_bridge.unwrap(); + + let l2_shared_bridge = + L2SharedBridge::new(l2_shared_bridge_addr, Arc::new(l2_provider.clone())); + + l2_shared_bridge.l_2_token_address(token).await.unwrap() +} diff --git a/tests/l2_shared_bridge.rs b/tests/l2_shared_bridge.rs new file mode 100644 index 0000000..502e50e --- /dev/null +++ b/tests/l2_shared_bridge.rs @@ -0,0 +1,19 @@ +use std::str::FromStr; +mod common; +use common::l2_provider; +use zksync_ethers_rs::contracts::l2_shared_bridge::get_l2_token_from_l1_address; +use zksync_types::H160; + +#[tokio::test] +async fn l2_token_address() { + let l2_provider = l2_provider().await; + let l2_token = get_l2_token_from_l1_address( + H160::from_str("0x8E9C82509488eD471A83824d20Dd474b8F534a0b").unwrap(), + &l2_provider, + ) + .await; + assert_eq!( + l2_token, + H160::from_str("0xb06fcdb64e4b4c18406e0d5e13ed1c7cec452716").unwrap() + ); +} From f0fabca966267d298ab18aee5d450ac044c790ad Mon Sep 17 00:00:00 2001 From: ilitteri Date: Thu, 15 Aug 2024 16:52:43 -0300 Subject: [PATCH 54/75] Refactor deposit module --- src/deposit/mod.rs | 319 ++++++++----------------------------------- src/deposit/utils.rs | 59 ++++++++ 2 files changed, 117 insertions(+), 261 deletions(-) create mode 100644 src/deposit/utils.rs diff --git a/src/deposit/mod.rs b/src/deposit/mod.rs index 7d8574f..88dbf67 100644 --- a/src/deposit/mod.rs +++ b/src/deposit/mod.rs @@ -6,11 +6,10 @@ use crate::{ bridgehub::{Bridgehub, L2TransactionRequestDirect, L2TransactionRequestTwoBridgesOuter}, erc20::ERC20, }, - eip712::Eip712TransactionRequest, types::L1TxOverrides, - utils, ZKMiddleware, + utils::{L2_ETH_TOKEN_ADDRESS, REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT}, + ZKMiddleware, }; -use constants::{L1_FEE_ESTIMATION_COEF_DENOMINATOR, L1_FEE_ESTIMATION_COEF_NUMERATOR}; use ethers::{ abi::{Address, Hash, Tokenizable}, middleware::SignerMiddleware, @@ -19,8 +18,10 @@ use ethers::{ types::U256, }; use std::sync::Arc; +use utils::{estimate_gas_for_l1_to_l2_tx, l2_tx_base_cost, scale_gas_limit}; mod constants; +mod utils; pub async fn deposit( amount: U256, @@ -47,126 +48,26 @@ where let zk_chain_id = l2_provider.get_chainid().await.unwrap(); let zk_chain_base_token: Address = bridgehub.base_token(zk_chain_id).call().await.unwrap(); - let token_to_deposit_is_eth = token == utils::L2_ETH_TOKEN_ADDRESS; let token_to_deposit_is_zk_chain_base_token = token == zk_chain_base_token; - match ( - token_to_deposit_is_eth, - token_to_deposit_is_zk_chain_base_token, - ) { - // Depositing base token. - (_, true) => { - deposit_base_token( - amount, - token, - from, - to, - refund_recipient, - zk_chain_id, - l2_provider, - bridgehub, - ) - .await - } - // Depositing ETH to a ZKChain whose base token is not ETH. - (true, false) => { - let erc20 = ERC20::new(token, Arc::>::clone(&from)); - deposit_non_base_erc20_token( - amount, - token, - from, - to, - refund_recipient, - l2_provider, - bridgehub, - erc20, - ) - .await - } - // We are depositing an ERC20 to a ZKChain where: - // 1. ETH is the base token. - // 2. An ERC20 different than the deposited is the base token. - (false, false) => { - let erc20 = ERC20::new(token, Arc::>::clone(&from)); - deposit_non_base_erc20_token( - amount, - token, - from, - to, - refund_recipient, - l2_provider, - bridgehub, - erc20, - ) - .await - } - } -} - -pub async fn deposit_base_token( - amount: U256, - token: Address, - from: Arc>, - to: Address, - refund_recipient: Address, - zk_chain_id: U256, - l2_provider: &L2Provider, - bridgehub: Bridgehub>, -) -> Hash -where - M: Middleware, - S: Signer, - L2Provider: ZKMiddleware + Middleware, -{ - let from_addr = from.address(); - // The amount of gas required for executing an L2 tx via L1. - let estimate_l1_to_l2_gas = l2_provider - .estimate_gas_l1_to_l2( - Eip712TransactionRequest::new() - .chain_id(zk_chain_id) - .from(from_addr) - .to(to), - ) - .await - .unwrap(); - let l2_gas_per_pubdata_byte_limit = U256::from(utils::REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT); + let estimate_gas_for_l1_to_l2_tx = + estimate_gas_for_l1_to_l2_tx(from.address(), to, zk_chain_id, &l2_provider).await; + let l2_gas_per_pubdata_byte_limit = U256::from(REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT); let operator_tip = U256::zero(); - let base_cost: U256 = bridgehub - .l_2_transaction_base_cost( - zk_chain_id, - from.get_gas_price().await.unwrap(), - estimate_l1_to_l2_gas, - l2_gas_per_pubdata_byte_limit, - ) - .call() - .await - .unwrap(); + let base_cost = l2_tx_base_cost( + &bridgehub, + zk_chain_id, + from.get_gas_price().await.unwrap(), + estimate_gas_for_l1_to_l2_tx, + l2_gas_per_pubdata_byte_limit, + ) + .await; let l2_costs = base_cost + operator_tip + amount; - // There's no need to override l2_calldata for depositing ETH into an - // ETH based chain. - // - // l2_contract and refund_recipient could be overridden in the future. - // You might want to deposit ETH into a different account or contract, - // or you might want to refund the deposit to a different account or - // L1 contract. - // - // factory_deps is empty for depositing ETH into an ETH based chain. - let request = L2TransactionRequestDirect::new() - .chain_id(zk_chain_id) - .mint_value(l2_costs) - .l2_contract(to) - .l2_value(amount) - .l2_calldata(vec![]) - .l2_gas_limit(estimate_l1_to_l2_gas) - .l2_gas_per_pubdata_byte_limit(l2_gas_per_pubdata_byte_limit) - .factory_deps(vec![]) - .refund_recipient(refund_recipient); - - let base_token_is_eth = token == utils::L2_ETH_TOKEN_ADDRESS; - if !base_token_is_eth { - let l1_shared_bridge_address: Address = bridgehub.shared_bridge().call().await.unwrap(); + let l1_shared_bridge_address: Address = bridgehub.shared_bridge().call().await.unwrap(); + let token_is_eth = token == L2_ETH_TOKEN_ADDRESS; + if !token_is_eth { let erc20 = ERC20::new(token, Arc::>::clone(&from)); let allowance: U256 = erc20 @@ -188,19 +89,48 @@ where } } - let value = base_token_is_eth.then_some(l2_costs).unwrap_or_default(); - - // NOTE: In ETH deposits, the amount of ETH to be deposited into the - // ETH based chain should be part of the `value` field of the L1 tx - // which essentially is the call to the `requestL2TransactionDirect`. let overrides = L1TxOverrides::default() - .from(from_addr) - .value(value) + .from(from.address()) + .value(token_is_eth.then_some(l2_costs).unwrap_or_default()) .gas_price(from.get_gas_price().await.unwrap()) - .gas(scale_gas_limit(estimate_l1_to_l2_gas)) - .nonce(from.get_transaction_count(from_addr, None).await.unwrap()); - - deposit_with_l2_transaction_direct_request(bridgehub, request, overrides).await + .gas(scale_gas_limit(estimate_gas_for_l1_to_l2_tx)) + .nonce( + from.get_transaction_count(from.address(), None) + .await + .unwrap(), + ); + + if token_to_deposit_is_zk_chain_base_token { + let request = L2TransactionRequestDirect::new() + .chain_id(zk_chain_id) + .mint_value(l2_costs) + .l2_contract(to) + .l2_value(amount) + .l2_calldata(vec![]) + .l2_gas_limit(estimate_gas_for_l1_to_l2_tx) + .l2_gas_per_pubdata_byte_limit(l2_gas_per_pubdata_byte_limit) + .factory_deps(vec![]) + .refund_recipient(refund_recipient); + + deposit_with_l2_transaction_direct_request(bridgehub, request, overrides).await + } else { + let request = L2TransactionRequestTwoBridgesOuter::new() + .chain_id(zk_chain_id) + .mint_value(l2_costs) + .l2_value(U256::zero()) + .l2_gas_limit(estimate_gas_for_l1_to_l2_tx) + .l2_gas_per_pubdata_byte_limit(l2_gas_per_pubdata_byte_limit) + .refund_recipient(refund_recipient) + .second_bridge_address(l1_shared_bridge_address) + .second_bridge_value(U256::zero()) + .second_bridge_calldata(ethers::abi::encode(&[ + token.into_token(), + amount.into_token(), + to.into_token(), + ])); + + deposit_with_l2_transaction_two_bridges_request(bridgehub, request, overrides).await + } } pub async fn deposit_with_l2_transaction_direct_request( @@ -228,104 +158,6 @@ where .transaction_hash } -/// Deposits ERC20 tokens into a ZKChain where the base token -/// is either ETH or a different ERC20 than the deposited. -pub async fn deposit_non_base_erc20_token( - amount: U256, - token: Address, - from: Arc>, - to: Address, - refund_recipient: Address, - l2_provider: &L2Provider, - bridgehub: Bridgehub>, - erc20: ERC20>, -) -> Hash -where - M: Middleware, - S: Signer, - L2Provider: ZKMiddleware + Middleware, -{ - let zk_chain_id = l2_provider.get_chainid().await.unwrap(); - // The amount of gas required for executing an L2 tx via L1. - let estimate_gas_for_l1_to_l2_tx = l2_provider - .estimate_gas_l1_to_l2( - Eip712TransactionRequest::new() - .chain_id(zk_chain_id) - .from(from.address()) - .to(to), - ) - .await - .unwrap(); - let l2_gas_per_pubdata_byte_limit = U256::from(utils::REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT); - let operator_tip = U256::zero(); - let base_cost = l2_tx_base_cost( - &bridgehub, - zk_chain_id, - from.get_gas_price().await.unwrap(), - estimate_gas_for_l1_to_l2_tx, - l2_gas_per_pubdata_byte_limit, - ) - .await; - let l2_costs = scale_gas_limit(base_cost + operator_tip); - - let l1_shared_bridge_address: Address = bridgehub.shared_bridge().call().await.unwrap(); - - let calldata = ethers::abi::encode(&[token.into_token(), amount.into_token(), to.into_token()]); - - let request: L2TransactionRequestTwoBridgesOuter = L2TransactionRequestTwoBridgesOuter::new() - .chain_id(zk_chain_id) - .mint_value(l2_costs) - .l2_value(U256::zero()) - .l2_gas_limit(estimate_gas_for_l1_to_l2_tx) - .l2_gas_per_pubdata_byte_limit(l2_gas_per_pubdata_byte_limit) - .refund_recipient(refund_recipient) - .second_bridge_address(l1_shared_bridge_address) - .second_bridge_value(U256::zero()) - .second_bridge_calldata(calldata); - - let allowance: U256 = erc20 - .allowance(from.address(), l1_shared_bridge_address) - .call() - .await - .unwrap(); - // ERC20 approval needs to be done before getting the nonce for the - // overrides. - if allowance < amount { - erc20 - .approve(l1_shared_bridge_address, amount) - .send() - .await - .unwrap() - .await - .unwrap() - .unwrap(); - } - - let nonce = from - .get_transaction_count(from.address(), None) - .await - .unwrap(); - let l1_gas_price = from.get_gas_price().await.unwrap(); - // The value should be overridden in the case where the base token is ETH. - let value = bridgehub - .base_token(zk_chain_id) - .call() - .await - .unwrap() - .eq(&utils::L2_ETH_TOKEN_ADDRESS) - .then_some(l2_costs) - .unwrap_or_default(); - - let overrides = L1TxOverrides::default() - .from(from.address()) - .gas_price(l1_gas_price) - .gas(estimate_gas_for_l1_to_l2_tx) - .nonce(nonce) - .value(value); - - deposit_with_l2_transaction_two_bridges_request(bridgehub, request, overrides).await -} - pub async fn deposit_with_l2_transaction_two_bridges_request( bridgehub: Bridgehub>, request: L2TransactionRequestTwoBridgesOuter, @@ -378,41 +210,6 @@ where .map(|new_priority_request_event| Hash::from_slice(&new_priority_request_event.data.0[32..64])) } -pub async fn l2_tx_base_cost( - bridgehub: &Bridgehub>, - zk_chain_id: U256, - l1_gas_price: U256, - estimate_gas_for_l1_to_l2_tx: U256, - l2_gas_per_pubdata_byte_limit: U256, -) -> U256 -where - M: Middleware, - S: Signer, -{ - bridgehub - .l_2_transaction_base_cost( - zk_chain_id, - l1_gas_price, - estimate_gas_for_l1_to_l2_tx, - l2_gas_per_pubdata_byte_limit, - ) - .call() - .await - .unwrap() -} - -/// Scales the provided gas limit using a coefficient to ensure acceptance of L1->L2 transactions. -/// -/// This function adjusts the gas limit by multiplying it with a coefficient calculated from the -/// `L1_FEE_ESTIMATION_COEF_NUMERATOR` and `L1_FEE_ESTIMATION_COEF_DENOMINATOR` constants. -pub fn scale_gas_limit(gas_limit: U256) -> U256 { - gas_limit - .checked_mul(U256::from(L1_FEE_ESTIMATION_COEF_NUMERATOR)) - .unwrap() - .checked_div(U256::from(L1_FEE_ESTIMATION_COEF_DENOMINATOR)) - .unwrap() -} - pub async fn wait_for_finalize_deposit( finalize_deposit_tx_hash: Hash, l2_provider: &L2Provider, diff --git a/src/deposit/utils.rs b/src/deposit/utils.rs new file mode 100644 index 0000000..0025752 --- /dev/null +++ b/src/deposit/utils.rs @@ -0,0 +1,59 @@ +use super::constants::{L1_FEE_ESTIMATION_COEF_DENOMINATOR, L1_FEE_ESTIMATION_COEF_NUMERATOR}; +use crate::{contracts::bridgehub::Bridgehub, eip712::Eip712TransactionRequest, ZKMiddleware}; +use ethers::{middleware::SignerMiddleware, providers::Middleware, signers::Signer}; +use zksync_types::{Address, U256}; + +pub async fn l2_tx_base_cost( + bridgehub: &Bridgehub>, + zk_chain_id: U256, + l1_gas_price: U256, + estimate_gas_for_l1_to_l2_tx: U256, + l2_gas_per_pubdata_byte_limit: U256, +) -> U256 +where + M: Middleware, + S: Signer, +{ + bridgehub + .l_2_transaction_base_cost( + zk_chain_id, + l1_gas_price, + estimate_gas_for_l1_to_l2_tx, + l2_gas_per_pubdata_byte_limit, + ) + .call() + .await + .unwrap() +} + +/// Scales the provided gas limit using a coefficient to ensure acceptance of L1->L2 transactions. +/// +/// This function adjusts the gas limit by multiplying it with a coefficient calculated from the +/// `L1_FEE_ESTIMATION_COEF_NUMERATOR` and `L1_FEE_ESTIMATION_COEF_DENOMINATOR` constants. +pub fn scale_gas_limit(gas_limit: U256) -> U256 { + gas_limit + .checked_mul(U256::from(L1_FEE_ESTIMATION_COEF_NUMERATOR)) + .unwrap() + .checked_div(U256::from(L1_FEE_ESTIMATION_COEF_DENOMINATOR)) + .unwrap() +} + +pub async fn estimate_gas_for_l1_to_l2_tx( + from: Address, + to: Address, + zk_chain_id: U256, + l2_provider: &L2Provider, +) -> U256 +where + L2Provider: ZKMiddleware + Middleware, +{ + l2_provider + .estimate_gas_l1_to_l2( + Eip712TransactionRequest::new() + .chain_id(zk_chain_id) + .from(from) + .to(to), + ) + .await + .unwrap() +} From 666342f2e063e79e599645b2ea74399e499ca218 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Fri, 16 Aug 2024 10:26:26 -0300 Subject: [PATCH 55/75] Add Governance implementation --- abi/IGovernance.json | 495 ++++++++++++++++++++++++++++++++++++ src/contracts/governance.rs | 3 + src/contracts/mod.rs | 1 + 3 files changed, 499 insertions(+) create mode 100644 abi/IGovernance.json create mode 100644 src/contracts/governance.rs diff --git a/abi/IGovernance.json b/abi/IGovernance.json new file mode 100644 index 0000000..35164f1 --- /dev/null +++ b/abi/IGovernance.json @@ -0,0 +1,495 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_delayBefore", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_delayAfter", + "type": "uint256" + } + ], + "name": "ChangeMinDelay", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_securityCouncilBefore", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_securityCouncilAfter", + "type": "address" + } + ], + "name": "ChangeSecurityCouncil", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "OperationCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "OperationExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delay", + "type": "uint256" + } + ], + "name": "ShadowOperationScheduled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delay", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IGovernance.Call[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "bytes32", + "name": "predecessor", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct IGovernance.Operation", + "name": "_operation", + "type": "tuple" + } + ], + "name": "TransparentOperationScheduled", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "cancel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IGovernance.Call[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "bytes32", + "name": "predecessor", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "internalType": "struct IGovernance.Operation", + "name": "_operation", + "type": "tuple" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IGovernance.Call[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "bytes32", + "name": "predecessor", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "internalType": "struct IGovernance.Operation", + "name": "_operation", + "type": "tuple" + } + ], + "name": "executeInstant", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "getOperationState", + "outputs": [ + { + "internalType": "enum IGovernance.OperationState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IGovernance.Call[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "bytes32", + "name": "predecessor", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "internalType": "struct IGovernance.Operation", + "name": "_operation", + "type": "tuple" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "isOperation", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "isOperationDone", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "isOperationPending", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + } + ], + "name": "isOperationReady", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_id", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_delay", + "type": "uint256" + } + ], + "name": "scheduleShadow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IGovernance.Call[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "bytes32", + "name": "predecessor", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "internalType": "struct IGovernance.Operation", + "name": "_operation", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_delay", + "type": "uint256" + } + ], + "name": "scheduleTransparent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_newDelay", + "type": "uint256" + } + ], + "name": "updateDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newSecurityCouncil", + "type": "address" + } + ], + "name": "updateSecurityCouncil", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/contracts/governance.rs b/src/contracts/governance.rs new file mode 100644 index 0000000..3aed7bb --- /dev/null +++ b/src/contracts/governance.rs @@ -0,0 +1,3 @@ +use ethers_contract::abigen; + +abigen!(Governance, "abi/IGovernance.json"); diff --git a/src/contracts/mod.rs b/src/contracts/mod.rs index bba60f0..77b3829 100644 --- a/src/contracts/mod.rs +++ b/src/contracts/mod.rs @@ -1,5 +1,6 @@ pub mod bridgehub; pub mod erc20; +pub mod governance; pub mod l1_shared_bridge; pub mod main_contract; From 0d2d2bb2d1fe8ea495d598e41cc0135b91a97758 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Mon, 19 Aug 2024 13:39:34 -0300 Subject: [PATCH 56/75] Update IBridgehub --- abi/IBridgehub.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abi/IBridgehub.json b/abi/IBridgehub.json index 22db2fd..6875c94 100644 --- a/abi/IBridgehub.json +++ b/abi/IBridgehub.json @@ -166,7 +166,7 @@ "type": "uint256" } ], - "name": "getStateTransition", + "name": "getHyperchain", "outputs": [ { "internalType": "address", From 60d156f1a5e8fc29d37269938fbb56d83cf1d6db Mon Sep 17 00:00:00 2001 From: ilitteri Date: Mon, 19 Aug 2024 14:04:48 -0300 Subject: [PATCH 57/75] Use Bridgehub ABI instead of IBrideghub (more complete) --- abi/{IBridgehub.json => Bridgehub.json} | 192 +++++++++++++++++++++++- src/contracts/bridgehub.rs | 2 +- 2 files changed, 191 insertions(+), 3 deletions(-) rename abi/{IBridgehub.json => Bridgehub.json} (79%) diff --git a/abi/IBridgehub.json b/abi/Bridgehub.json similarity index 79% rename from abi/IBridgehub.json rename to abi/Bridgehub.json index 6875c94..7280f44 100644 --- a/abi/IBridgehub.json +++ b/abi/Bridgehub.json @@ -1,4 +1,22 @@ [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -62,6 +80,70 @@ "name": "NewPendingAdmin", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, { "inputs": [], "name": "acceptAdmin", @@ -69,6 +151,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -95,6 +184,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -151,7 +253,7 @@ "outputs": [ { "internalType": "uint256", - "name": "chainId", + "name": "", "type": "uint256" } ], @@ -177,6 +279,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -211,6 +326,52 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -400,6 +561,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -613,7 +781,7 @@ "inputs": [ { "internalType": "address", - "name": "_baseToken", + "name": "_token", "type": "address" } ], @@ -627,5 +795,25 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/src/contracts/bridgehub.rs b/src/contracts/bridgehub.rs index 99524fc..4046a13 100644 --- a/src/contracts/bridgehub.rs +++ b/src/contracts/bridgehub.rs @@ -1,7 +1,7 @@ use ethers::types::{Address, Bytes, U256}; use ethers_contract::abigen; -abigen!(Bridgehub, "abi/IBridgehub.json"); +abigen!(Bridgehub, "abi/Bridgehub.json"); /// struct L2TransactionRequestDirect { /// uint256 chainId; From 68a63c96967750caff99752ab72fc568e07fb8f9 Mon Sep 17 00:00:00 2001 From: Federico Borello <156438142+fborello-lambda@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:52:01 -0300 Subject: [PATCH 58/75] feat(transfer): add Overrides field that overrides nonce (#130) --- Cargo.toml | 14 +++++++------- src/transfer.rs | 37 ++++++++++++++++++++++--------------- src/types.rs | 41 +++++++++++++++++++++++++++++++++++++++++ src/withdraw.rs | 9 +++++++-- src/zk_wallet.rs | 30 ++++++++++++++++++++++++------ 5 files changed, 101 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7e88e33..c1f549a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,10 +16,10 @@ clap = { version = "4.2.7", features = ["derive"] } lazy_static = "1.4.0" # ZKsync -zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_types"} -zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_web3_decl"} -zksync_system_constants = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_system_constants"} -zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_contracts"} +zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_types" } +zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_web3_decl" } +zksync_system_constants = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_system_constants" } +zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_contracts" } # Async tokio = { version = "1", features = ["macros", "process"] } @@ -48,9 +48,9 @@ colored = "2.1.0" # Examples -[[example]] -name = "simple_payment" -path = "examples/simple_payment/main.rs" +#[[example]] +#name = "simple_payment" +#path = "examples/simple_payment/main.rs" [profile.test] opt-level = 3 diff --git a/src/transfer.rs b/src/transfer.rs index d277fb7..da56687 100644 --- a/src/transfer.rs +++ b/src/transfer.rs @@ -9,18 +9,16 @@ use ethers::{ types::{transaction::eip2718::TypedTransaction, Eip1559TransactionRequest, U256}, }; use std::sync::Arc; -use zksync_types::{L2_BASE_TOKEN_ADDRESS, MAX_L2_TX_GAS_LIMIT}; +use zksync_types::L2_BASE_TOKEN_ADDRESS; -use crate::{ - contracts::erc20::ERC20, - utils::{MAX_FEE_PER_GAS, MAX_PRIORITY_FEE_PER_GAS}, -}; +use crate::{contracts::erc20::ERC20, types::L2TxOverrides, ZKMiddleware}; pub async fn transfer( amount: U256, token: impl Into
, from: Arc>, to: Address, + overrides: Option, ) -> Hash where M: Middleware, @@ -32,35 +30,44 @@ where let token_to_transfer_is_zk_chain_base_token = token == L2_BASE_TOKEN_ADDRESS; if token_to_transfer_is_zk_chain_base_token { - transfer_base_token(amount, from, to).await + transfer_base_token(amount, from, to, overrides).await } else { transfer_non_base_token(amount, token, from, to).await } } +/// The fee has to be deducted manually, amount is the exact amount that has to be transferred pub async fn transfer_base_token( amount: U256, from: Arc>, to: Address, + overrides: Option, ) -> Hash where M: Middleware, S: Signer, { + let transaction_count = from + .get_transaction_count(from.address(), None) + .await + .unwrap(); + + let nonce = if let Some(overrides) = overrides { + overrides.nonce.unwrap_or(transaction_count) + } else { + transaction_count + }; + let mut transfer_tx = Eip1559TransactionRequest::new() .from(from.address()) .to(to) .value(amount) - .nonce( - from.get_transaction_count(from.address(), None) - .await - .unwrap(), - ); - // let fee = from.estimate_fee(transfer_tx.clone()).await.unwrap(); + .nonce(nonce); + let fees = from.provider().estimate_fee(&transfer_tx).await.unwrap(); transfer_tx = transfer_tx - .max_fee_per_gas(MAX_FEE_PER_GAS) - .max_priority_fee_per_gas(MAX_PRIORITY_FEE_PER_GAS) - .gas(MAX_L2_TX_GAS_LIMIT); + .max_fee_per_gas(fees.max_fee_per_gas) + .max_priority_fee_per_gas(fees.max_priority_fee_per_gas) + .gas(fees.gas_limit); let tx: TypedTransaction = transfer_tx.into(); diff --git a/src/types.rs b/src/types.rs index eaf9e5b..babc33b 100644 --- a/src/types.rs +++ b/src/types.rs @@ -49,3 +49,44 @@ impl L1TxOverrides { self } } + +#[derive(Debug, Clone, Default)] +pub struct L2TxOverrides { + pub from: Option
, + pub value: Option, + pub gas_price: Option, + pub gas: Option, + pub nonce: Option, + pub gas_limit: Option, +} + +impl L2TxOverrides { + pub fn new() -> Self { + Self::default() + } + + pub fn from(mut self, from: Address) -> Self { + self.from = Some(from); + self + } + + pub fn value(mut self, value: U256) -> Self { + self.value = Some(value); + self + } + + pub fn gas_price(mut self, gas_price: U256) -> Self { + self.gas_price = Some(gas_price); + self + } + + pub fn gas(mut self, gas: U256) -> Self { + self.gas = Some(gas); + self + } + + pub fn nonce(mut self, nonce: U256) -> Self { + self.nonce = Some(nonce); + self + } +} diff --git a/src/withdraw.rs b/src/withdraw.rs index 40161fc..9cf92dd 100644 --- a/src/withdraw.rs +++ b/src/withdraw.rs @@ -183,11 +183,16 @@ where ) .await .unwrap() - .unwrap() + .unwrap(); + + let withdrawal_msg_index = withdrawal_initialization_log_merkle_proof.id; + + let withdrawal_initialization_log_merkle_proof = withdrawal_initialization_log_merkle_proof .proof .into_iter() .map(Into::into) .collect::>(); + let l2_batch_number = withdrawal_initialization_tx_l2_to_l1_logs .iter() .find(|log| log.sender == L1_MESSENGER_ADDRESS) @@ -201,7 +206,7 @@ where .finalize_withdrawal( zk_chain_id.into(), l2_batch_number.as_u64().into(), - U256::zero(), + withdrawal_msg_index.into(), withdrawal_initialization_tx_number_in_batch, withdrawal_initialization_message, withdrawal_initialization_log_merkle_proof, diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index dbea109..ef9681e 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -8,7 +8,9 @@ use ethers::{ use std::sync::Arc; use zksync_types::L2_BASE_TOKEN_ADDRESS; -use crate::{deposit, transfer, utils::L2_ETH_TOKEN_ADDRESS, withdraw, ZKMiddleware}; +use crate::{ + deposit, transfer, types::L2TxOverrides, utils::L2_ETH_TOKEN_ADDRESS, withdraw, ZKMiddleware, +}; #[derive(thiserror::Error, Debug)] pub enum ZKWalletError { @@ -262,10 +264,13 @@ where /// The ETH is transferred from the wallet's L2 address. /// The transfer is done using the wallet's L2 signer. /// + /// The fee has to be deducted manually, amount is the exact amount that has to be transferred. + /// /// # Arguments /// /// * `amount` - The amount of ETH to transfer. /// * `to` - The address to transfer the ETH to. + /// * `overrides` - Override parameters, such as nonce and gas /// /// # Returns /// @@ -274,8 +279,14 @@ where /// # Errors /// /// If the transfer transaction fails. - pub async fn transfer_eth(&self, amount: U256, to: Address) -> Result { - self._transfer(amount, L2_ETH_TOKEN_ADDRESS, to).await + pub async fn transfer_eth( + &self, + amount: U256, + to: Address, + overrides: Option, + ) -> Result { + self._transfer(amount, L2_ETH_TOKEN_ADDRESS, to, overrides) + .await } /// Transfers an ERC20 token to a specified address. @@ -287,6 +298,7 @@ where /// * `amount` - The amount of the ERC20 token to transfer. /// * `token` - The address of the ERC20 token to transfer. /// * `to` - The address to transfer the ERC20 token to. + /// * `overrides` - Override parameters, such as nonce and gas /// /// # Returns /// @@ -300,12 +312,14 @@ where amount: U256, token: Address, to: Address, + overrides: Option, ) -> Result { - self._transfer(amount, token, to).await + self._transfer(amount, token, to, overrides).await } /// Transfers the L2's base token to a specified address. /// + /// The fee has to be deducted manually, amount is the exact amount that has to be transferred. /// # Arguments /// /// * `amount` - The amount of the base token to transfer. @@ -323,8 +337,10 @@ where &self, amount: U256, to: Address, + overrides: Option, ) -> Result { - self._transfer(amount, L2_BASE_TOKEN_ADDRESS, to).await + self._transfer(amount, L2_BASE_TOKEN_ADDRESS, to, overrides) + .await } /* L1 Signer Getters */ @@ -480,8 +496,10 @@ where amount: U256, token: Address, to: Address, + overrides: Option, ) -> Result { - let transfer_hash = transfer::transfer(amount, token, self.l2_signer(), to).await; + let transfer_hash = + transfer::transfer(amount, token, self.l2_signer(), to, overrides).await; Ok(transfer_hash) } From 6a81b46aa192a4d8ccf436e5ec7092ff5461a8db Mon Sep 17 00:00:00 2001 From: ilitteri Date: Tue, 20 Aug 2024 15:38:22 -0300 Subject: [PATCH 59/75] Refactor --- src/zk_wallet.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index ef9681e..44a05ac 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -453,7 +453,7 @@ where /// /// An ARC reference to the wallet's L1 signer. pub fn l1_signer(&self) -> Arc> { - self.l1_signer.clone() + Arc::clone(&self.l1_signer) } /// Gets the wallet's L2 signer. @@ -462,7 +462,7 @@ where /// /// An ARC reference to the wallet's L2 signer. pub fn l2_signer(&self) -> Arc> { - self.l2_signer.clone() + Arc::clone(&self.l2_signer) } /* Internals */ From 8ffbec9043d266ee9d398fef24602bfcb6068c49 Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Tue, 20 Aug 2024 16:27:27 -0300 Subject: [PATCH 60/75] feat(mint-erc20): add abi interface --- src/contracts/erc20.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/contracts/erc20.rs b/src/contracts/erc20.rs index 8c58c91..57ac1ad 100644 --- a/src/contracts/erc20.rs +++ b/src/contracts/erc20.rs @@ -1,3 +1,8 @@ use ethers_contract::abigen; abigen!(ERC20, "abi/IERC20.json"); + +abigen!( + MINT_IERC20, + "[function mint(address _to, uint256 _amount) public returns (bool)]" +); From 5e18ae821f18aaa55324489bba125853c851c4d0 Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Wed, 21 Aug 2024 17:27:43 -0300 Subject: [PATCH 61/75] remove(wait_for_finalize_withdrawal): print msg --- src/withdraw.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/withdraw.rs b/src/withdraw.rs index 9cf92dd..c7b5074 100644 --- a/src/withdraw.rs +++ b/src/withdraw.rs @@ -109,7 +109,6 @@ pub async fn wait_for_finalize_withdrawal( { break; } - println!("Withdraw request not executed on L1 yet. Retrying in 5 seconds..."); tokio::time::sleep(std::time::Duration::from_secs(5)).await; } } From 43f507e8e18a11a8899a1abdc6c12233fea8c61a Mon Sep 17 00:00:00 2001 From: ilitteri Date: Thu, 29 Aug 2024 12:12:09 -0300 Subject: [PATCH 62/75] Use zksync-era main --- Cargo.lock | 4261 ++++++++++++++++++++++++++++-------------- Cargo.toml | 9 +- src/types.rs | 1 + src/zk_middleware.rs | 25 +- 4 files changed, 2846 insertions(+), 1450 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1cf7594..9528c11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,26 +27,38 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aes" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cipher", "cpufeatures", ] [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -58,29 +70,14 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon 1.0.1", - "colorchoice", - "is-terminal", - "utf8parse", -] - -[[package]] -name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", - "anstyle-wincon 3.0.3", + "anstyle-wincon", "colorchoice", "is_terminal_polyfill", "utf8parse", @@ -88,43 +85,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "anstyle-wincon" -version = "1.0.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -136,11 +123,23 @@ version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +[[package]] +name = "arrayref" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" + [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" @@ -152,25 +151,36 @@ dependencies = [ ] [[package]] -name = "async-lock" -version = "3.4.0" +name = "async-stream" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ - "event-listener", - "event-listener-strategy", + "async-stream-impl", + "futures-core", "pin-project-lite", ] +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] @@ -185,48 +195,68 @@ dependencies = [ ] [[package]] -name = "atty" -version = "0.2.14" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "auto_impl" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "aws-lc-rs" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0f0e249228c6ad2d240c2dc94b714d711629d52bad946075d8e9b2f5391f0703" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] [[package]] name = "axum" -version = "0.6.20" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", - "http", - "http-body", - "hyper", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", "itoa", "matchit", "memchr", @@ -235,7 +265,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 1.0.1", "tower", "tower-layer", "tower-service", @@ -243,17 +273,20 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper 0.1.2", "tower-layer", "tower-service", ] @@ -266,9 +299,9 @@ checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -293,9 +326,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" @@ -311,9 +344,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bech32" -version = "0.7.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] name = "beef" @@ -324,12 +357,62 @@ dependencies = [ "serde", ] +[[package]] +name = "bellman_ce" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ea340d5c1394ee4daf4415dd80e06f74e0ad9b08e21f73f6bb1fa3a9dfae80d" +dependencies = [ + "arrayvec 0.7.6", + "bit-vec", + "blake2s_const 0.7.0", + "blake2s_simd", + "byteorder", + "cfg-if 1.0.0", + "crossbeam 0.7.3", + "futures", + "hex", + "lazy_static", + "num_cpus", + "pairing_ce", + "rand 0.4.6", + "serde", + "smallvec", + "tiny-keccak 1.5.0", +] + +[[package]] +name = "bellman_ce" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aab6627603565b664e6c643a1dc7ea8bbff25b776f5fecd80ac88308fc7007b" +dependencies = [ + "arrayvec 0.7.6", + "bit-vec", + "blake2s_const 0.8.0", + "blake2s_simd", + "byteorder", + "cfg-if 1.0.0", + "crossbeam 0.7.3", + "futures", + "hex", + "lazy_static", + "num_cpus", + "pairing_ce", + "rand 0.4.6", + "serde", + "smallvec", + "tiny-keccak 1.5.0", +] + [[package]] name = "bigdecimal" -version = "0.3.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +checksum = "51d712318a27c7150326677b321a5fa91b55f6d9034ffd67f20319e147d40cee" dependencies = [ + "autocfg", + "libm", "num-bigint", "num-integer", "num-traits", @@ -344,6 +427,29 @@ dependencies = [ "serde", ] +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.76", + "which", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -358,6 +464,9 @@ name = "bit-vec" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +dependencies = [ + "serde", +] [[package]] name = "bitflags" @@ -371,16 +480,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -[[package]] -name = "bitvec" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" -dependencies = [ - "either", - "radium 0.3.0", -] - [[package]] name = "bitvec" version = "1.0.1" @@ -388,7 +487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", - "radium 0.7.0", + "radium", "tap", "wyz", ] @@ -399,24 +498,49 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] -name = "blake2" +name = "blake2_ce" version = "0.10.6" -source = "git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e#1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90cef65f11dd09a6c58914148161dbf190e5dcc02c87ed2aa47b3b97d3e7ce76" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] -name = "block-buffer" -version = "0.9.0" +name = "blake2s_const" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "f39d933cb38939f885001867874c65699c36f30f0c78aae9f4c9f01b3e4b306a" dependencies = [ - "generic-array", + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "blake2s_const" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db04f0f5f88d8c95977159949b23d2ed24d33309901cf7f7e48ed40f36de667" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "blake2s_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", ] [[package]] @@ -428,20 +552,52 @@ dependencies = [ "generic-array", ] +[[package]] +name = "boojum" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df88daa33db46d683967ca09a4f04817c38950483f2501a771d497669a8a4bb1" +dependencies = [ + "arrayvec 0.7.6", + "bincode", + "blake2", + "const_format", + "convert_case", + "crossbeam 0.8.4", + "crypto-bigint 0.5.5", + "cs_derive", + "derivative", + "ethereum-types", + "firestorm", + "itertools 0.10.5", + "lazy_static", + "num-modular", + "num_cpus", + "pairing_ce", + "rand 0.8.5", + "rayon", + "serde", + "sha2", + "sha3_ce", + "smallvec", + "unroll", +] + [[package]] name = "bs58" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "sha2 0.9.9", + "sha2", + "tinyvec", ] [[package]] name = "bumpalo" -version = "3.12.2" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -451,42 +607,63 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "camino" -version = "1.1.4" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" -version = "0.15.4" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", @@ -498,9 +675,35 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.106" +version = "1.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "066fce287b1d4eafef758e89e09d724a24808a9196fe9756b8ca90e86d0719a2" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "cfg-if" @@ -510,18 +713,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.52.6", ] [[package]] @@ -535,147 +737,238 @@ dependencies = [ ] [[package]] -name = "clap" -version = "3.2.25" +name = "circuit_encodings" +version = "0.140.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "b8438d7af992b730143b679e2c6938cb9e0193897ecaf668c59189af8ac296b7" dependencies = [ - "atty", - "bitflags 1.3.2", - "clap_derive 3.2.25", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "once_cell", - "strsim", - "termcolor", - "textwrap", + "derivative", + "serde", + "zk_evm 0.140.0", + "zkevm_circuits 0.140.2", ] [[package]] -name = "clap" -version = "4.3.0" +name = "circuit_encodings" +version = "0.141.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +checksum = "01a2fcc80e97682104f355dd819cb4972583828a6c0f65ec26889a78a84b0c56" dependencies = [ - "clap_builder", - "clap_derive 4.3.0", - "once_cell", + "derivative", + "serde", + "zk_evm 0.141.0", + "zkevm_circuits 0.141.1", ] [[package]] -name = "clap_builder" -version = "4.3.0" +name = "circuit_encodings" +version = "0.142.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +checksum = "94be7afb5ace6024d6e3c105d521b4b9b563bac14a92c2f59c4683e9169a25d8" dependencies = [ - "anstream 0.3.2", - "anstyle", - "bitflags 1.3.2", - "clap_lex 0.5.0", - "strsim", + "derivative", + "serde", + "zk_evm 0.141.0", + "zkevm_circuits 0.141.1", ] [[package]] -name = "clap_derive" -version = "3.2.25" +name = "circuit_encodings" +version = "0.150.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "2593c02ad6b4b31ba63506c3f807f666133dd36bf47422f99b1d2947cf3c8dc1" dependencies = [ - "heck 0.4.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "derivative", + "serde", + "zk_evm 0.150.4", + "zkevm_circuits 0.150.4", ] [[package]] -name = "clap_derive" -version = "4.3.0" +name = "circuit_sequencer_api" +version = "0.133.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" +checksum = "6a87dc7bee6630d4954ac7982eb77e2007476662250cf18e5c460bbc5ee435f1" dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.70", + "bellman_ce 0.7.0", + "derivative", + "rayon", + "serde", + "zk_evm 0.133.0", ] [[package]] -name = "clap_lex" -version = "0.2.4" +name = "circuit_sequencer_api" +version = "0.140.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "9d9b15463f9da44561867e6416a5b9c343164636811f68503868d37675be2d59" dependencies = [ - "os_str_bytes", + "bellman_ce 0.8.0", + "circuit_encodings 0.140.1", + "derivative", + "rayon", + "serde", + "zk_evm 0.140.0", ] [[package]] -name = "clap_lex" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" - -[[package]] -name = "coins-bip32" -version = "0.8.3" +name = "circuit_sequencer_api" +version = "0.141.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30a84aab436fcb256a2ab3c80663d8aec686e6bae12827bb05fef3e1e439c9f" +checksum = "55a257b31a8ea1c1723cab4fb5661c6b4c0ebe022d4b73bea9eb7c9150bd3bc1" dependencies = [ - "bincode", - "bs58", - "coins-core", - "digest 0.10.7", - "getrandom", - "hmac", - "k256 0.13.1", - "lazy_static", + "bellman_ce 0.8.0", + "circuit_encodings 0.141.1", + "derivative", + "rayon", "serde", - "sha2 0.10.8", - "thiserror", + "zk_evm 0.141.0", +] + +[[package]] +name = "circuit_sequencer_api" +version = "0.142.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "273351e61b0f9a36b09550e244989c38f9877382b42d0329797c72004dcabef7" +dependencies = [ + "bellman_ce 0.8.0", + "circuit_encodings 0.142.1", + "derivative", + "rayon", + "serde", + "zk_evm 0.141.0", +] + +[[package]] +name = "circuit_sequencer_api" +version = "0.150.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d1a86b9c2207f3bb2dff5f00d1af1cb95004b6d07e9bacb6519fe08f12c04b" +dependencies = [ + "bellman_ce 0.7.0", + "circuit_encodings 0.150.4", + "derivative", + "rayon", + "serde", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", +] + +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "cmake" +version = "0.1.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +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", + "digest", + "hmac", + "k256 0.13.3", + "serde", + "sha2", + "thiserror", ] [[package]] name = "coins-bip39" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f4d04ee18e58356accd644896aeb2094ddeafb6a713e056cef0c0a8e468c15" +checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" dependencies = [ - "bitvec 0.17.4", + "bitvec", "coins-bip32", - "getrandom", "hmac", "once_cell", - "pbkdf2 0.12.1", - "rand", - "sha2 0.10.8", + "pbkdf2 0.12.2", + "rand 0.8.5", + "sha2", "thiserror", ] [[package]] name = "coins-core" -version = "0.8.3" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b949a1c63fb7eb591eb7ba438746326aedf0ae843e51ec92ba6bec5bb382c4f" +checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base64 0.21.1", + "base64 0.21.7", "bech32", "bs58", - "digest 0.10.7", + "digest", "generic-array", "hex", "ripemd", "serde", "serde_derive", - "sha2 0.10.8", - "sha3 0.10.8", + "sha2", + "sha3", "thiserror", ] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "colored" @@ -687,6 +980,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "compile-fmt" version = "0.1.0" @@ -694,46 +997,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bed69047ed42e52c7e38d6421eeb8ceefb4f2a2b52eed59137f7bad7908f6800" [[package]] -name = "concurrent-queue" -version = "2.5.0" +name = "const-hex" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ - "crossbeam-utils", + "cfg-if 1.0.0", + "cpufeatures", + "hex", + "proptest", + "serde", ] [[package]] -name = "console" -version = "0.14.1" +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const_format" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "regex", - "terminal_size", - "unicode-width", - "winapi", + "const_format_proc_macros", ] [[package]] -name = "console" -version = "0.15.8" +name = "const_format_proc_macros" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "windows-sys 0.52.0", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] -name = "const-oid" -version = "0.9.2" +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "core-foundation" @@ -747,62 +1062,156 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-channel 0.4.4", + "crossbeam-deque 0.7.4", + "crossbeam-epoch 0.8.2", + "crossbeam-queue 0.2.3", + "crossbeam-utils 0.7.2", +] + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel 0.5.13", + "crossbeam-deque 0.8.5", + "crossbeam-epoch 0.9.18", + "crossbeam-queue 0.3.11", + "crossbeam-utils 0.8.20", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils 0.8.20", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" dependencies = [ - "cfg-if", - "crossbeam-utils", + "crossbeam-epoch 0.8.2", + "crossbeam-utils 0.7.2", + "maybe-uninit", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", + "crossbeam-epoch 0.9.18", + "crossbeam-utils 0.8.20", ] [[package]] name = "crossbeam-epoch" -version = "0.9.14" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ "autocfg", - "cfg-if", - "crossbeam-utils", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", "memoffset", "scopeguard", ] +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils 0.8.20", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils 0.8.20", +] + [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "cfg-if", + "autocfg", + "cfg-if 0.1.10", + "lazy_static", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + [[package]] name = "crunchy" version = "0.2.2" @@ -816,19 +1225,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -843,6 +1252,28 @@ dependencies = [ "typenum", ] +[[package]] +name = "cs_derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24cf603ca4299c6e20e644da88897f7b81d688510f4887e818b0bfe0b792081b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ctor" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" +dependencies = [ + "quote", + "syn 2.0.76", +] + [[package]] name = "ctr" version = "0.9.2" @@ -872,7 +1303,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] @@ -889,9 +1320,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "debugid" @@ -915,11 +1346,12 @@ dependencies = [ [[package]] name = "der" -version = "0.7.6" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56acb310e15652100da43d130af8d97b509e95af61aab1c5a7939ef24337ee17" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", + "pem-rfc7468", "zeroize", ] @@ -930,19 +1362,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", + "serde", ] [[package]] -name = "derive_more" -version = "0.99.17" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "derive_more" version = "1.0.0-beta.6" @@ -960,59 +1404,59 @@ checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", "unicode-xid", ] -[[package]] -name = "dialoguer" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9dd058f8b65922819fabb4a41e7d1964e56344042c26efbccd465202c23fa0c" -dependencies = [ - "console 0.14.1", - "lazy_static", - "tempfile", - "zeroize", -] - [[package]] name = "diff" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-next" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -1032,9 +1476,9 @@ checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecdsa" @@ -1050,23 +1494,23 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.7" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.6", - "digest 0.10.7", - "elliptic-curve 0.13.5", + "der 0.7.9", + "digest", + "elliptic-curve 0.13.8", "rfc6979 0.4.0", - "signature 2.1.0", - "spki 0.7.2", + "signature 2.2.0", + "spki 0.7.3", ] [[package]] name = "either" -version = "1.8.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -1077,12 +1521,12 @@ dependencies = [ "base16ct 0.1.1", "crypto-bigint 0.4.9", "der 0.6.1", - "digest 0.10.7", + "digest", "ff 0.12.1", "generic-array", "group 0.12.1", "pkcs8 0.9.0", - "rand_core", + "rand_core 0.6.4", "sec1 0.3.0", "subtle", "zeroize", @@ -1090,19 +1534,20 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.5" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.2", - "digest 0.10.7", + "crypto-bigint 0.5.5", + "digest", "ff 0.13.0", "generic-array", "group 0.13.0", + "pem-rfc7468", "pkcs8 0.10.2", - "rand_core", - "sec1 0.7.2", + "rand_core 0.6.4", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -1118,51 +1563,57 @@ dependencies = [ [[package]] name = "ena" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ "log", ] -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] name = "enr" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf56acd72bb22d2824e66ae8e9e5ada4d0de17a69c7fd35569dde2ada8ec9116" +checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" dependencies = [ - "base64 0.13.1", + "base64 0.21.7", "bytes", "hex", - "k256 0.13.1", + "k256 0.13.3", "log", - "rand", + "rand 0.8.5", "rlp", "serde", - "sha3 0.10.8", + "sha3", "zeroize", ] +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ "log", "regex", @@ -1170,11 +1621,11 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ - "anstream 0.6.14", + "anstream", "anstyle", "env_filter", "humantime", @@ -1198,43 +1649,32 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "eth-keystore" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "eth-keystore" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" +checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ "aes", "ctr", - "digest 0.10.7", + "digest", "hex", "hmac", "pbkdf2 0.11.0", - "rand", + "rand 0.8.5", "scrypt", "serde", "serde_json", - "sha2 0.10.8", - "sha3 0.10.8", + "sha2", + "sha3", "thiserror", "uuid 0.8.2", ] @@ -1251,7 +1691,7 @@ dependencies = [ "regex", "serde", "serde_json", - "sha3 0.10.8", + "sha3", "thiserror", "uint", ] @@ -1268,7 +1708,7 @@ dependencies = [ "impl-rlp", "impl-serde", "scale-info", - "tiny-keccak", + "tiny-keccak 2.0.2", ] [[package]] @@ -1289,9 +1729,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.4" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5486fdc149826f38c388f26a7df72534ee3f20d3a3f72539376fa7b3bbc43d" +checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -1305,9 +1745,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.4" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c66a426b824a0f6d1361ad74b6b01adfd26c44ee1e14c3662dcf28406763ec5" +checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" dependencies = [ "ethers-core", "once_cell", @@ -1317,16 +1757,16 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.7" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e066a0d9cfc70c454672bf16bb433b0243427420076dc5b2f49c448fb5a10628" +checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" dependencies = [ + "const-hex", "ethers-contract-abigen", "ethers-contract-derive", "ethers-core", "ethers-providers", "futures-util", - "hex", "once_cell", "pin-project", "serde", @@ -1336,83 +1776,84 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.7" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c113e3e86b6bc16d98484b2c3bb2d01d6fed9f489fe2e592e5cc87c3024d616b" +checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" dependencies = [ "Inflector", + "const-hex", "dunce", "ethers-core", "ethers-etherscan", "eyre", - "hex", "prettyplease", "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.70", + "syn 2.0.76", "toml", "walkdir", ] [[package]] name = "ethers-contract-derive" -version = "2.0.7" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3fb5adee25701c79ec58fcf2c63594cd8829bc9ad6037ff862d5a111101ed2" +checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" dependencies = [ "Inflector", + "const-hex", "ethers-contract-abigen", "ethers-core", - "hex", "proc-macro2", "quote", "serde_json", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] name = "ethers-core" -version = "2.0.7" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6da5fa198af0d3be20c19192df2bd9590b92ce09a8421e793bec8851270f1b05" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "bytes", "cargo_metadata", "chrono", - "elliptic-curve 0.13.5", + "const-hex", + "elliptic-curve 0.13.8", "ethabi", "generic-array", - "hex", - "k256 0.13.1", - "num_enum 0.6.1", + "k256 0.13.3", + "num_enum 0.7.3", "once_cell", "open-fastrlp", - "rand", + "rand 0.8.5", "rlp", "serde", "serde_json", "strum", - "syn 2.0.70", + "syn 2.0.76", "tempfile", "thiserror", - "tiny-keccak", + "tiny-keccak 2.0.2", "unicode-xid", ] [[package]] name = "ethers-etherscan" -version = "2.0.7" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ebb401ba97c6f5af278c2c9936c4546cad75dec464b439ae6df249906f4caa" +checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ + "chrono", "ethers-core", "ethers-solc", - "reqwest", + "reqwest 0.11.27", "semver", "serde", "serde_json", @@ -1422,9 +1863,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.4" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75594cc450992fc7de701c9145de612325fd8a18be765b8ae78767ba2b74876f" +checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" dependencies = [ "async-trait", "auto_impl", @@ -1437,7 +1878,7 @@ dependencies = [ "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -1449,26 +1890,27 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.7" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b498fd2a6c019d023e43e83488cd1fb0721f299055975aa6bac8dbf1e95f2c" +checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" dependencies = [ "async-trait", "auto_impl", - "base64 0.21.1", + "base64 0.21.7", "bytes", + "const-hex", "enr", "ethers-core", "futures-core", "futures-timer", "futures-util", "hashers", - "hex", - "http", + "http 0.2.12", "instant", + "jsonwebtoken 8.3.0", "once_cell", "pin-project", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -1485,34 +1927,35 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.4" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bd11ad6929f01f01be74bb00d02bbd6552f22de030865c898b340a3a592db1" +checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" dependencies = [ "async-trait", "coins-bip32", "coins-bip39", - "elliptic-curve 0.13.5", + "const-hex", + "elliptic-curve 0.13.8", "eth-keystore", "ethers-core", - "hex", - "rand", - "sha2 0.10.8", + "rand 0.8.5", + "sha2", "thiserror", "tracing", ] [[package]] name = "ethers-solc" -version = "2.0.7" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a81c89f121595cf8959e746045bb8b25a6a38d72588561e1a3b7992fc213f674" +checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", + "const-hex", + "dirs", "dunce", "ethers-core", "glob", - "hex", "home", "md-5", "num_cpus", @@ -1526,39 +1969,18 @@ dependencies = [ "solang-parser", "svm-rs", "thiserror", - "tiny-keccak", + "tiny-keccak 2.0.2", "tokio", "tracing", "walkdir", "yansi", ] -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener", - "pin-project-lite", -] - [[package]] name = "eyre" -version = "0.6.8" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", @@ -1566,12 +1988,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.9.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" @@ -1579,7 +1998,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1589,10 +2008,38 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "ff_ce" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b538e4231443a5b9c507caee3356f016d832cf7393d2d90f03ea3180d4e3fbc" +dependencies = [ + "byteorder", + "ff_derive_ce", + "hex", + "rand 0.4.6", + "serde", +] + +[[package]] +name = "ff_derive_ce" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96fbccd88dbb1fac4ee4a07c2fcc4ca719a74ffbd9d2b9d41d8c8eb073d8b20" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", +] + [[package]] name = "findshlibs" version = "0.10.2" @@ -1605,6 +2052,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "firestorm" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1612,7 +2065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -1623,6 +2076,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flate2" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.0", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1663,6 +2126,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + [[package]] name = "funty" version = "2.0.0" @@ -1671,9 +2146,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1686,9 +2161,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1696,26 +2171,27 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", "futures-util", + "num_cpus", ] [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-locks" @@ -1729,32 +2205,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" dependencies = [ "gloo-timers", "send_wrapper 0.4.0", @@ -1762,9 +2238,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1804,10 +2280,10 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -1833,7 +2309,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils", - "http", + "http 0.2.12", "js-sys", "pin-project", "serde", @@ -1869,6 +2345,81 @@ dependencies = [ "web-sys", ] +[[package]] +name = "google-cloud-auth" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1112c453c2e155b3e683204ffff52bcc6d6495d04b68d9e90cd24161270c5058" +dependencies = [ + "async-trait", + "base64 0.21.7", + "google-cloud-metadata", + "google-cloud-token", + "home", + "jsonwebtoken 9.3.0", + "reqwest 0.12.7", + "serde", + "serde_json", + "thiserror", + "time", + "tokio", + "tracing", + "urlencoding", +] + +[[package]] +name = "google-cloud-metadata" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f945a208886a13d07636f38fb978da371d0abc3e34bad338124b9f8c135a8f" +dependencies = [ + "reqwest 0.12.7", + "thiserror", + "tokio", +] + +[[package]] +name = "google-cloud-storage" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc0c5b7469142d91bd77959e69375bede324a5def07c7f29aa0d582586cba305" +dependencies = [ + "anyhow", + "async-stream", + "async-trait", + "base64 0.21.7", + "bytes", + "futures-util", + "google-cloud-auth", + "google-cloud-metadata", + "google-cloud-token", + "hex", + "once_cell", + "percent-encoding", + "pkcs8 0.10.2", + "regex", + "reqwest 0.12.7", + "reqwest-middleware", + "ring 0.17.8", + "serde", + "serde_json", + "sha2", + "thiserror", + "time", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "google-cloud-token" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c12ba8b21d128a2ce8585955246977fbce4415f680ebf9199b6f9d6d725f" +dependencies = [ + "async-trait", +] + [[package]] name = "group" version = "0.12.1" @@ -1876,7 +2427,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff 0.12.1", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1887,23 +2438,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff 0.13.0", - "rand_core", + "rand_core 0.6.4", "subtle", ] [[package]] name = "h2" -version = "0.3.19" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", - "indexmap 1.9.3", + "http 0.2.12", + "indexmap 2.4.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -1931,12 +2501,6 @@ dependencies = [ "fxhash", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -1945,27 +2509,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1979,16 +2525,16 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2004,9 +2550,20 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2015,26 +2572,49 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "http", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -2044,53 +2624,92 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2", "tokio", "tower-service", "tracing", "want", ] +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.30", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ - "http", - "hyper", + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", "log", - "rustls 0.21.1", - "rustls-native-certs 0.6.3", + "rustls 0.23.12", + "rustls-pki-types", "tokio", - "tokio-rustls 0.24.0", + "tokio-rustls 0.26.0", + "tower-service", ] [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper", + "hyper 1.4.1", + "hyper-util", "pin-project-lite", "tokio", - "tokio-io-timeout", + "tower-service", ] [[package]] @@ -2100,10 +2719,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.30", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.4.1", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -2201,26 +2856,14 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown 0.14.5", ] -[[package]] -name = "indicatif" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" -dependencies = [ - "console 0.15.8", - "lazy_static", - "number_prefix", - "regex", -] - [[package]] name = "inout" version = "0.1.3" @@ -2232,77 +2875,110 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] -name = "io-lifetimes" -version = "1.0.10" +name = "ipnet" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "ipnet" -version = "2.7.2" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] -name = "is-terminal" -version = "0.4.7" +name = "itertools" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", - "windows-sys 0.48.0", + "either", ] [[package]] -name = "is_terminal_polyfill" -version = "1.70.0" +name = "itertools" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonrpsee" -version = "0.21.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9579d0ca9fb30da026bac2f0f7d9576ec93489aeb7cd4971dd5b4617d82c79b2" +checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -2316,41 +2992,44 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.21.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9f9ed46590a8d5681975f126e22531698211b926129a40a2db47cbca429220" +checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" dependencies = [ + "base64 0.22.1", "futures-channel", "futures-util", "gloo-net", - "http", + "http 1.1.0", "jsonrpsee-core", "pin-project", - "rustls-native-certs 0.7.1", + "rustls 0.23.12", "rustls-pki-types", + "rustls-platform-verifier", "soketto", "thiserror", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tokio-util", "tracing", "url", - "webpki-roots 0.26.3", ] [[package]] name = "jsonrpsee-core" -version = "0.21.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "776d009e2f591b78c038e0d053a796f94575d66ca4e77dd84bfc5e81419e436c" +checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" dependencies = [ "anyhow", - "async-lock", "async-trait", "beef", + "bytes", "futures-timer", "futures-util", - "hyper", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", "jsonrpsee-types", "pin-project", "rustc-hash", @@ -2365,15 +3044,20 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.21.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7de9f3219d95985eb77fd03194d7c1b56c19bce1abfcc9d07462574b15572" +checksum = "2d90064e04fb9d7282b1c71044ea94d0bbc6eff5621c66f1a0bce9e9de7cf3ac" dependencies = [ "async-trait", - "hyper", - "hyper-rustls", + "base64 0.22.1", + "http-body 1.0.1", + "hyper 1.4.1", + "hyper-rustls 0.27.2", + "hyper-util", "jsonrpsee-core", "jsonrpsee-types", + "rustls 0.23.12", + "rustls-platform-verifier", "serde", "serde_json", "thiserror", @@ -2385,25 +3069,25 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.21.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94b7505034e2737e688e1153bf81e6f93ad296695c43958d6da2e4321f0a990" +checksum = "7895f186d5921065d96e16bd795e5ca89ac8356ec423fafc6e3d7cf8ec11aee4" dependencies = [ - "heck 0.4.1", - "proc-macro-crate 2.0.2", + "heck", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] name = "jsonrpsee-types" -version = "0.21.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3266dfb045c9174b24c77c2dfe0084914bb23a6b2597d70c9dc6018392e1cd1b" +checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" dependencies = [ - "anyhow", "beef", + "http 1.1.0", "serde", "serde_json", "thiserror", @@ -2411,9 +3095,9 @@ dependencies = [ [[package]] name = "jsonrpsee-wasm-client" -version = "0.21.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f36d27503d0efc0355c1630b74ecfb367050847bf7241a0ed75fab6dfa96c0" +checksum = "4727ac037f834c6f04c0912cada7532dbddb54e92fbc64e33d6cb8c24af313c9" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -2422,123 +3106,166 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.21.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "073c077471e89c4b511fa88b3df9a0f0abdf4a0a2e6683dd2ab36893af87bb2d" +checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" dependencies = [ - "http", + "http 1.1.0", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +dependencies = [ + "base64 0.21.7", + "js-sys", + "pem 3.0.4", + "ring 0.17.8", + "serde", + "serde_json", + "simple_asn1", +] + [[package]] name = "k256" version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "ecdsa 0.14.8", "elliptic-curve 0.12.3", - "sha2 0.10.8", + "sha2", ] [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "cfg-if", - "ecdsa 0.16.7", - "elliptic-curve 0.13.5", + "cfg-if 1.0.0", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "once_cell", - "sha2 0.10.8", - "signature 2.1.0", + "sha2", + "signature 2.2.0", ] [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", - "itertools", + "itertools 0.11.0", "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.6.29", + "regex-syntax 0.8.4", "string_cache", "term", - "tiny-keccak", + "tiny-keccak 2.0.2", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata 0.4.7", +] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] -name = "linkme" -version = "0.3.27" +name = "libloading" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb76662d78edc9f9bf56360d6919bdacc8b7761227727e5082f128eeb90bbf5" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ - "linkme-impl", + "cfg-if 1.0.0", + "windows-targets 0.52.6", ] [[package]] -name = "linkme-impl" -version = "0.3.27" +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dccda732e04fa3baf2e17cf835bfe2601c7c2edafd64417c627dabae3a8cda" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.70", + "bitflags 2.6.0", + "libc", ] [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2570,7 +3297,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] @@ -2594,7 +3321,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -2603,26 +3330,33 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "digest 0.10.7", + "cfg-if 1.0.0", + "digest", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" -version = "0.8.0" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ "autocfg", ] @@ -2647,7 +3381,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] @@ -2656,26 +3390,58 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "wasi", + "windows-sys 0.52.0", ] +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "multimap" version = "0.10.0" @@ -2701,9 +3467,19 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] [[package]] name = "nu-ansi-term" @@ -2776,6 +3552,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-modular" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.2" @@ -2795,15 +3581,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] @@ -2818,11 +3605,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.2", + "num_enum_derive 0.7.3", ] [[package]] @@ -2834,47 +3621,35 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "object" -version = "0.36.1" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" - -[[package]] -name = "opaque-debug" -version = "0.3.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "open-fastrlp" @@ -2882,7 +3657,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "auto_impl", "bytes", "ethereum-types", @@ -2903,12 +3678,12 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", "libc", "once_cell", @@ -2924,7 +3699,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] @@ -2935,9 +3710,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -2947,43 +3722,58 @@ dependencies = [ [[package]] name = "opentelemetry" -version = "0.20.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9591d937bc0e6d2feb6f71a559540ab300ea49955229c347a517a28d27784c54" +checksum = "4c365a63eec4f55b7efeceb724f1336f26a9cf3427b70e59e2cd2a5b947fba96" dependencies = [ - "opentelemetry_api", - "opentelemetry_sdk", + "futures-core", + "futures-sink", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", +] + +[[package]] +name = "opentelemetry-appender-tracing" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84de945cb3a6f1e0d6317cbd998bbd0519ab00f4b790db67e0ff4fdcf7cedb6" +dependencies = [ + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", ] [[package]] name = "opentelemetry-http" -version = "0.9.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7594ec0e11d8e33faf03530a4c49af7064ebba81c1480e01be67d90b356508b" +checksum = "ad31e9de44ee3538fb9d64fe3376c1362f406162434609e79aea2a41a0af78ab" dependencies = [ "async-trait", "bytes", - "http", - "opentelemetry_api", - "reqwest", + "http 1.1.0", + "opentelemetry", + "reqwest 0.12.7", ] [[package]] name = "opentelemetry-otlp" -version = "0.13.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" +checksum = "6b925a602ffb916fb7421276b86756027b37ee708f9dce2dbdcc51739f07e727" dependencies = [ "async-trait", "futures-core", - "http", + "http 1.1.0", + "opentelemetry", "opentelemetry-http", "opentelemetry-proto", - "opentelemetry-semantic-conventions", - "opentelemetry_api", "opentelemetry_sdk", - "prost 0.11.9", - "reqwest", + "prost 0.13.1", + "reqwest 0.12.7", "thiserror", "tokio", "tonic", @@ -2991,58 +3781,37 @@ dependencies = [ [[package]] name = "opentelemetry-proto" -version = "0.3.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" +checksum = "30ee9f20bff9c984511a02f082dc8ede839e4a9bf15cc2487c8d6fea5ad850d9" dependencies = [ - "opentelemetry_api", + "opentelemetry", "opentelemetry_sdk", - "prost 0.11.9", + "prost 0.13.1", "tonic", ] [[package]] name = "opentelemetry-semantic-conventions" -version = "0.12.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" -dependencies = [ - "opentelemetry", -] - -[[package]] -name = "opentelemetry_api" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" -dependencies = [ - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "js-sys", - "once_cell", - "pin-project-lite", - "thiserror", - "urlencoding", -] +checksum = "1cefe0543875379e47eb5f1e68ff83f45cc41366a92dfd0d073d513bf68e9a05" [[package]] name = "opentelemetry_sdk" -version = "0.20.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" +checksum = "692eac490ec80f24a17828d49b40b60f5aeaccdfe6a503f939713afd22bc28df" dependencies = [ "async-trait", - "crossbeam-channel", "futures-channel", "futures-executor", "futures-util", + "glob", "once_cell", - "opentelemetry_api", - "ordered-float 3.9.2", + "opentelemetry", "percent-encoding", - "rand", - "regex", + "rand 0.8.5", "serde_json", "thiserror", "tokio", @@ -3050,19 +3819,16 @@ dependencies = [ ] [[package]] -name = "ordered-float" -version = "2.10.1" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" -dependencies = [ - "num-traits", -] +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "3.9.2" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" dependencies = [ "num-traits", ] @@ -3078,26 +3844,45 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", + "primeorder", + "sha2", +] + +[[package]] +name = "pairing_ce" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843b5b6fb63f00460f611dbc87a50bbbb745f0dfe5cbf67ca89299c79098640e" +dependencies = [ + "byteorder", + "cfg-if 1.0.0", + "ff_ce", + "rand 0.4.6", + "serde", +] + [[package]] name = "parity-scale-codec" -version = "3.5.0" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec", - "bitvec 1.0.1", + "arrayvec 0.7.6", + "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", @@ -3106,27 +3891,21 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", ] -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -3134,20 +3913,37 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", - "windows-sys 0.45.0", + "windows-targets 0.52.6", ] [[package]] -name = "path-slash" -version = "0.2.1" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "path-slash" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" @@ -3157,19 +3953,50 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.7", + "digest", + "hmac", + "password-hash", + "sha2", ] [[package]] name = "pbkdf2" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ca0b5a68607598bf3bad68f32227a8164f6254833f84eafaac409cd6746c31" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "digest 0.10.7", + "digest", "hmac", ] +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +dependencies = [ + "base64 0.22.1", + "serde", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -3178,12 +4005,12 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 1.9.3", + "indexmap 2.4.0", ] [[package]] @@ -3198,35 +4025,35 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", - "phf_shared 0.11.1", + "phf_shared 0.11.2", ] [[package]] name = "phf_generator" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared 0.11.1", - "rand", + "phf_shared 0.11.2", + "rand 0.8.5", ] [[package]] name = "phf_macros" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ "phf_generator", - "phf_shared 0.11.1", + "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] @@ -3240,31 +4067,31 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", ] [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] @@ -3295,15 +4122,15 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.6", - "spki 0.7.2", + "der 0.7.9", + "spki 0.7.3", ] [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "powerfmt" @@ -3313,9 +4140,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -3323,21 +4153,40 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.70", + "syn 2.0.76", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve 0.13.8", ] [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -3354,17 +4203,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit 0.19.9", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "2.0.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.22.20", ] [[package]] @@ -3402,9 +4250,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" +checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", @@ -3420,17 +4268,23 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] -name = "prost" -version = "0.11.9" +name = "proptest" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ - "bytes", - "prost-derive 0.11.9", + "bitflags 2.6.0", + "lazy_static", + "num-traits", + "rand 0.8.5", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.4", + "unarray", ] [[package]] @@ -3443,6 +4297,16 @@ dependencies = [ "prost-derive 0.12.6", ] +[[package]] +name = "prost" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +dependencies = [ + "bytes", + "prost-derive 0.13.1", +] + [[package]] name = "prost-build" version = "0.12.6" @@ -3450,8 +4314,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck 0.4.1", - "itertools", + "heck", + "itertools 0.12.1", "log", "multimap", "once_cell", @@ -3460,34 +4324,34 @@ dependencies = [ "prost 0.12.6", "prost-types", "regex", - "syn 2.0.70", + "syn 2.0.76", "tempfile", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" dependencies = [ "anyhow", - "itertools", + "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] @@ -3496,7 +4360,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "057237efdb71cf4b3f9396302a3d6599a92fa94063ba537b66130980ea9909f3" dependencies = [ - "base64 0.21.1", + "base64 0.21.7", "logos", "miette", "once_cell", @@ -3553,24 +4417,31 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "radium" -version = "0.3.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] -name = "radium" -version = "0.7.0" +name = "rand" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", +] [[package]] name = "rand" @@ -3580,7 +4451,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -3590,9 +4461,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + [[package]] name = "rand_core" version = "0.6.4" @@ -3602,11 +4488,20 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.4", +] + [[package]] name = "rayon" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3614,54 +4509,53 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", + "crossbeam-deque 0.8.5", + "crossbeam-utils 0.8.20", ] [[package]] -name = "redox_syscall" -version = "0.2.16" +name = "rdrand" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" dependencies = [ - "bitflags 1.3.2", + "rand_core 0.3.1", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.8.1" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.1", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -3673,6 +4567,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -3681,27 +4586,27 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64 0.21.1", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "hyper-tls", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-rustls 0.24.2", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -3710,23 +4615,87 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.1", - "rustls-pemfile 1.0.2", + "rustls 0.21.12", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration 0.5.1", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.0", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.22.6", + "webpki-roots 0.25.4", "winreg", ] +[[package]] +name = "reqwest" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-rustls 0.27.2", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.1.3", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "system-configuration 0.6.1", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "windows-registry", +] + +[[package]] +name = "reqwest-middleware" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04" +dependencies = [ + "anyhow", + "async-trait", + "http 1.1.0", + "reqwest 0.12.7", + "serde", + "thiserror", + "tower-service", +] + [[package]] name = "rfc6979" version = "0.3.1" @@ -3770,7 +4739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.0", "getrandom", "libc", "spin 0.9.8", @@ -3784,7 +4753,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -3829,73 +4798,62 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.37.19" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.1" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.16.20", - "rustls-webpki 0.100.1", + "ring 0.17.8", + "rustls-webpki 0.101.7", "sct", ] [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ + "aws-lc-rs", "log", + "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.5", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.2", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-native-certs" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "rustls-pki-types", "schannel", "security-framework", @@ -3903,18 +4861,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.1", + "base64 0.21.7", ] [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64 0.22.1", "rustls-pki-types", @@ -3922,26 +4880,54 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" + +[[package]] +name = "rustls-platform-verifier" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.12", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki 0.102.7", + "security-framework", + "security-framework-sys", + "webpki-roots 0.26.3", + "winapi", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.100.1" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ + "aws-lc-rs", "ring 0.17.8", "rustls-pki-types", "untrusted 0.9.0", @@ -3949,15 +4935,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -3979,23 +4965,23 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.7.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b569c32c806ec3abdf3b5869fb8bf1e0d275a7c1c9b0b05603d9464632649edf" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ - "cfg-if", - "derive_more 0.99.17", + "cfg-if 1.0.0", + "derive_more 0.99.18", "parity-scale-codec", "scale-info-derive", ] [[package]] name = "scale-info-derive" -version = "2.6.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53012eae69e5aa5c14671942a5dd47de59d4cdcff8532a6dd0e081faf1119482" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -4012,9 +4998,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypt" @@ -4025,17 +5011,17 @@ dependencies = [ "hmac", "pbkdf2 0.11.0", "salsa20", - "sha2 0.10.8", + "sha2", ] [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -4054,12 +5040,12 @@ dependencies = [ [[package]] name = "sec1" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct 0.2.0", - "der 0.7.6", + "der 0.7.9", "generic-array", "pkcs8 0.10.2", "subtle", @@ -4095,22 +5081,23 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", + "num-bigint", "security-framework-sys", ] [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -4118,9 +5105,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -4145,7 +5132,7 @@ checksum = "6ce4b57f1b521f674df7a1d200be8ff5d74e3712020ee25b553146657b5377d5" dependencies = [ "httpdate", "native-tls", - "reqwest", + "reqwest 0.11.27", "sentry-backtrace", "sentry-contexts", "sentry-core", @@ -4189,7 +5176,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "901f761681f97db3db836ef9e094acdd8756c40215326c194201941947164ef1" dependencies = [ "once_cell", - "rand", + "rand 0.8.5", "sentry-types", "serde", "serde_json", @@ -4236,20 +5223,26 @@ checksum = "da956cca56e0101998c8688bc65ce1a96f00673a0e58e663664023d4c7911e82" dependencies = [ "debugid", "hex", - "rand", + "rand 0.8.5", "serde", "serde_json", "thiserror", - "time 0.3.36", + "time", "url", "uuid 1.10.0", ] +[[package]] +name = "seq-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" + [[package]] name = "serde" -version = "1.0.204" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -4260,37 +5253,38 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" dependencies = [ - "ordered-float 2.10.1", + "ordered-float", "serde", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -4313,6 +5307,7 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" dependencies = [ + "base64 0.13.1", "serde", "serde_with_macros", ] @@ -4335,7 +5330,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.4.0", "itoa", "ryu", "serde", @@ -4343,79 +5338,55 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.9.8" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] name = "sha2" -version = "0.9.9" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "digest", ] [[package]] -name = "sha2" +name = "sha2_ce" version = "0.10.6" -source = "git+https://github.com/RustCrypto/hashes.git?rev=1731ced4a116d61ba9dc6ee6d0f38fb8102e357a#1731ced4a116d61ba9dc6ee6d0f38fb8102e357a" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "eca2daa77078f4ddff27e75c4bf59e4c2697525f56dbb3c842d34a5d1f2b04a2" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] name = "sha3" -version = "0.10.6" -source = "git+https://github.com/RustCrypto/hashes.git?rev=7a187e934c1f6c68e4b4e5cf37541b7a0d64d303#7a187e934c1f6c68e4b4e5cf37541b7a0d64d303" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.7", + "digest", "keccak", ] [[package]] -name = "sha3" -version = "0.10.8" +name = "sha3_ce" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "34c9a08202c50378d8a07a5f458193a5f542d2828ac6640263dbc0c2533ea25e" dependencies = [ - "digest 0.10.7", + "digest", "keccak", ] @@ -4428,11 +5399,17 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -4443,49 +5420,54 @@ version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ - "digest 0.10.7", - "rand_core", + "digest", + "rand_core 0.6.4", ] [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core 0.6.4", +] + +[[package]] +name = "simple_asn1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ - "digest 0.10.7", - "rand_core", + "num-bigint", + "num-traits", + "thiserror", + "time", ] [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "socket2" -version = "0.4.9" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" dependencies = [ - "libc", - "winapi", + "serde", ] [[package]] @@ -4500,26 +5482,26 @@ dependencies = [ [[package]] name = "soketto" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" dependencies = [ - "base64 0.13.1", + "base64 0.22.1", "bytes", "futures", "httparse", "log", - "rand", - "sha-1", + "rand 0.8.5", + "sha1", ] [[package]] name = "solang-parser" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a94494913728908efa7a25a2dd2e4f037e714897985c24273c40596638ed909" +checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" dependencies = [ - "itertools", + "itertools 0.11.0", "lalrpop", "lalrpop-util", "phf", @@ -4551,12 +5533,12 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.6", + "der 0.7.9", ] [[package]] @@ -4590,62 +5572,58 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "strum" -version = "0.24.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "svm-rs" -version = "0.2.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7caafeac3fe8a93a9f2d1d1f80d14123b0dfbae8491be3c26bb8c44aed5d9ea" +checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" dependencies = [ - "anyhow", - "cfg-if", - "clap 3.2.25", - "console 0.14.1", - "dialoguer", + "dirs", "fs2", "hex", - "home", - "indicatif", - "itertools", "once_cell", - "rand", - "reqwest", + "reqwest 0.11.27", "semver", "serde", "serde_json", - "sha2 0.9.9", - "tempfile", + "sha2", "thiserror", - "tokio", - "tracing", "url", + "zip", ] [[package]] @@ -4661,9 +5639,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.70" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -4677,78 +5655,104 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "tap" +name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] -name = "tempfile" -version = "3.5.0" +name = "system-configuration" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix", - "windows-sys 0.45.0", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys 0.5.0", ] [[package]] -name = "term" -version = "0.7.0" +name = "system-configuration" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "bitflags 2.6.0", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] -name = "termcolor" -version = "1.2.0" +name = "system-configuration-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ - "winapi-util", + "core-foundation-sys", + "libc", ] [[package]] -name = "terminal_size" -version = "0.1.17" +name = "system-configuration-sys" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ + "core-foundation-sys", "libc", - "winapi", ] [[package]] -name = "textwrap" -version = "0.16.1" +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "term" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] @@ -4757,21 +5761,10 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "time" version = "0.3.36" @@ -4803,6 +5796,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" +dependencies = [ + "crunchy", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -4814,9 +5816,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -4829,42 +5831,31 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2", "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] @@ -4879,21 +5870,21 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.1", + "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls 0.23.12", "rustls-pki-types", "tokio", ] @@ -4911,24 +5902,24 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.21.1", + "rustls 0.21.12", "tokio", - "tokio-rustls 0.24.0", + "tokio-rustls 0.24.1", "tungstenite", - "webpki-roots 0.23.1", + "webpki-roots 0.25.4", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -4936,74 +5927,75 @@ dependencies = [ "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml" -version = "0.7.4" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.19.9", + "toml_edit 0.22.20", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.9" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 1.9.3", - "serde", - "serde_spanned", + "indexmap 2.4.0", "toml_datetime", - "winnow 0.4.6", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.4.0", + "serde", + "serde_spanned", "toml_datetime", - "winnow 0.5.40", + "winnow 0.6.18", ] [[package]] name = "tonic" -version = "0.9.2" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" dependencies = [ + "async-stream", "async-trait", "axum", - "base64 0.21.1", + "base64 0.22.1", "bytes", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", - "prost 0.11.9", + "prost 0.13.1", + "socket2", "tokio", "tokio-stream", "tower", @@ -5023,7 +6015,7 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand", + "rand 0.8.5", "slab", "tokio", "tokio-util", @@ -5034,23 +6026,22 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -5059,20 +6050,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -5088,17 +6079,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -5112,18 +6092,20 @@ dependencies = [ [[package]] name = "tracing-opentelemetry" -version = "0.21.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" +checksum = "a9784ed4da7d921bc8df6963f8c80a0e4ce34ba6ba76668acadd3edbd985ff3b" dependencies = [ + "js-sys", "once_cell", "opentelemetry", "opentelemetry_sdk", "smallvec", "tracing", "tracing-core", - "tracing-log 0.1.4", + "tracing-log", "tracing-subscriber", + "web-time", ] [[package]] @@ -5151,45 +6133,44 @@ dependencies = [ "sharded-slab", "smallvec", "thread_local", - "time 0.3.36", + "time", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", "tracing-serde", ] [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.12", "httparse", "log", - "rand", - "rustls 0.21.1", + "rand 0.8.5", + "rustls 0.21.12", "sha1", "thiserror", "url", "utf-8", - "webpki", ] [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uint" @@ -5212,27 +6193,48 @@ dependencies = [ "libc", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "unicode-width" version = "0.1.13" @@ -5241,9 +6243,19 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" + +[[package]] +name = "unroll" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "5ad948c1cb799b1a70f836077721a92a35ac177d4daddf4c20a633786d4cf618" +dependencies = [ + "quote", + "syn 1.0.109", +] [[package]] name = "unsafe-libyaml" @@ -5265,9 +6277,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72139d247e5f97a3eff96229a7ae85ead5328a39efe76f8bf5a06313d505b6ea" +checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" dependencies = [ "base64 0.22.1", "log", @@ -5302,9 +6314,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -5339,55 +6351,64 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vise" -version = "0.1.0" -source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ade36f3548b1524396f4de7b36f4f210c8a01dfab568eb2bff466af64eb6e5" dependencies = [ "compile-fmt", + "ctor", "elsa", - "linkme", "once_cell", "prometheus-client", "vise-macros", ] +[[package]] +name = "vise-exporter" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "671d3b894d5d0849f0a597f56bf071f42d4f2a1cbcf2f78ca21f870ab7c0cc2b" +dependencies = [ + "hyper 0.14.30", + "once_cell", + "tokio", + "tracing", + "vise", +] + [[package]] name = "vise-macros" -version = "0.1.0" -source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a511871dc5de990a3b2a0e715facfbc5da848c0c0395597a1415029fb7c250a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", ] [[package]] -name = "vlog" +name = "vm2" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/vm2.git?rev=2276b7b5af520fca0477bdafe43781b51896d235#2276b7b5af520fca0477bdafe43781b51896d235" dependencies = [ - "chrono", - "opentelemetry", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "sentry", - "serde", - "serde_json", - "tracing", - "tracing-opentelemetry", - "tracing-subscriber", + "enum_dispatch", + "primitive-types", + "zk_evm_abstractions 0.150.4", + "zkevm_opcode_defs 0.150.4", ] [[package]] name = "walkdir" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -5395,20 +6416,13 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -5417,36 +6431,37 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.36" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -5454,9 +6469,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5464,60 +6479,61 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] -name = "web-sys" -version = "0.3.63" +name = "wasm-streams" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ + "futures-util", "js-sys", "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", ] [[package]] -name = "webpki" -version = "0.22.0" +name = "web-sys" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "webpki-roots" -version = "0.22.6" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ - "webpki", + "js-sys", + "wasm-bindgen", ] [[package]] name = "webpki-roots" -version = "0.23.1" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.1", -] +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" @@ -5528,6 +6544,18 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -5546,11 +6574,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -5569,12 +6597,33 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.45.0" +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -5583,7 +6632,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -5596,33 +6645,27 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.6", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -5643,15 +6686,9 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" @@ -5661,15 +6698,9 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" @@ -5679,15 +6710,9 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" @@ -5703,15 +6728,9 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" @@ -5721,15 +6740,9 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" @@ -5739,15 +6752,9 @@ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" @@ -5757,15 +6764,9 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" @@ -5775,29 +6776,30 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.4.6" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if 1.0.0", + "windows-sys 0.48.0", ] [[package]] @@ -5834,16 +6836,106 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "zeroize" -version = "1.6.0" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "zip" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils 0.8.20", + "flate2", + "hmac", + "pbkdf2 0.11.0", + "sha1", + "time", + "zstd", +] [[package]] name = "zk_evm" -version = "1.3.3" -source = "git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2#fbee20f5bac7d6ca3e22ae69b2077c510a07de4e" +version = "0.131.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b83ee7887fb29fda57c6b26a0f64c9b211459d718f8a26310f962e69f0b764" +dependencies = [ + "blake2_ce", + "k256 0.11.6", + "lazy_static", + "num", + "serde", + "serde_json", + "sha2_ce", + "sha3_ce", + "static_assertions", + "zkevm_opcode_defs 0.131.0", +] + +[[package]] +name = "zk_evm" +version = "0.133.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9af08e9284686a1b0c89ec4931eb915ac0729367f1247abd06164874fe738106" +dependencies = [ + "anyhow", + "lazy_static", + "num", + "serde", + "serde_json", + "static_assertions", + "zk_evm_abstractions 0.140.0", + "zkevm_opcode_defs 0.132.0", +] + +[[package]] +name = "zk_evm" +version = "0.140.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349bb8320d12578537658792df708f43c52e6330f0df071f812cb93b04ade962" dependencies = [ "anyhow", "lazy_static", @@ -5851,34 +6943,201 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions", - "zkevm_opcode_defs", + "zk_evm_abstractions 0.140.0", + "zkevm_opcode_defs 0.132.0", +] + +[[package]] +name = "zk_evm" +version = "0.141.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8886ba5989b952b7b76096469eeb6fdfaf3369770e9e22a6f67dc4b7d65f9243" +dependencies = [ + "anyhow", + "lazy_static", + "num", + "serde", + "serde_json", + "static_assertions", + "zk_evm_abstractions 0.141.0", + "zkevm_opcode_defs 0.141.0", +] + +[[package]] +name = "zk_evm" +version = "0.150.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2dbb0ed38d61fbd04bd7575755924d1303e129c04c909abba7f5bfcc6260bcf" +dependencies = [ + "anyhow", + "lazy_static", + "num", + "serde", + "serde_json", + "static_assertions", + "zk_evm_abstractions 0.150.4", ] [[package]] name = "zk_evm_abstractions" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git#32dd320953841aa78579d9da08abbc70bcaed175" +version = "0.140.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be696258861eba4e6625a5665084b2266720bb67f4ba69819469700ac5c6a401" dependencies = [ "anyhow", "num_enum 0.6.1", "serde", "static_assertions", - "zkevm_opcode_defs", + "zkevm_opcode_defs 0.132.0", +] + +[[package]] +name = "zk_evm_abstractions" +version = "0.141.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637a3cb6cb475bb238bee3e450763205d36fe6c92dc1b23300655927915baf03" +dependencies = [ + "anyhow", + "num_enum 0.6.1", + "serde", + "static_assertions", + "zkevm_opcode_defs 0.141.0", +] + +[[package]] +name = "zk_evm_abstractions" +version = "0.150.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31460aacfe65b39ac484a2a2e0bbb02baf141f65264bf48e1e4f59ab375fe933" +dependencies = [ + "anyhow", + "num_enum 0.6.1", + "serde", + "static_assertions", + "zkevm_opcode_defs 0.150.4", +] + +[[package]] +name = "zkevm_circuits" +version = "0.140.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8beed4cc1ab1f9d99a694506d18705e10059534b30742832be49637c4775e1f8" +dependencies = [ + "arrayvec 0.7.6", + "bincode", + "boojum", + "cs_derive", + "derivative", + "hex", + "itertools 0.10.5", + "rand 0.4.6", + "rand 0.8.5", + "seq-macro", + "serde", + "serde_json", + "smallvec", + "zkevm_opcode_defs 0.132.0", +] + +[[package]] +name = "zkevm_circuits" +version = "0.141.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20f1a64d256cc5f5c58d19cf976cb45973df54e4e3010ca4a3e6fafe9f06075e" +dependencies = [ + "arrayvec 0.7.6", + "bincode", + "boojum", + "cs_derive", + "derivative", + "hex", + "itertools 0.10.5", + "rand 0.4.6", + "rand 0.8.5", + "seq-macro", + "serde", + "serde_json", + "smallvec", + "zkevm_opcode_defs 0.141.0", +] + +[[package]] +name = "zkevm_circuits" +version = "0.150.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abdfaa95dfe0878fda219dd17a6cc8c28711e2067785910c0e06d3ffdca78629" +dependencies = [ + "arrayvec 0.7.6", + "boojum", + "cs_derive", + "derivative", + "hex", + "itertools 0.10.5", + "rand 0.4.6", + "rand 0.8.5", + "seq-macro", + "serde", + "smallvec", + "zkevm_opcode_defs 0.150.4", ] [[package]] name = "zkevm_opcode_defs" -version = "1.3.2" -source = "git+https://github.com/matter-labs/era-zkevm_opcode_defs.git?branch=v1.3.2#dffacadeccdfdbff4bc124d44c595c4a6eae5013" +version = "0.131.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e0154bd4ae8202c96c52b29dd44f944bfd08c1c233fef843744463964de957" +dependencies = [ + "bitflags 1.3.2", + "ethereum-types", + "lazy_static", + "sha2", +] + +[[package]] +name = "zkevm_opcode_defs" +version = "0.132.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0769f7b27d8fb06e715da3290c575cac5d04d10a557faef180e847afce50ac4" dependencies = [ "bitflags 2.6.0", - "blake2 0.10.6 (git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e)", + "blake2", "ethereum-types", "k256 0.11.6", "lazy_static", - "sha2 0.10.6", - "sha3 0.10.6", + "sha2_ce", + "sha3_ce", +] + +[[package]] +name = "zkevm_opcode_defs" +version = "0.141.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6be7bd5f0e0b61211f544147289640b4712715589d7f2fe5229d92a7a3ac64c0" +dependencies = [ + "bitflags 2.6.0", + "blake2", + "ethereum-types", + "k256 0.13.3", + "lazy_static", + "sha2", + "sha3", +] + +[[package]] +name = "zkevm_opcode_defs" +version = "0.150.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7c5c7b4481a646f8696b08cee64a8dec097509a6378d18242f81022f327f1e" +dependencies = [ + "bitflags 2.6.0", + "blake2", + "ethereum-types", + "k256 0.13.3", + "lazy_static", + "p256", + "serde", + "sha2", + "sha3", ] [[package]] @@ -5886,7 +7145,7 @@ name = "zksync-ethers-rs" version = "0.1.1" dependencies = [ "async-trait", - "clap 4.3.0", + "clap", "colored", "env_logger", "ethers", @@ -5896,10 +7155,11 @@ dependencies = [ "log", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "thiserror", "tokio", "zksync_contracts", + "zksync_prover_interface", "zksync_system_constants", "zksync_types", "zksync_web3_decl", @@ -5908,34 +7168,35 @@ dependencies = [ [[package]] name = "zksync_basic_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ "anyhow", "chrono", "ethabi", "hex", - "num_enum 0.7.2", + "num_enum 0.7.3", "serde", "serde_json", "serde_with", "strum", "thiserror", - "tiny-keccak", + "tiny-keccak 2.0.2", "url", ] [[package]] name = "zksync_concurrency" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +version = "0.1.0-rc.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0e31a9fc9a390b440cd12bbe040330dc64f64697a8a8ecbc3beb98cd0747909" dependencies = [ "anyhow", "once_cell", "pin-project", - "rand", - "sha3 0.10.8", + "rand 0.8.5", + "sha3", "thiserror", - "time 0.3.36", + "time", "tokio", "tracing", "tracing-subscriber", @@ -5945,23 +7206,27 @@ dependencies = [ [[package]] name = "zksync_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ "anyhow", - "rand", + "rand 0.8.5", "secrecy", "serde", + "url", "zksync_basic_types", + "zksync_concurrency", "zksync_consensus_utils", "zksync_crypto_primitives", ] [[package]] name = "zksync_consensus_utils" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +version = "0.1.0-rc.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ff679f8b5f671d887a750b8107f3b5c01fd6085f68eef37ab01de8d2bd0736b" dependencies = [ - "rand", + "anyhow", + "rand 0.8.5", "thiserror", "zksync_concurrency", ] @@ -5969,7 +7234,7 @@ dependencies = [ [[package]] name = "zksync_contracts" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ "envy", "ethabi", @@ -5981,49 +7246,93 @@ dependencies = [ ] [[package]] -name = "zksync_crypto" +name = "zksync_crypto_primitives" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ - "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow", + "blake2", "hex", - "once_cell", + "rand 0.8.5", + "secp256k1", "serde", - "sha2 0.10.8", + "serde_json", + "sha2", "thiserror", "zksync_basic_types", + "zksync_utils", ] [[package]] -name = "zksync_crypto_primitives" +name = "zksync_mini_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +dependencies = [ + "once_cell", + "zksync_basic_types", + "zksync_crypto_primitives", +] + +[[package]] +name = "zksync_multivm" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ "anyhow", + "circuit_sequencer_api 0.133.0", + "circuit_sequencer_api 0.140.1", + "circuit_sequencer_api 0.141.1", + "circuit_sequencer_api 0.142.1", + "circuit_sequencer_api 0.150.4", "hex", - "rand", - "secp256k1", - "serde", - "serde_json", + "itertools 0.10.5", + "once_cell", + "pretty_assertions", "thiserror", - "zksync_basic_types", + "tracing", + "vise", + "vm2", + "zk_evm 0.131.0-rc.2", + "zk_evm 0.133.0", + "zk_evm 0.140.0", + "zk_evm 0.141.0", + "zk_evm 0.150.4", + "zksync_contracts", + "zksync_system_constants", + "zksync_types", "zksync_utils", + "zksync_vm_interface", ] [[package]] -name = "zksync_mini_merkle_tree" +name = "zksync_object_store" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ - "once_cell", - "zksync_basic_types", - "zksync_crypto", + "anyhow", + "async-trait", + "bincode", + "flate2", + "google-cloud-auth", + "google-cloud-storage", + "http 1.1.0", + "prost 0.12.6", + "rand 0.8.5", + "reqwest 0.12.7", + "serde_json", + "tokio", + "tracing", + "vise", + "zksync_config", + "zksync_protobuf", + "zksync_types", ] [[package]] name = "zksync_protobuf" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +version = "0.1.0-rc.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f6ba3bf0aac20de18b4ae18a22d8c81b83f8f72e8fdec1c879525ecdacd2f5" dependencies = [ "anyhow", "bit-vec", @@ -6031,7 +7340,7 @@ dependencies = [ "prost 0.12.6", "prost-reflect", "quick-protobuf", - "rand", + "rand 0.8.5", "serde", "serde_json", "serde_yaml", @@ -6042,24 +7351,40 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +version = "0.1.0-rc.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7798c248b9a64505f0586bd5fadad6b26c999be4a8dec6b1a86b10b3888169c5" dependencies = [ "anyhow", - "heck 0.5.0", + "heck", "prettyplease", "proc-macro2", "prost-build", "prost-reflect", "protox", "quote", - "syn 2.0.70", + "syn 2.0.76", +] + +[[package]] +name = "zksync_prover_interface" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +dependencies = [ + "chrono", + "circuit_sequencer_api 0.150.4", + "serde", + "serde_with", + "strum", + "zksync_multivm", + "zksync_object_store", + "zksync_types", ] [[package]] name = "zksync_system_constants" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ "once_cell", "zksync_basic_types", @@ -6069,16 +7394,17 @@ dependencies = [ [[package]] name = "zksync_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ "anyhow", - "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bigdecimal", + "blake2", "chrono", "derive_more 1.0.0-beta.6", "hex", - "itertools", + "itertools 0.10.5", "num", - "num_enum 0.7.2", + "num_enum 0.7.3", "once_cell", "prost 0.12.6", "rlp", @@ -6087,6 +7413,7 @@ dependencies = [ "serde_json", "strum", "thiserror", + "tracing", "zksync_basic_types", "zksync_config", "zksync_contracts", @@ -6101,30 +7428,70 @@ dependencies = [ [[package]] name = "zksync_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ "anyhow", "bigdecimal", "futures", "hex", - "itertools", + "itertools 0.10.5", "num", "once_cell", - "reqwest", + "reqwest 0.12.7", "serde", "serde_json", "thiserror", "tokio", "tracing", - "vlog", - "zk_evm", + "zk_evm 0.133.0", "zksync_basic_types", + "zksync_vlog", +] + +[[package]] +name = "zksync_vlog" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +dependencies = [ + "anyhow", + "chrono", + "opentelemetry", + "opentelemetry-appender-tracing", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "opentelemetry_sdk", + "sentry", + "serde", + "serde_json", + "thiserror", + "time", + "tokio", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", + "url", + "vise", + "vise-exporter", +] + +[[package]] +name = "zksync_vm_interface" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +dependencies = [ + "hex", + "serde", + "thiserror", + "tracing", + "zksync_contracts", + "zksync_system_constants", + "zksync_types", ] [[package]] name = "zksync_web3_decl" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?tag=core-v24.7.0#44d293b477d8536687af129ece8a47fc15fd63f1" +source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" dependencies = [ "anyhow", "async-trait", @@ -6132,6 +7499,7 @@ dependencies = [ "jsonrpsee", "pin-project-lite", "rlp", + "rustls 0.23.12", "serde", "serde_json", "thiserror", @@ -6141,3 +7509,32 @@ dependencies = [ "zksync_config", "zksync_types", ] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index c1f549a..67506dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,10 +16,11 @@ clap = { version = "4.2.7", features = ["derive"] } lazy_static = "1.4.0" # ZKsync -zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_types" } -zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_web3_decl" } -zksync_system_constants = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_system_constants" } -zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", tag = "core-v24.7.0", package = "zksync_contracts" } +zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", package = "zksync_types" } +zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", package = "zksync_web3_decl" } +zksync_system_constants = { git = "https://github.com/matter-labs/zksync-era.git", package = "zksync_system_constants" } +zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", package = "zksync_contracts" } +zksync_prover_interface = { git = "https://github.com/matter-labs/zksync-era.git", package = "zksync_prover_interface" } # Async tokio = { version = "1", features = ["macros", "process"] } diff --git a/src/types.rs b/src/types.rs index babc33b..59d9f43 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,4 +1,5 @@ pub mod zksync { + pub use zksync_prover_interface::*; pub use zksync_system_constants::*; pub use zksync_types::*; pub use zksync_web3_decl::types as web3_decl; diff --git a/src/zk_middleware.rs b/src/zk_middleware.rs index 04a12d2..f65b8b7 100644 --- a/src/zk_middleware.rs +++ b/src/zk_middleware.rs @@ -4,7 +4,16 @@ use serde::Serialize; use serde_json::json; use std::{collections::HashMap, fmt::Debug, time::Duration}; use tokio::time::Instant; -use zksync_types::{api::ProtocolVersion, fee_model::FeeParams}; +use zksync_types::{ + api::{ + BlockDetails, BridgeAddresses, DebugCall, L1BatchDetails, L2ToL1LogProof, ProtocolVersion, + ResultDebugCall, TracerConfig, Transaction, TransactionDetailedResult, TransactionDetails, + }, + fee::Fee, + fee_model::FeeParams, + EIP_712_TX_TYPE, +}; +use zksync_web3_decl::types::Token; use ethers::{ abi::HumanReadableParser, @@ -23,19 +32,7 @@ use ethers::{ use crate::{ eip712::{Eip712Meta, Eip712Transaction, Eip712TransactionRequest}, - types::{ - zksync::{ - api::{ - BlockDetails, BridgeAddresses, DebugCall, L1BatchDetails, L2ToL1LogProof, - ResultDebugCall, TracerConfig, Transaction, TransactionDetailedResult, - TransactionDetails, - }, - fee::Fee, - web3_decl::Token, - EIP_712_TX_TYPE, - }, - L1TxOverrides, - }, + types::L1TxOverrides, utils, }; From fd5567c684cc78cf828743af9b441bee5ee16e4a Mon Sep 17 00:00:00 2001 From: Manuel Bilbao Date: Fri, 30 Aug 2024 17:29:36 -0300 Subject: [PATCH 63/75] Add StateTransitionManager --- abi/IStateTransitionManagerjson | 1082 +++++++++++++++++++++ src/contracts/state_transition_manager.rs | 3 + 2 files changed, 1085 insertions(+) create mode 100644 abi/IStateTransitionManagerjson create mode 100644 src/contracts/state_transition_manager.rs diff --git a/abi/IStateTransitionManagerjson b/abi/IStateTransitionManagerjson new file mode 100644 index 0000000..2f0a8e2 --- /dev/null +++ b/abi/IStateTransitionManagerjson @@ -0,0 +1,1082 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "NewAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_hyperchainContract", + "type": "address" + } + ], + "name": "NewHyperchain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "oldInitialCutHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newInitialCutHash", + "type": "bytes32" + } + ], + "name": "NewInitialCutHash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPendingAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPendingAdmin", + "type": "address" + } + ], + "name": "NewPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "oldProtocolVersion", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "newProtocolVersion", + "type": "uint256" + } + ], + "name": "NewProtocolVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "protocolVersion", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "upgradeCutHash", + "type": "bytes32" + } + ], + "name": "NewUpgradeCutHash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldValidatorTimelock", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newValidatorTimelock", + "type": "address" + } + ], + "name": "NewValidatorTimelock", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_hyperchain", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "txType", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "from", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "to", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPerPubdataByteLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeePerGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPriorityFeePerGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "paymaster", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "reserved", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "factoryDeps", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "paymasterInput", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "reservedDynamic", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct L2CanonicalTransaction", + "name": "_l2Transaction", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_protocolVersion", + "type": "uint256" + } + ], + "name": "SetChainIdUpgrade", + "type": "event" + }, + { + "inputs": [], + "name": "BRIDGE_HUB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "enum PubdataPricingMode", + "name": "pubdataPricingMode", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "batchOverheadL1Gas", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxPubdataPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxL2GasPerBatch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "priorityTxMaxPubdata", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "minimalL2GasPrice", + "type": "uint64" + } + ], + "internalType": "struct FeeParams", + "name": "_newFeeParams", + "type": "tuple" + } + ], + "name": "changeFeeParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_baseToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharedBridge", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_diamondCut", + "type": "bytes" + } + ], + "name": "createNewChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "internalType": "struct Diamond.DiamondCutData", + "name": "_diamondCut", + "type": "tuple" + } + ], + "name": "executeUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "freezeChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "genesisUpgrade", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllHyperchainChainIDs", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllHyperchains", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "getChainAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "getHyperchain", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSemverProtocolVersion", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialCutHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "validatorTimelock", + "type": "address" + }, + { + "internalType": "address", + "name": "genesisUpgrade", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "genesisBatchHash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "genesisIndexRepeatedStorageChanges", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "genesisBatchCommitment", + "type": "bytes32" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "internalType": "struct Diamond.DiamondCutData", + "name": "diamondCut", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "protocolVersion", + "type": "uint256" + } + ], + "internalType": "struct StateTransitionManagerInitializeData", + "name": "_initializeData", + "type": "tuple" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "protocolVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_protocolVersion", + "type": "uint256" + } + ], + "name": "protocolVersionDeadline", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_protocolVersion", + "type": "uint256" + } + ], + "name": "protocolVersionIsActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_hyperchain", + "type": "address" + } + ], + "name": "registerAlreadyDeployedHyperchain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "internalType": "struct Diamond.DiamondCutData", + "name": "_diamondCut", + "type": "tuple" + } + ], + "name": "setInitialCutHash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "internalType": "struct Diamond.DiamondCutData", + "name": "_cutData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_oldProtocolVersion", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_oldprotocolVersionDeadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_newProtocolVersion", + "type": "uint256" + } + ], + "name": "setNewVersionUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPendingAdmin", + "type": "address" + } + ], + "name": "setPendingAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_zkPorterIsAvailable", + "type": "bool" + } + ], + "name": "setPorterAvailability", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxGasLimit", + "type": "uint256" + } + ], + "name": "setPriorityTxMaxGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "_nominator", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "_denominator", + "type": "uint128" + } + ], + "name": "setTokenMultiplier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "internalType": "struct Diamond.DiamondCutData", + "name": "_cutData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_oldProtocolVersion", + "type": "uint256" + } + ], + "name": "setUpgradeDiamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "bool", + "name": "_active", + "type": "bool" + } + ], + "name": "setValidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validatorTimelock", + "type": "address" + } + ], + "name": "setValidatorTimelock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "storedBatchZero", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "unfreezeChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_oldProtocolVersion", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + }, + { + "internalType": "enum Diamond.Action", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isFreezable", + "type": "bool" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.FacetCut[]", + "name": "facetCuts", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "initAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initCalldata", + "type": "bytes" + } + ], + "internalType": "struct Diamond.DiamondCutData", + "name": "_diamondCut", + "type": "tuple" + } + ], + "name": "upgradeChainFromVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_protocolVersion", + "type": "uint256" + } + ], + "name": "upgradeCutHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/contracts/state_transition_manager.rs b/src/contracts/state_transition_manager.rs new file mode 100644 index 0000000..712177f --- /dev/null +++ b/src/contracts/state_transition_manager.rs @@ -0,0 +1,3 @@ +use ethers_contract::abigen; + +abigen!(StateTransitionManager, "abi/IStateTransitionManager.json"); From a351edcf9316efc67af33565aa5a19fc829f893f Mon Sep 17 00:00:00 2001 From: Manuel Bilbao Date: Fri, 30 Aug 2024 17:43:49 -0300 Subject: [PATCH 64/75] Add state_transition_manager to mod.rs --- ...{IStateTransitionManagerjson => IStateTransitionManager.json} | 0 src/contracts/mod.rs | 1 + 2 files changed, 1 insertion(+) rename abi/{IStateTransitionManagerjson => IStateTransitionManager.json} (100%) diff --git a/abi/IStateTransitionManagerjson b/abi/IStateTransitionManager.json similarity index 100% rename from abi/IStateTransitionManagerjson rename to abi/IStateTransitionManager.json diff --git a/src/contracts/mod.rs b/src/contracts/mod.rs index 77b3829..4c6946f 100644 --- a/src/contracts/mod.rs +++ b/src/contracts/mod.rs @@ -3,6 +3,7 @@ pub mod erc20; pub mod governance; pub mod l1_shared_bridge; pub mod main_contract; +pub mod state_transition_manager; pub mod l2_eth; pub mod l2_shared_bridge; From 904dfa6021b0bb70c9e52d06b7a583d1370b22bf Mon Sep 17 00:00:00 2001 From: Manuel Bilbao Date: Wed, 4 Sep 2024 12:04:05 -0300 Subject: [PATCH 65/75] Use STM instead of ISTM --- ...nager.json => StateTransitionManager.json} | 205 +++++++++++++++++- src/contracts/state_transition_manager.rs | 2 +- 2 files changed, 201 insertions(+), 6 deletions(-) rename abi/{IStateTransitionManager.json => StateTransitionManager.json} (86%) diff --git a/abi/IStateTransitionManager.json b/abi/StateTransitionManager.json similarity index 86% rename from abi/IStateTransitionManager.json rename to abi/StateTransitionManager.json index 2f0a8e2..58c3167 100644 --- a/abi/IStateTransitionManager.json +++ b/abi/StateTransitionManager.json @@ -1,4 +1,33 @@ [ + { + "inputs": [ + { + "internalType": "address", + "name": "_bridgehub", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxNumberOfHyperchains", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -132,6 +161,44 @@ "name": "NewValidatorTimelock", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -252,6 +319,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "MAX_NUMBER_OF_HYPERCHAINS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "acceptAdmin", @@ -259,6 +339,26 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -444,7 +544,7 @@ "outputs": [ { "internalType": "address[]", - "name": "", + "name": "chainAddresses", "type": "address[]" } ], @@ -482,7 +582,7 @@ "outputs": [ { "internalType": "address", - "name": "", + "name": "chainAddress", "type": "address" } ], @@ -619,6 +719,32 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "protocolVersion", @@ -688,6 +814,31 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_newLastBatch", + "type": "uint256" + } + ], + "name": "revertBatches", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -793,7 +944,7 @@ }, { "internalType": "uint256", - "name": "_oldprotocolVersionDeadline", + "name": "_oldProtocolVersionDeadline", "type": "uint256" }, { @@ -856,6 +1007,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_protocolVersion", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } + ], + "name": "setProtocolVersionDeadline", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -985,6 +1154,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1064,7 +1246,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_protocolVersion", + "name": "protocolVersion", "type": "uint256" } ], @@ -1072,11 +1254,24 @@ "outputs": [ { "internalType": "bytes32", - "name": "", + "name": "cutHash", "type": "bytes32" } ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [], + "name": "validatorTimelock", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" } ] diff --git a/src/contracts/state_transition_manager.rs b/src/contracts/state_transition_manager.rs index 712177f..22e3425 100644 --- a/src/contracts/state_transition_manager.rs +++ b/src/contracts/state_transition_manager.rs @@ -1,3 +1,3 @@ use ethers_contract::abigen; -abigen!(StateTransitionManager, "abi/IStateTransitionManager.json"); +abigen!(StateTransitionManager, "abi/StateTransitionManager.json"); From 952fbff86304bad774f72522d0e157f6974b4269 Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Tue, 10 Sep 2024 18:02:06 -0300 Subject: [PATCH 66/75] fix(zksync_types): redeclare api --- src/types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/types.rs b/src/types.rs index 59d9f43..cb3f34f 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,5 +1,6 @@ pub mod zksync { - pub use zksync_prover_interface::*; + pub use zksync_prover_interface::api as prover_interface_api; + pub use zksync_prover_interface::{inputs, outputs}; pub use zksync_system_constants::*; pub use zksync_types::*; pub use zksync_web3_decl::types as web3_decl; From 5d5b1481bd18fd34a80d23dd1a285ef7362af6d5 Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Wed, 11 Sep 2024 17:35:56 -0300 Subject: [PATCH 67/75] feat: deploy with eip-712 --- Cargo.lock | 563 ++++++++++++++++-------------- Cargo.toml | 2 +- abi/ContractDeployer.json | 411 ++++++++++++++++++++++ rust-toolchain.toml | 2 + src/eip712/meta.rs | 14 +- src/eip712/paymaster_params.rs | 20 +- src/eip712/transaction.rs | 9 +- src/eip712/transaction_request.rs | 63 ++-- src/lib.rs | 1 - src/zk_middleware.rs | 5 +- 10 files changed, 764 insertions(+), 326 deletions(-) create mode 100644 abi/ContractDeployer.json create mode 100644 rust-toolchain.toml diff --git a/Cargo.lock b/Cargo.lock index 9528c11..2601b2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,19 +14,13 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -119,9 +113,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" [[package]] name = "arrayref" @@ -169,18 +163,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -208,7 +202,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -219,9 +213,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-lc-rs" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77" +checksum = "2f95446d919226d587817a7d21379e6eb099b97b45110a7f272a444ca5c54070" dependencies = [ "aws-lc-sys", "mirai-annotations", @@ -231,9 +225,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.20.1" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0e249228c6ad2d240c2dc94b714d711629d52bad946075d8e9b2f5391f0703" +checksum = "234314bd569802ec87011d653d6815c6d7b9ffb969e9fee5b8b20ef860e8dce9" dependencies = [ "bindgen", "cc", @@ -293,17 +287,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -365,31 +359,7 @@ checksum = "3ea340d5c1394ee4daf4415dd80e06f74e0ad9b08e21f73f6bb1fa3a9dfae80d" dependencies = [ "arrayvec 0.7.6", "bit-vec", - "blake2s_const 0.7.0", - "blake2s_simd", - "byteorder", - "cfg-if 1.0.0", - "crossbeam 0.7.3", - "futures", - "hex", - "lazy_static", - "num_cpus", - "pairing_ce", - "rand 0.4.6", - "serde", - "smallvec", - "tiny-keccak 1.5.0", -] - -[[package]] -name = "bellman_ce" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aab6627603565b664e6c643a1dc7ea8bbff25b776f5fecd80ac88308fc7007b" -dependencies = [ - "arrayvec 0.7.6", - "bit-vec", - "blake2s_const 0.8.0", + "blake2s_const", "blake2s_simd", "byteorder", "cfg-if 1.0.0", @@ -446,7 +416,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.76", + "syn 2.0.77", "which", ] @@ -521,17 +491,6 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "blake2s_const" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db04f0f5f88d8c95977159949b23d2ed24d33309901cf7f7e48ed40f36de667" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq", -] - [[package]] name = "blake2s_simd" version = "0.5.11" @@ -583,6 +542,37 @@ dependencies = [ "unroll", ] +[[package]] +name = "boojum" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ec2f007ff8f90cc459f03e9f30ca1065440170f013c868823646e2e48d0234" +dependencies = [ + "arrayvec 0.7.6", + "bincode", + "blake2", + "const_format", + "convert_case", + "crossbeam 0.8.4", + "crypto-bigint 0.5.5", + "derivative", + "ethereum-types", + "firestorm", + "itertools 0.10.5", + "lazy_static", + "num-modular", + "num_cpus", + "rand 0.8.5", + "rayon", + "serde", + "sha2", + "sha3_ce", + "smallvec", + "unroll", + "zksync_cs_derive", + "zksync_pairing", +] + [[package]] name = "bs58" version = "0.5.1" @@ -675,9 +665,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ "jobserver", "libc", @@ -738,38 +728,38 @@ dependencies = [ [[package]] name = "circuit_encodings" -version = "0.140.1" +version = "0.140.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8438d7af992b730143b679e2c6938cb9e0193897ecaf668c59189af8ac296b7" +checksum = "cf6b7cc842eadb4c250cdc6a8bc1dd97624d9f08bbe54db3e11fb23c3a72be07" dependencies = [ "derivative", "serde", "zk_evm 0.140.0", - "zkevm_circuits 0.140.2", + "zkevm_circuits 0.140.3", ] [[package]] name = "circuit_encodings" -version = "0.141.1" +version = "0.141.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a2fcc80e97682104f355dd819cb4972583828a6c0f65ec26889a78a84b0c56" +checksum = "7898ffbf3cd413576b4b674fe1545a35488c67eb16bd5a4148425e42c2a2b65b" dependencies = [ "derivative", "serde", "zk_evm 0.141.0", - "zkevm_circuits 0.141.1", + "zkevm_circuits 0.141.2", ] [[package]] name = "circuit_encodings" -version = "0.142.1" +version = "0.142.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94be7afb5ace6024d6e3c105d521b4b9b563bac14a92c2f59c4683e9169a25d8" +checksum = "8364ecafcc4b2c896023f8d3af952c52a500aa55f14fd268bb5d9ab07f837369" dependencies = [ "derivative", "serde", "zk_evm 0.141.0", - "zkevm_circuits 0.141.1", + "zkevm_circuits 0.141.2", ] [[package]] @@ -786,57 +776,57 @@ dependencies = [ [[package]] name = "circuit_sequencer_api" -version = "0.133.0" +version = "0.133.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a87dc7bee6630d4954ac7982eb77e2007476662250cf18e5c460bbc5ee435f1" +checksum = "eb959b1f8c6bbd8be711994d182e85452a26a5d2213a709290b71c8262af1331" dependencies = [ - "bellman_ce 0.7.0", "derivative", "rayon", "serde", "zk_evm 0.133.0", + "zksync_bellman", ] [[package]] name = "circuit_sequencer_api" -version = "0.140.1" +version = "0.140.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9b15463f9da44561867e6416a5b9c343164636811f68503868d37675be2d59" +checksum = "fa5f22311ce609d852d7d9f4943535ea4610aeb785129ae6ff83d5201c4fb387" dependencies = [ - "bellman_ce 0.8.0", - "circuit_encodings 0.140.1", + "circuit_encodings 0.140.3", "derivative", "rayon", "serde", "zk_evm 0.140.0", + "zksync_bellman", ] [[package]] name = "circuit_sequencer_api" -version = "0.141.1" +version = "0.141.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a257b31a8ea1c1723cab4fb5661c6b4c0ebe022d4b73bea9eb7c9150bd3bc1" +checksum = "4c47c71d6ba83a8beb0af13af70beffd627f5497caf3d44c6f96363e788b07ea" dependencies = [ - "bellman_ce 0.8.0", - "circuit_encodings 0.141.1", + "circuit_encodings 0.141.2", "derivative", "rayon", "serde", "zk_evm 0.141.0", + "zksync_bellman", ] [[package]] name = "circuit_sequencer_api" -version = "0.142.1" +version = "0.142.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "273351e61b0f9a36b09550e244989c38f9877382b42d0329797c72004dcabef7" +checksum = "e264723359e6a1aad98110bdccf1ae3ad596e93e7d31da9e40f6adc07e4add54" dependencies = [ - "bellman_ce 0.8.0", - "circuit_encodings 0.142.1", + "circuit_encodings 0.142.2", "derivative", "rayon", "serde", "zk_evm 0.141.0", + "zksync_bellman", ] [[package]] @@ -845,7 +835,7 @@ version = "0.150.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42d1a86b9c2207f3bb2dff5f00d1af1cb95004b6d07e9bacb6519fe08f12c04b" dependencies = [ - "bellman_ce 0.7.0", + "bellman_ce", "circuit_encodings 0.150.4", "derivative", "rayon", @@ -865,9 +855,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.16" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -875,9 +865,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -894,7 +884,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1017,18 +1007,18 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const_format" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" dependencies = [ "proc-macro2", "quote", @@ -1068,9 +1058,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1271,7 +1261,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1384,7 +1374,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1404,7 +1394,7 @@ checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "unicode-xid", ] @@ -1606,7 +1596,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1647,6 +1637,14 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "eravm-stable-interface" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vm2.git?rev=4ef15d46410ffc11744771a3a6c7c09dd9470c90#4ef15d46410ffc11744771a3a6c7c09dd9470c90" +dependencies = [ + "primitive-types", +] + [[package]] name = "errno" version = "0.3.9" @@ -1793,7 +1791,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.76", + "syn 2.0.77", "toml", "walkdir", ] @@ -1811,7 +1809,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1837,7 +1835,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.76", + "syn 2.0.77", "tempfile", "thiserror", "tiny-keccak 2.0.2", @@ -2083,7 +2081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -2211,7 +2209,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2289,9 +2287,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "glob" @@ -2454,7 +2452,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.4.0", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2473,7 +2471,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.4.0", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2683,16 +2681,16 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.4.1", "hyper-util", "log", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -2743,9 +2741,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", @@ -2856,9 +2854,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -2884,9 +2882,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is_terminal_polyfill" @@ -3003,7 +3001,7 @@ dependencies = [ "http 1.1.0", "jsonrpsee-core", "pin-project", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "rustls-platform-verifier", "soketto", @@ -3052,11 +3050,11 @@ dependencies = [ "base64 0.22.1", "http-body 1.0.1", "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.27.3", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-platform-verifier", "serde", "serde_json", @@ -3077,7 +3075,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3297,7 +3295,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3381,7 +3379,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3406,15 +3404,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -3621,7 +3610,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3633,14 +3622,14 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "object" -version = "0.36.3" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -3699,7 +3688,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3772,7 +3761,7 @@ dependencies = [ "opentelemetry-http", "opentelemetry-proto", "opentelemetry_sdk", - "prost 0.13.1", + "prost 0.13.2", "reqwest 0.12.7", "thiserror", "tokio", @@ -3787,7 +3776,7 @@ checksum = "30ee9f20bff9c984511a02f082dc8ede839e4a9bf15cc2487c8d6fea5ad850d9" dependencies = [ "opentelemetry", "opentelemetry_sdk", - "prost 0.13.1", + "prost 0.13.2", "tonic", ] @@ -4010,7 +3999,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.4.0", + "indexmap 2.5.0", ] [[package]] @@ -4053,7 +4042,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4091,7 +4080,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4170,7 +4159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4268,7 +4257,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4299,12 +4288,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" dependencies = [ "bytes", - "prost-derive 0.13.1", + "prost-derive 0.13.2", ] [[package]] @@ -4324,7 +4313,7 @@ dependencies = [ "prost 0.12.6", "prost-types", "regex", - "syn 2.0.76", + "syn 2.0.77", "tempfile", ] @@ -4338,20 +4327,20 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "prost-derive" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" dependencies = [ "anyhow", "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4651,7 +4640,7 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.27.3", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -4807,9 +4796,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -4832,16 +4821,16 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "aws-lc-rs", "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.7", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -4895,13 +4884,13 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.102.7", + "rustls-webpki 0.102.8", "security-framework", "security-framework-sys", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", "winapi", ] @@ -4923,9 +4912,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.7" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", "ring 0.17.8", @@ -4989,11 +4978,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5240,9 +5229,9 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -5259,20 +5248,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -5330,7 +5319,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "itoa", "ryu", "serde", @@ -5597,7 +5586,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5639,9 +5628,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -5752,7 +5741,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5831,9 +5820,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -5855,7 +5844,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5884,16 +5873,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -5917,9 +5906,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -5956,7 +5945,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "toml_datetime", "winnow 0.5.40", ] @@ -5967,7 +5956,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", @@ -5994,7 +5983,7 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "prost 0.13.1", + "prost 0.13.2", "socket2", "tokio", "tokio-stream", @@ -6056,7 +6045,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -6216,9 +6205,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -6390,15 +6379,16 @@ checksum = "6a511871dc5de990a3b2a0e715facfbc5da848c0c0395597a1415029fb7c250a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "vm2" version = "0.1.0" -source = "git+https://github.com/matter-labs/vm2.git?rev=2276b7b5af520fca0477bdafe43781b51896d235#2276b7b5af520fca0477bdafe43781b51896d235" +source = "git+https://github.com/matter-labs/vm2.git?rev=4ef15d46410ffc11744771a3a6c7c09dd9470c90#4ef15d46410ffc11744771a3a6c7c09dd9470c90" dependencies = [ "enum_dispatch", + "eravm-stable-interface", "primitive-types", "zk_evm_abstractions 0.150.4", "zkevm_opcode_defs 0.150.4", @@ -6451,7 +6441,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -6485,7 +6475,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6537,9 +6527,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -6854,7 +6844,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -6862,20 +6852,6 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.76", -] [[package]] name = "zip" @@ -7019,14 +6995,13 @@ dependencies = [ [[package]] name = "zkevm_circuits" -version = "0.140.2" +version = "0.140.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8beed4cc1ab1f9d99a694506d18705e10059534b30742832be49637c4775e1f8" +checksum = "e3c365c801e0c6eda83fbd153df45575172beb406bfb663d386f9154b4325eda" dependencies = [ "arrayvec 0.7.6", "bincode", - "boojum", - "cs_derive", + "boojum 0.30.1", "derivative", "hex", "itertools 0.10.5", @@ -7037,18 +7012,18 @@ dependencies = [ "serde_json", "smallvec", "zkevm_opcode_defs 0.132.0", + "zksync_cs_derive", ] [[package]] name = "zkevm_circuits" -version = "0.141.1" +version = "0.141.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20f1a64d256cc5f5c58d19cf976cb45973df54e4e3010ca4a3e6fafe9f06075e" +checksum = "2ccd0352e122a4e6f0046d2163b7e692e627b23fc3264faa77331a21b65833fd" dependencies = [ "arrayvec 0.7.6", "bincode", - "boojum", - "cs_derive", + "boojum 0.30.1", "derivative", "hex", "itertools 0.10.5", @@ -7059,6 +7034,7 @@ dependencies = [ "serde_json", "smallvec", "zkevm_opcode_defs 0.141.0", + "zksync_cs_derive", ] [[package]] @@ -7068,7 +7044,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abdfaa95dfe0878fda219dd17a6cc8c28711e2067785910c0e06d3ffdca78629" dependencies = [ "arrayvec 0.7.6", - "boojum", + "boojum 0.2.2", "cs_derive", "derivative", "hex", @@ -7142,7 +7118,7 @@ dependencies = [ [[package]] name = "zksync-ethers-rs" -version = "0.1.1" +version = "0.2.1" dependencies = [ "async-trait", "clap", @@ -7168,7 +7144,7 @@ dependencies = [ [[package]] name = "zksync_basic_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", "chrono", @@ -7184,11 +7160,34 @@ dependencies = [ "url", ] +[[package]] +name = "zksync_bellman" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffa03efe9bdb137a4b36b97d1a74237e18c9ae42b755163d903a9d48c1a5d80" +dependencies = [ + "arrayvec 0.7.6", + "bit-vec", + "blake2s_simd", + "byteorder", + "cfg-if 1.0.0", + "crossbeam 0.8.4", + "futures", + "hex", + "lazy_static", + "num_cpus", + "rand 0.4.6", + "serde", + "smallvec", + "tiny-keccak 1.5.0", + "zksync_pairing", +] + [[package]] name = "zksync_concurrency" -version = "0.1.0-rc.11" +version = "0.1.0-rc.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e31a9fc9a390b440cd12bbe040330dc64f64697a8a8ecbc3beb98cd0747909" +checksum = "a49ad68bfaf6fb8542c68894b68b28be31514786549855aaa8a46b36defbb100" dependencies = [ "anyhow", "once_cell", @@ -7206,7 +7205,7 @@ dependencies = [ [[package]] name = "zksync_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", "rand 0.8.5", @@ -7221,9 +7220,9 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.1.0-rc.11" +version = "0.1.0-rc.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff679f8b5f671d887a750b8107f3b5c01fd6085f68eef37ab01de8d2bd0736b" +checksum = "4d624f55e2449f43b2c85588b5dd2a28b3c5ea629effc89df76e3254f8d9d2fb" dependencies = [ "anyhow", "rand 0.8.5", @@ -7234,7 +7233,7 @@ dependencies = [ [[package]] name = "zksync_contracts" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "envy", "ethabi", @@ -7248,7 +7247,7 @@ dependencies = [ [[package]] name = "zksync_crypto_primitives" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", "blake2", @@ -7263,10 +7262,50 @@ dependencies = [ "zksync_utils", ] +[[package]] +name = "zksync_cs_derive" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5939e2df4288c263c706ff18ac718e984149223ad4289d6d957d767dcfc04c81" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "zksync_ff" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9524b06780b5e164e84b38840c7c428c739f051f35af6efc4d1285f629ceb88e" +dependencies = [ + "byteorder", + "hex", + "rand 0.4.6", + "serde", + "zksync_ff_derive", +] + +[[package]] +name = "zksync_ff_derive" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f91e58e75d65877f09f83bc3dca8f054847ae7ec4f3e64bfa610a557edd8e8e" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", +] + [[package]] name = "zksync_mini_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "once_cell", "zksync_basic_types", @@ -7276,13 +7315,13 @@ dependencies = [ [[package]] name = "zksync_multivm" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", - "circuit_sequencer_api 0.133.0", - "circuit_sequencer_api 0.140.1", - "circuit_sequencer_api 0.141.1", - "circuit_sequencer_api 0.142.1", + "circuit_sequencer_api 0.133.1", + "circuit_sequencer_api 0.140.3", + "circuit_sequencer_api 0.141.2", + "circuit_sequencer_api 0.142.2", "circuit_sequencer_api 0.150.4", "hex", "itertools 0.10.5", @@ -7307,7 +7346,7 @@ dependencies = [ [[package]] name = "zksync_object_store" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", "async-trait", @@ -7328,11 +7367,24 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zksync_pairing" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8412ae5574472fa567a097e183f9a01974b99dd0b5da3bfa1bbe6c57c579aa2" +dependencies = [ + "byteorder", + "cfg-if 1.0.0", + "rand 0.4.6", + "serde", + "zksync_ff", +] + [[package]] name = "zksync_protobuf" -version = "0.1.0-rc.11" +version = "0.1.0-rc.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f6ba3bf0aac20de18b4ae18a22d8c81b83f8f72e8fdec1c879525ecdacd2f5" +checksum = "d26fb2beb3aeafb5e9babf1acf6494662cc7157b893fa248bd151494f931d07f" dependencies = [ "anyhow", "bit-vec", @@ -7351,9 +7403,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.1.0-rc.11" +version = "0.1.0-rc.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7798c248b9a64505f0586bd5fadad6b26c999be4a8dec6b1a86b10b3888169c5" +checksum = "58e86c198e056d921b4f3f1d2755c23d090e942b5a70b03bcb7e7c02445aa491" dependencies = [ "anyhow", "heck", @@ -7363,13 +7415,13 @@ dependencies = [ "prost-reflect", "protox", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "zksync_prover_interface" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "chrono", "circuit_sequencer_api 0.150.4", @@ -7384,7 +7436,7 @@ dependencies = [ [[package]] name = "zksync_system_constants" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "once_cell", "zksync_basic_types", @@ -7394,7 +7446,7 @@ dependencies = [ [[package]] name = "zksync_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", "bigdecimal", @@ -7428,13 +7480,12 @@ dependencies = [ [[package]] name = "zksync_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", "bigdecimal", "futures", "hex", - "itertools 0.10.5", "num", "once_cell", "reqwest 0.12.7", @@ -7451,7 +7502,7 @@ dependencies = [ [[package]] name = "zksync_vlog" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", "chrono", @@ -7477,8 +7528,10 @@ dependencies = [ [[package]] name = "zksync_vm_interface" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ + "anyhow", + "async-trait", "hex", "serde", "thiserror", @@ -7491,7 +7544,7 @@ dependencies = [ [[package]] name = "zksync_web3_decl" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git#8ed086afecfcad30bfda44fc4d29a00beea71cca" +source = "git+https://github.com/matter-labs/zksync-era.git#ffb38380f132f15095ee710181512aef05b9ed64" dependencies = [ "anyhow", "async-trait", @@ -7499,7 +7552,7 @@ dependencies = [ "jsonrpsee", "pin-project-lite", "rlp", - "rustls 0.23.12", + "rustls 0.23.13", "serde", "serde_json", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index 67506dd..f9e26b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zksync-ethers-rs" -version = "0.1.1" +version = "0.2.1" edition = "2021" license = "MIT" description = "Rust SDK for zkSync Era" diff --git a/abi/ContractDeployer.json b/abi/ContractDeployer.json new file mode 100644 index 0000000..5f749f9 --- /dev/null +++ b/abi/ContractDeployer.json @@ -0,0 +1,411 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "accountAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum IContractDeployer.AccountNonceOrdering", + "name": "nonceOrdering", + "type": "uint8" + } + ], + "name": "AccountNonceOrderingUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "accountAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum IContractDeployer.AccountAbstractionVersion", + "name": "aaVersion", + "type": "uint8" + } + ], + "name": "AccountVersionUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "deployerAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "bytecodeHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractDeployed", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_input", + "type": "bytes" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_input", + "type": "bytes" + } + ], + "name": "create2", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_input", + "type": "bytes" + }, + { + "internalType": "enum IContractDeployer.AccountAbstractionVersion", + "name": "_aaVersion", + "type": "uint8" + } + ], + "name": "create2Account", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_input", + "type": "bytes" + }, + { + "internalType": "enum IContractDeployer.AccountAbstractionVersion", + "name": "_aaVersion", + "type": "uint8" + } + ], + "name": "createAccount", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "extendedAccountVersion", + "outputs": [ + { + "internalType": "enum IContractDeployer.AccountAbstractionVersion", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "bytecodeHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "newAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "callConstructor", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "input", + "type": "bytes" + } + ], + "internalType": "struct ContractDeployer.ForceDeployment", + "name": "_deployment", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "forceDeployOnAddress", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "bytecodeHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "newAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "callConstructor", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "input", + "type": "bytes" + } + ], + "internalType": "struct ContractDeployer.ForceDeployment[]", + "name": "_deployments", + "type": "tuple[]" + } + ], + "name": "forceDeployOnAddresses", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "getAccountInfo", + "outputs": [ + { + "components": [ + { + "internalType": "enum IContractDeployer.AccountAbstractionVersion", + "name": "supportedAAVersion", + "type": "uint8" + }, + { + "internalType": "enum IContractDeployer.AccountNonceOrdering", + "name": "nonceOrdering", + "type": "uint8" + } + ], + "internalType": "struct IContractDeployer.AccountInfo", + "name": "info", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_senderNonce", + "type": "uint256" + } + ], + "name": "getNewAddressCreate", + "outputs": [ + { + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_input", + "type": "bytes" + } + ], + "name": "getNewAddressCreate2", + "outputs": [ + { + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IContractDeployer.AccountAbstractionVersion", + "name": "_version", + "type": "uint8" + } + ], + "name": "updateAccountVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IContractDeployer.AccountNonceOrdering", + "name": "_nonceOrdering", + "type": "uint8" + } + ], + "name": "updateNonceOrdering", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] + \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..5d56faf --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly" diff --git a/src/eip712/meta.rs b/src/eip712/meta.rs index d3fc1fb..381838c 100644 --- a/src/eip712/meta.rs +++ b/src/eip712/meta.rs @@ -68,17 +68,15 @@ impl Encodable for Eip712Meta { // 12 stream.append(&self.gas_per_pubdata); // 13 - if !self.factory_deps.is_empty() { - stream.begin_list(self.factory_deps.len()); - for dep in self.factory_deps.iter() { - stream.append(dep); - } - } else { - stream.begin_list(0); + stream.begin_list(self.factory_deps.len()); + for dep in self.factory_deps.iter() { + stream.append(dep); } // 14 rlp_append_option(stream, self.custom_signature.clone().map(|v| v.to_vec())); // 15 - self.paymaster_params.rlp_append(stream); + if let Some(paymaster_params) = self.paymaster_params.clone() { + paymaster_params.rlp_append(stream); + } } } diff --git a/src/eip712/paymaster_params.rs b/src/eip712/paymaster_params.rs index fe8ed78..58470aa 100644 --- a/src/eip712/paymaster_params.rs +++ b/src/eip712/paymaster_params.rs @@ -1,25 +1,21 @@ -use super::rlp_append_option; -use ethers::{ - types::{Address, Bytes}, - utils::rlp::Encodable, -}; +use ethers::{types::Address, utils::rlp::Encodable}; use serde::Serialize; #[derive(Serialize, serde::Deserialize, Clone, Debug, Default)] #[serde(rename_all(serialize = "camelCase", deserialize = "camelCase"))] pub struct PaymasterParams { - pub paymaster: Option
, - pub paymaster_input: Option, + pub paymaster: Address, + pub paymaster_input: Vec, } impl PaymasterParams { pub fn paymaster(mut self, paymaster: Address) -> Self { - self.paymaster = Some(paymaster); + self.paymaster = paymaster; self } - pub fn paymaster_input(mut self, paymaster_input: Bytes) -> Self { - self.paymaster_input = Some(paymaster_input); + pub fn paymaster_input(mut self, paymaster_input: Vec) -> Self { + self.paymaster_input = paymaster_input; self } } @@ -27,7 +23,7 @@ impl PaymasterParams { impl Encodable for PaymasterParams { fn rlp_append(&self, stream: &mut ethers::utils::rlp::RlpStream) { stream.begin_list(2); - rlp_append_option(stream, self.paymaster); - rlp_append_option(stream, self.paymaster_input.clone().map(|v| v.to_vec())); + stream.append(&self.paymaster); + stream.append(&self.paymaster_input.clone()); } } diff --git a/src/eip712/transaction.rs b/src/eip712/transaction.rs index 1e177c3..70f8a45 100644 --- a/src/eip712/transaction.rs +++ b/src/eip712/transaction.rs @@ -291,12 +291,9 @@ impl TryFrom for Eip712Transaction { .chain_id(tx.chain_id); if let Some(paymaster_params) = tx.custom_data.paymaster_params { - if let Some(paymaster) = paymaster_params.paymaster { - eip712_transaction = eip712_transaction.paymaster(paymaster) - } - if let Some(paymaster_input) = paymaster_params.paymaster_input { - eip712_transaction = eip712_transaction.paymaster_input(paymaster_input) - } + eip712_transaction = eip712_transaction + .paymaster(paymaster_params.paymaster) + .paymaster_input(paymaster_params.paymaster_input); } if let Some(gas_limit) = tx.gas_limit { diff --git a/src/eip712/transaction_request.rs b/src/eip712/transaction_request.rs index e1b6d85..ee7c678 100644 --- a/src/eip712/transaction_request.rs +++ b/src/eip712/transaction_request.rs @@ -165,48 +165,29 @@ impl Eip712TransactionRequest { } pub fn rlp(&self, signature: Option) -> Result { - let mut stream = RlpStream::new(); - stream.begin_unbounded_list(); - - // 0 - stream.append(&self.nonce); - // 1 - stream.append(&self.max_priority_fee_per_gas); - // 2 - rlp_append_option(&mut stream, self.max_fee_per_gas); - // 3 (supped to be gas) - rlp_append_option(&mut stream, self.gas_limit); - // 4 - stream.append(&self.to); - // 5 - stream.append(&self.value); - // 6 - stream.append(&self.data.0); - // 7 - stream.append(&self.chain_id); - // 8 - stream.append(&""); - // 9 - stream.append(&""); - // 10 - stream.append(&self.chain_id); - // 11 - stream.append(&self.from); - // 12, 13, 14, 15 - if self.custom_data.custom_signature.clone().is_some() { - self.custom_data.rlp_append(&mut stream); - } else if let Some(signature) = signature { - let tx = self.clone().custom_data( - self.clone() - .custom_data - .custom_signature(signature.to_vec()), - ); - tx.custom_data.rlp_append(&mut stream); - } else { - return Err(Eip712Error::Message("No signature provided".to_owned())); + let mut rlp = RlpStream::new(); + rlp.begin_unbounded_list(); + rlp.append(&self.nonce); + rlp.append(&self.max_priority_fee_per_gas); + rlp.append(&self.gas_price); + rlp_append_option(&mut rlp, self.gas_limit); + rlp.append(&self.to); + rlp.append(&self.value); + rlp.append(&self.data.0); + if let Some(sig) = signature { + rlp.append(&sig.v); + // Convert to big-endian bytes (32 bytes in total) + let mut bytes = [0_u8; 32]; // U256 is 32 bytes + sig.r.to_big_endian(&mut bytes); + rlp.append(&bytes.as_slice()); + sig.s.to_big_endian(&mut bytes); + rlp.append(&bytes.as_slice()); } - stream.finalize_unbounded_list(); - Ok(stream.out().freeze().into()) + rlp.append(&self.chain_id); + rlp.append(&self.from); + self.custom_data.rlp_append(&mut rlp); + rlp.finalize_unbounded_list(); + Ok(rlp.out().freeze().into()) } } diff --git a/src/lib.rs b/src/lib.rs index fe72a28..7218354 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,6 @@ #![forbid(unsafe_code)] #![recursion_limit = "256"] #![warn( - clippy::allow_attributes_without_reason, clippy::as_conversions, clippy::as_ptr_cast_mut, clippy::unnecessary_cast, diff --git a/src/zk_middleware.rs b/src/zk_middleware.rs index f65b8b7..6d79ae9 100644 --- a/src/zk_middleware.rs +++ b/src/zk_middleware.rs @@ -597,12 +597,13 @@ where .map_err(|_e| ProviderError::CustomError("error on send_transaction_eip712".to_owned())) .map_err(M::convert_err)?; + let gas_price = self.get_gas_price().await?; request = request .from(wallet.address()) .chain_id(wallet.chain_id()) .nonce(self.get_transaction_count(wallet.address(), None).await?) - .gas_price(self.get_gas_price().await?) - .max_fee_per_gas(self.get_gas_price().await?); + .gas_price(gas_price) + .max_fee_per_gas(gas_price); let custom_data = request.clone().custom_data; let fee = self.estimate_fee(request.clone()).await?; From ff3110c1f94a79c1aa642da14e2e9dc90781d90d Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Wed, 11 Sep 2024 17:53:02 -0300 Subject: [PATCH 68/75] add send_transaction_eip712 to zk_wallet --- src/eip712/mod.rs | 2 + src/eip712/transaction_request.rs | 166 ++++++++++++++++++++---------- src/zk_wallet.rs | 75 +++++++++++++- 3 files changed, 185 insertions(+), 58 deletions(-) diff --git a/src/eip712/mod.rs b/src/eip712/mod.rs index 91862d8..ae9e218 100644 --- a/src/eip712/mod.rs +++ b/src/eip712/mod.rs @@ -17,6 +17,8 @@ pub use transaction::Eip712Transaction; mod paymaster_params; pub use paymaster_params::PaymasterParams; +pub use transaction_request::DeployRequest; + /// The 32-byte hash of the bytecode of a zkSync contract is calculated in the following way: /// /// * The first 2 bytes denote the version of bytecode hash format and are currently equal to [1,0]. diff --git a/src/eip712/transaction_request.rs b/src/eip712/transaction_request.rs index ee7c678..999c119 100644 --- a/src/eip712/transaction_request.rs +++ b/src/eip712/transaction_request.rs @@ -1,14 +1,19 @@ -use super::{rlp_append_option, Eip712Meta}; -use crate::{types::L1TxOverrides, utils::MAX_PRIORITY_FEE_PER_GAS}; +use super::{hash_bytecode, rlp_append_option, Eip712Meta}; +use crate::{ + types::L1TxOverrides, + utils::{self, MAX_PRIORITY_FEE_PER_GAS}, +}; use ethers::{ + abi::{Abi, Error, ParseError}, types::{ transaction::{eip2930::AccessList, eip712::Eip712Error}, Address, Bytes, Signature, U256, }, utils::rlp::{Encodable, RlpStream}, }; +use ethers_contract::{abigen, encode_function_data, AbiError}; use serde::{Deserialize, Serialize}; -use zksync_types::{DEFAULT_ERA_CHAIN_ID, EIP_712_TX_TYPE}; +use zksync_types::{CONTRACT_DEPLOYER_ADDRESS, DEFAULT_ERA_CHAIN_ID, EIP_712_TX_TYPE}; // TODO: Not all the fields are optional. This was copied from the JS implementation. #[derive(Serialize, Deserialize, Clone, Debug)] @@ -245,57 +250,108 @@ impl Default for Eip712TransactionRequest { // } // } -// impl TryFrom for Eip712TransactionRequest { -// type Error = ZKRequestError; +use std::{fmt::Debug, fs::File, io::BufReader, path::PathBuf}; -// fn try_from(request: DeployRequest) -> Result { -// let mut contract_deployer_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); -// contract_deployer_path.push("src/abi/ContractDeployer.json"); - -// let custom_data = Eip712Meta::new().factory_deps({ -// let mut factory_deps = Vec::new(); -// if let Some(factory_dependencies) = request.factory_deps { -// factory_deps.extend(factory_dependencies); -// } -// factory_deps.push(request.contract_bytecode.clone()); -// factory_deps -// }); - -// let contract_deployer = Abi::load(BufReader::new( -// File::open(contract_deployer_path).map_err(|e| { -// ZKRequestError::CustomError(format!( -// "Error opening contract deployer abi file {e:?}" -// )) -// })?, -// ))?; -// let create = contract_deployer.function("create")?; - -// // TODO: User could provide this instead of defaulting. -// let salt = [0_u8; 32]; -// let bytecode_hash = hash_bytecode(&request.contract_bytecode).map_err(|e| { -// ZKRequestError::CustomError(format!("Error hashing contract bytecode {e:?}")) -// })?; -// let call_data: Bytes = match ( -// request.contract_abi.constructor(), -// request.constructor_parameters.is_empty(), -// ) { -// (None, false) => { -// return Err(ZKRequestError::CustomError( -// "Constructor not present".to_owned(), -// )) -// } -// (None, true) | (Some(_), true) => Bytes::default(), -// (Some(constructor), false) => { -// utils::encode_constructor_args(constructor, &request.constructor_parameters)?.into() -// } -// }; - -// let data = encode_function_data(create, (salt, bytecode_hash, call_data))?; +#[derive(Clone, Debug)] +pub struct DeployRequest { + pub contract_abi: Abi, + pub contract_bytecode: Vec, + pub constructor_parameters: Vec, + pub from: Address, + pub factory_deps: Option>>, +} -// Ok(Eip712TransactionRequest::new() -// .r#type(EIP_712_TX_TYPE) -// .to(CONTRACT_DEPLOYER_ADDRESS) -// .custom_data(custom_data) -// .data(data)) -// } -// } +impl DeployRequest { + pub fn with( + contract_abi: Abi, + contract_bytecode: Vec, + constructor_parameters: Vec, + ) -> Self { + Self { + contract_abi, + contract_bytecode, + constructor_parameters, + from: Default::default(), + factory_deps: None, + } + } + + pub fn from(mut self, from: Address) -> Self { + self.from = from; + self + } + + pub fn factory_deps(mut self, factory_deps: Vec>) -> Self { + self.factory_deps = Some(factory_deps); + self + } +} + +#[derive(thiserror::Error, Debug)] +pub enum ZKRequestError { + #[error("Error parsing function: {0}")] + ParseFunctionError(#[from] ParseError), + #[error("ABI error: {0}")] + AbiError(#[from] AbiError), + #[error("Encoding or decoding error: {0}")] + Error(#[from] Error), + #[error("{0}")] + CustomError(String), +} + +abigen!(ContractDeployer, "abi/ContractDeployer.json"); + +impl TryFrom for Eip712TransactionRequest { + type Error = ZKRequestError; + + fn try_from(request: DeployRequest) -> Result { + let mut contract_deployer_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + contract_deployer_path.push("abi/ContractDeployer.json"); + + let custom_data = Eip712Meta::new().factory_deps({ + let mut factory_deps = Vec::new(); + if let Some(factory_dependencies) = request.factory_deps { + factory_deps.extend(factory_dependencies); + } + factory_deps.push(request.contract_bytecode.clone()); + factory_deps + }); + + let contract_deployer = Abi::load(BufReader::new( + File::open(contract_deployer_path).map_err(|e| { + ZKRequestError::CustomError(format!( + "Error opening contract deployer abi file {e:?}" + )) + })?, + ))?; + let create = contract_deployer.function("create")?; + + // TODO: User could provide this instead of defaulting. + let salt = [0_u8; 32]; + let bytecode_hash = hash_bytecode(&request.contract_bytecode).map_err(|e| { + ZKRequestError::CustomError(format!("Error hashing contract bytecode {e:?}")) + })?; + let call_data: Bytes = match ( + request.contract_abi.constructor(), + request.constructor_parameters.is_empty(), + ) { + (None, false) => { + return Err(ZKRequestError::CustomError( + "Constructor not present".to_owned(), + )) + } + (None, true) | (Some(_), true) => Bytes::default(), + (Some(constructor), false) => { + utils::encode_constructor_args(constructor, &request.constructor_parameters)?.into() + } + }; + + let data = encode_function_data(create, (salt, bytecode_hash, call_data))?; + + Ok(Eip712TransactionRequest::new() + .r#type(EIP_712_TX_TYPE) + .to(CONTRACT_DEPLOYER_ADDRESS) + .custom_data(custom_data) + .data(data)) + } +} diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index 44a05ac..0d89c1f 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -1,15 +1,23 @@ +// FIXME: Remove this after finishing the implementation. +#![allow(clippy::unwrap_used)] + use ethers::{ abi::{Address, Hash}, middleware::SignerMiddleware, providers::{Middleware, Provider}, signers::Signer, - types::U256, + types::{Signature, TransactionReceipt, U256}, }; use std::sync::Arc; -use zksync_types::L2_BASE_TOKEN_ADDRESS; +use zksync_types::{fee::Fee, EIP_712_TX_TYPE, L2_BASE_TOKEN_ADDRESS}; use crate::{ - deposit, transfer, types::L2TxOverrides, utils::L2_ETH_TOKEN_ADDRESS, withdraw, ZKMiddleware, + deposit, + eip712::{Eip712Transaction, Eip712TransactionRequest}, + transfer, + types::L2TxOverrides, + utils::L2_ETH_TOKEN_ADDRESS, + withdraw, ZKMiddleware, }; #[derive(thiserror::Error, Debug)] @@ -509,4 +517,65 @@ where .await .map_err(Into::into) } + + //value: MiddlewareError(JsonRpcClientError(JsonRpcError(JsonRpcError { code: -32000, message: "transaction type not supported", data: None }))) + pub async fn send_transaction_eip712( + &self, + transaction: Eip712TransactionRequest, + ) -> TransactionReceipt { + let mut request: Eip712TransactionRequest = transaction; + let gas_price = self.l2_provider().get_gas_price().await.unwrap(); + let l1_signer = self.l1_signer(); + request = request + .from(self.l2_address()) + .chain_id(self.l2_provider().get_chainid().await.unwrap()) + .nonce( + self.l2_provider() + .get_transaction_count(self.l2_address(), None) + .await + .unwrap(), + ) + .gas_price(gas_price) + .max_fee_per_gas(gas_price); + + let custom_data = request.clone().custom_data; + // TODO: estimate_fee is not working + //let fee = self + // .l2_provider() + // .estimate_fee(request.clone()) + // .await + // .unwrap(); + let fee = Fee { + max_fee_per_gas: U256::from(2000000), + max_priority_fee_per_gas: U256::from(2000000), + gas_limit: U256::from(2000000), + gas_per_pubdata_limit: U256::from(3000000), + }; + request = request + .max_priority_fee_per_gas(fee.max_priority_fee_per_gas) + .max_fee_per_gas(fee.max_fee_per_gas) + .gas_limit(fee.gas_limit); + let signable_data: Eip712Transaction = request.clone().try_into().unwrap(); + //.map_err(|e: Eip712Error| ProviderError::CustomError(e.to_string())) + //.map_err(M::convert_err)?; + let signature: Signature = self + .l1_signer() + .signer() + .sign_typed_data(&signable_data) + .await + .unwrap(); + //.map_err(|e| ProviderError::CustomError(format!("error signing transaction: {e}"))) + //.map_err(M::convert_err)?; + request = request.custom_data(custom_data.custom_signature(signature.to_vec())); + let encoded_rlp = &*request.rlp_signed(signature).unwrap(); + //.map_err(|e| ProviderError::CustomError(format!("Error in the rlp encoding {e}"))) + //.map_err(M::convert_err)?; + l1_signer + .send_raw_transaction([&[EIP_712_TX_TYPE], encoded_rlp].concat().into()) + .await + .unwrap() + .await + .unwrap() + .unwrap() + } } From 745420b5cc2e49f21bd63c492a2873395731efb7 Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Fri, 13 Sep 2024 19:12:49 -0300 Subject: [PATCH 69/75] wip: add fixes --- rust-toolchain.toml | 2 +- src/zk_wallet.rs | 35 ++++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5d56faf..74f46e1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly" +channel = "nightly-2024-09-06" diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index 0d89c1f..952d228 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -3,13 +3,14 @@ use ethers::{ abi::{Address, Hash}, + core::k256::ecdsa::signature::hazmat::PrehashSigner, middleware::SignerMiddleware, providers::{Middleware, Provider}, signers::Signer, types::{Signature, TransactionReceipt, U256}, }; use std::sync::Arc; -use zksync_types::{fee::Fee, EIP_712_TX_TYPE, L2_BASE_TOKEN_ADDRESS}; +use zksync_types::{EIP_712_TX_TYPE, L2_BASE_TOKEN_ADDRESS}; use crate::{ deposit, @@ -525,7 +526,6 @@ where ) -> TransactionReceipt { let mut request: Eip712TransactionRequest = transaction; let gas_price = self.l2_provider().get_gas_price().await.unwrap(); - let l1_signer = self.l1_signer(); request = request .from(self.l2_address()) .chain_id(self.l2_provider().get_chainid().await.unwrap()) @@ -539,27 +539,28 @@ where .max_fee_per_gas(gas_price); let custom_data = request.clone().custom_data; - // TODO: estimate_fee is not working - //let fee = self - // .l2_provider() - // .estimate_fee(request.clone()) - // .await - // .unwrap(); - let fee = Fee { - max_fee_per_gas: U256::from(2000000), - max_priority_fee_per_gas: U256::from(2000000), - gas_limit: U256::from(2000000), - gas_per_pubdata_limit: U256::from(3000000), - }; + let fee = self + .l2_provider() + .estimate_fee(request.clone()) + .await + .unwrap(); request = request .max_priority_fee_per_gas(fee.max_priority_fee_per_gas) - .max_fee_per_gas(fee.max_fee_per_gas) .gas_limit(fee.gas_limit); let signable_data: Eip712Transaction = request.clone().try_into().unwrap(); //.map_err(|e: Eip712Error| ProviderError::CustomError(e.to_string())) //.map_err(M::convert_err)?; + + //Before: + // + // pub struct Wallet> + // RecoverableSignature == pub type Signature = ecdsa_core::Signature + // + //let encoded = signable_data.encode_eip712().unwrap(); + //let signature = PrehashSigner::sign_prehash(&self.l2_signer.signer(), encoded).unwrap(); + let signature: Signature = self - .l1_signer() + .l2_signer() .signer() .sign_typed_data(&signable_data) .await @@ -570,7 +571,7 @@ where let encoded_rlp = &*request.rlp_signed(signature).unwrap(); //.map_err(|e| ProviderError::CustomError(format!("Error in the rlp encoding {e}"))) //.map_err(M::convert_err)?; - l1_signer + self.l2_provider() .send_raw_transaction([&[EIP_712_TX_TYPE], encoded_rlp].concat().into()) .await .unwrap() From adb9baaafa6bc47bedeef9f05154caa507d4dcc8 Mon Sep 17 00:00:00 2001 From: IAvecilla Date: Thu, 19 Sep 2024 18:53:00 -0300 Subject: [PATCH 70/75] Fix deploy and handle errors --- src/deposit/mod.rs | 2 +- src/eip712/transaction_request.rs | 17 ++++---- src/zk_wallet.rs | 67 ++++++++++++++----------------- tests/common/mod.rs | 10 ++++- tests/deploy.rs | 25 ++++++++++++ 5 files changed, 73 insertions(+), 48 deletions(-) create mode 100644 tests/deploy.rs diff --git a/src/deposit/mod.rs b/src/deposit/mod.rs index 88dbf67..fc633cb 100644 --- a/src/deposit/mod.rs +++ b/src/deposit/mod.rs @@ -79,7 +79,7 @@ where // overrides. if allowance < amount { erc20 - .approve(l1_shared_bridge_address, amount * 2) + .approve(l1_shared_bridge_address, amount * 2_u8) .send() .await .unwrap() diff --git a/src/eip712/transaction_request.rs b/src/eip712/transaction_request.rs index 999c119..bf896af 100644 --- a/src/eip712/transaction_request.rs +++ b/src/eip712/transaction_request.rs @@ -308,14 +308,15 @@ impl TryFrom for Eip712TransactionRequest { let mut contract_deployer_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); contract_deployer_path.push("abi/ContractDeployer.json"); - let custom_data = Eip712Meta::new().factory_deps({ - let mut factory_deps = Vec::new(); - if let Some(factory_dependencies) = request.factory_deps { - factory_deps.extend(factory_dependencies); - } - factory_deps.push(request.contract_bytecode.clone()); - factory_deps - }); + let custom_data = Eip712Meta::new() + .factory_deps({ + let mut factory_deps = Vec::new(); + if let Some(factory_dependencies) = request.factory_deps { + factory_deps.extend(factory_dependencies); + } + factory_deps.push(request.contract_bytecode.clone()); + factory_deps + }); let contract_deployer = Abi::load(BufReader::new( File::open(contract_deployer_path).map_err(|e| { diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index 952d228..6aff923 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -3,7 +3,6 @@ use ethers::{ abi::{Address, Hash}, - core::k256::ecdsa::signature::hazmat::PrehashSigner, middleware::SignerMiddleware, providers::{Middleware, Provider}, signers::Signer, @@ -25,6 +24,8 @@ use crate::{ pub enum ZKWalletError { #[error("Provider error: {0}")] ProviderError(#[from] ethers::providers::ProviderError), + #[error("Deploy error: {0}")] + DeployError(String), } /// A ZKsync wallet @@ -38,10 +39,13 @@ where M: Middleware, S: Signer, { - pub fn new(l1_signer: SignerMiddleware, l2_signer: SignerMiddleware) -> Self { + pub fn new( + l1_signer: Arc>, + l2_signer: Arc>, + ) -> Self { Self { - l1_signer: Arc::new(l1_signer), - l2_signer: Arc::new(l2_signer), + l1_signer, + l2_signer, } } @@ -519,64 +523,53 @@ where .map_err(Into::into) } - //value: MiddlewareError(JsonRpcClientError(JsonRpcError(JsonRpcError { code: -32000, message: "transaction type not supported", data: None }))) pub async fn send_transaction_eip712( &self, transaction: Eip712TransactionRequest, - ) -> TransactionReceipt { + ) -> Result { let mut request: Eip712TransactionRequest = transaction; - let gas_price = self.l2_provider().get_gas_price().await.unwrap(); + let gas_price = self.l2_provider().get_gas_price().await?; request = request .from(self.l2_address()) .chain_id(self.l2_provider().get_chainid().await.unwrap()) .nonce( self.l2_provider() .get_transaction_count(self.l2_address(), None) - .await - .unwrap(), + .await?, ) .gas_price(gas_price) .max_fee_per_gas(gas_price); let custom_data = request.clone().custom_data; - let fee = self - .l2_provider() - .estimate_fee(request.clone()) - .await - .unwrap(); + let fee = self.l2_provider().estimate_fee(request.clone()).await?; request = request .max_priority_fee_per_gas(fee.max_priority_fee_per_gas) - .gas_limit(fee.gas_limit); - let signable_data: Eip712Transaction = request.clone().try_into().unwrap(); - //.map_err(|e: Eip712Error| ProviderError::CustomError(e.to_string())) - //.map_err(M::convert_err)?; - - //Before: - // - // pub struct Wallet> - // RecoverableSignature == pub type Signature = ecdsa_core::Signature - // - //let encoded = signable_data.encode_eip712().unwrap(); - //let signature = PrehashSigner::sign_prehash(&self.l2_signer.signer(), encoded).unwrap(); + .gas_limit(fee.gas_limit) + .max_fee_per_gas(fee.max_fee_per_gas); + let signable_data: Eip712Transaction = request.clone().try_into().map_err(|e| { + ZKWalletError::DeployError(format!("error converting deploy to eip 712 {e}")) + })?; let signature: Signature = self .l2_signer() .signer() .sign_typed_data(&signable_data) .await - .unwrap(); - //.map_err(|e| ProviderError::CustomError(format!("error signing transaction: {e}"))) - //.map_err(M::convert_err)?; + .map_err(|e| { + ZKWalletError::DeployError(format!("error signing deploy transaction: {e}")) + })?; + request = request.custom_data(custom_data.custom_signature(signature.to_vec())); - let encoded_rlp = &*request.rlp_signed(signature).unwrap(); - //.map_err(|e| ProviderError::CustomError(format!("Error in the rlp encoding {e}"))) - //.map_err(M::convert_err)?; + let encoded_rlp = &*request + .rlp_signed(signature) + .map_err(|e| ZKWalletError::DeployError(format!("Error in the rlp encoding {e}")))?; + self.l2_provider() .send_raw_transaction([&[EIP_712_TX_TYPE], encoded_rlp].concat().into()) - .await - .unwrap() - .await - .unwrap() - .unwrap() + .await? + .await? + .ok_or(ZKWalletError::DeployError( + "Error sending the deploy transaction".to_string(), + )) } } diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 919e19c..047e3fe 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,11 +1,11 @@ use std::{str::FromStr, sync::Arc}; use ethers::{ - abi::{Address, Hash}, + abi::{Abi, Address, Hash}, prelude::SignerMiddleware, providers::{Http, Middleware, Provider, ProviderExt}, signers::{LocalWallet, Signer}, - types::{U256, U64}, + types::{Bytes, U256, U64}, }; use zksync_ethers_rs::{ utils::{L1_ETH_TOKEN_ADDRESS, L2_ETH_TOKEN_ADDRESS}, @@ -17,6 +17,12 @@ pub const L2_EXPLORER_URL: &str = "http://127.0.0.1:3010"; pub const L1_EXPLORER_URL: &str = ""; pub const L1_RPC_URL: &str = "http://127.0.0.1:8545"; +#[derive(Debug, serde::Deserialize)] +pub struct CompiledContract { + pub abi: Abi, + pub bin: Bytes, +} + pub fn l1_explorer_url() -> String { std::env::var("L1_EXPLORER_URL").unwrap_or(L1_EXPLORER_URL.to_owned()) } diff --git a/tests/deploy.rs b/tests/deploy.rs new file mode 100644 index 0000000..3944528 --- /dev/null +++ b/tests/deploy.rs @@ -0,0 +1,25 @@ +use std::{fs::File, path::PathBuf}; + +use common::{ + l1_signer, l2_signer, CompiledContract, +}; +use zksync_ethers_rs::{ + eip712::{DeployRequest, Eip712TransactionRequest}, + zk_wallet::ZKWallet, +}; +mod common; + +#[tokio::test] +async fn test_deploy() { + let zk_wallet = ZKWallet::new(l1_signer().await, l2_signer().await); + let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + contract_path.push("abi/test_contracts/storage_combined.json"); + let contract: CompiledContract = + serde_json::from_reader(File::open(contract_path).unwrap()).unwrap(); + let deploy_request = + DeployRequest::with(contract.abi, contract.bin.to_vec(), vec!["10".to_owned()]) + .from(zk_wallet.l2_address()); + let tx_request: Eip712TransactionRequest = deploy_request.clone().try_into().unwrap(); + let tx_result = zk_wallet.send_transaction_eip712(tx_request).await; + assert!(tx_result.is_ok()); +} From 7fe59015af99fbdab9ef37b5c06d5426f08ef8bd Mon Sep 17 00:00:00 2001 From: IAvecilla Date: Thu, 19 Sep 2024 18:55:23 -0300 Subject: [PATCH 71/75] Remove allow unwrap for zk wallet --- src/zk_wallet.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index 6aff923..8e69bf1 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -1,6 +1,3 @@ -// FIXME: Remove this after finishing the implementation. -#![allow(clippy::unwrap_used)] - use ethers::{ abi::{Address, Hash}, middleware::SignerMiddleware, @@ -531,7 +528,7 @@ where let gas_price = self.l2_provider().get_gas_price().await?; request = request .from(self.l2_address()) - .chain_id(self.l2_provider().get_chainid().await.unwrap()) + .chain_id(self.l2_provider().get_chainid().await?) .nonce( self.l2_provider() .get_transaction_count(self.l2_address(), None) From 514437208ae511ac2e62d858698b65d687d774df Mon Sep 17 00:00:00 2001 From: IAvecilla Date: Thu, 19 Sep 2024 19:00:27 -0300 Subject: [PATCH 72/75] Rename error for sending eip712 transaction --- src/zk_wallet.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index 8e69bf1..e2cf6e2 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -22,7 +22,7 @@ pub enum ZKWalletError { #[error("Provider error: {0}")] ProviderError(#[from] ethers::providers::ProviderError), #[error("Deploy error: {0}")] - DeployError(String), + SendEIP712(String), } /// A ZKsync wallet @@ -544,7 +544,7 @@ where .gas_limit(fee.gas_limit) .max_fee_per_gas(fee.max_fee_per_gas); let signable_data: Eip712Transaction = request.clone().try_into().map_err(|e| { - ZKWalletError::DeployError(format!("error converting deploy to eip 712 {e}")) + ZKWalletError::SendEIP712(format!("error converting deploy to eip 712 {e}")) })?; let signature: Signature = self @@ -553,19 +553,19 @@ where .sign_typed_data(&signable_data) .await .map_err(|e| { - ZKWalletError::DeployError(format!("error signing deploy transaction: {e}")) + ZKWalletError::SendEIP712(format!("error signing deploy transaction: {e}")) })?; request = request.custom_data(custom_data.custom_signature(signature.to_vec())); let encoded_rlp = &*request .rlp_signed(signature) - .map_err(|e| ZKWalletError::DeployError(format!("Error in the rlp encoding {e}")))?; + .map_err(|e| ZKWalletError::SendEIP712(format!("Error in the rlp encoding {e}")))?; self.l2_provider() .send_raw_transaction([&[EIP_712_TX_TYPE], encoded_rlp].concat().into()) .await? .await? - .ok_or(ZKWalletError::DeployError( + .ok_or(ZKWalletError::SendEIP712( "Error sending the deploy transaction".to_string(), )) } From 3ad4a82e81dc0213995f1472934c6384a8c5b005 Mon Sep 17 00:00:00 2001 From: IAvecilla Date: Thu, 19 Sep 2024 19:00:42 -0300 Subject: [PATCH 73/75] Remove send eip712 from middleware --- src/zk_middleware.rs | 91 -------------------------------------------- 1 file changed, 91 deletions(-) diff --git a/src/zk_middleware.rs b/src/zk_middleware.rs index 6d79ae9..c67ae0a 100644 --- a/src/zk_middleware.rs +++ b/src/zk_middleware.rs @@ -220,17 +220,6 @@ pub trait ZKMiddleware { tx: Bytes, ) -> Result; - async fn send_eip712( - &self, - wallet: &Wallet, - contract_address: Address, - function_signature: &str, - function_parameters: Option>, - overrides: Option, - ) -> Result, Self::Error> - where - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync; - async fn send( &self, wallet: &Wallet, @@ -631,86 +620,6 @@ where .await } - async fn send_eip712( - &self, - wallet: &Wallet, - contract_address: Address, - function_signature: &str, - function_parameters: Option>, - overrides: Option, - ) -> Result, Self::Error> - where - D: PrehashSigner<(RecoverableSignature, RecoveryId)> + Send + Sync, - { - // Note: We couldn't implement Self::Error::LexerError because ethers-rs's LexerError is not exposed. - // TODO check for ECADD precompile address to get the function signature. - let function = HumanReadableParser::parse_function(function_signature) - .map_err(|e| ProviderError::CustomError(e.to_string())) - .map_err(M::convert_err)?; - - let mut send_request = if let Some(overrides) = overrides { - Eip712TransactionRequest::from_overrides(overrides) - } else { - Eip712TransactionRequest::new() - }; - - let function_args = if let Some(function_args) = function_parameters { - function - .decode_input( - &utils::encode_args(&function, &function_args) - .map_err(|e| ProviderError::CustomError(e.to_string())) - .map_err(M::convert_err)?, - ) - .map_err(|e| ProviderError::CustomError(e.to_string())) - .map_err(M::convert_err)? - } else { - vec![] - }; - - send_request = send_request - .r#type(EIP_712_TX_TYPE) - .from(wallet.address()) - .to(contract_address) - .chain_id(wallet.chain_id()) - .nonce(self.get_transaction_count(wallet.address(), None).await?) - .gas_price(self.get_gas_price().await?) - .max_fee_per_gas(self.get_gas_price().await?) - .data(if !function_args.is_empty() { - function - .encode_input(&function_args) - .map_err(|e| ProviderError::CustomError(e.to_string())) - .map_err(M::convert_err)? - } else { - function.short_signature().into() - }); - - let fee = self.estimate_fee(send_request.clone()).await?; - send_request = send_request - .max_priority_fee_per_gas(fee.max_priority_fee_per_gas) - .max_fee_per_gas(fee.max_fee_per_gas) - .gas_limit(fee.gas_limit); - - let signable_data: Eip712Transaction = send_request - .clone() - .try_into() - .map_err(|e: Eip712Error| ProviderError::CustomError(e.to_string())) - .map_err(M::convert_err)?; - let signature: Signature = wallet - .sign_typed_data(&signable_data) - .await - .map_err(|e| ProviderError::CustomError(format!("error signing transaction: {e}"))) - .map_err(M::convert_err)?; - send_request = - send_request.custom_data(Eip712Meta::new().custom_signature(signature.to_vec())); - - let encoded_rlp = &*send_request - .rlp_signed(signature) - .map_err(|e| ProviderError::CustomError(format!("error encoding transaction: {e}"))) - .map_err(M::convert_err)?; - self.send_raw_transaction([&[EIP_712_TX_TYPE], encoded_rlp].concat().into()) - .await - } - async fn send( &self, wallet: &Wallet, From a1dbfa3cc50f47457ecb7c600af891fc918f5200 Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Fri, 20 Sep 2024 15:04:51 -0300 Subject: [PATCH 74/75] wip: investigate how to set gas_per_pubdata dynamically --- src/eip712/transaction_request.rs | 3 ++- src/zk_middleware.rs | 2 +- src/zk_wallet.rs | 13 +++++++------ tests/common/mod.rs | 2 +- tests/deploy.rs | 9 ++++++--- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/eip712/transaction_request.rs b/src/eip712/transaction_request.rs index bf896af..546f87f 100644 --- a/src/eip712/transaction_request.rs +++ b/src/eip712/transaction_request.rs @@ -316,7 +316,8 @@ impl TryFrom for Eip712TransactionRequest { } factory_deps.push(request.contract_bytecode.clone()); factory_deps - }); + }) + .gas_per_pubdata(U256::from(50000_u32)); let contract_deployer = Abi::load(BufReader::new( File::open(contract_deployer_path).map_err(|e| { diff --git a/src/zk_middleware.rs b/src/zk_middleware.rs index c67ae0a..1d153aa 100644 --- a/src/zk_middleware.rs +++ b/src/zk_middleware.rs @@ -31,7 +31,7 @@ use ethers::{ }; use crate::{ - eip712::{Eip712Meta, Eip712Transaction, Eip712TransactionRequest}, + eip712::{Eip712Transaction, Eip712TransactionRequest}, types::L1TxOverrides, utils, }; diff --git a/src/zk_wallet.rs b/src/zk_wallet.rs index e2cf6e2..6494ce9 100644 --- a/src/zk_wallet.rs +++ b/src/zk_wallet.rs @@ -525,7 +525,7 @@ where transaction: Eip712TransactionRequest, ) -> Result { let mut request: Eip712TransactionRequest = transaction; - let gas_price = self.l2_provider().get_gas_price().await?; + request = request .from(self.l2_address()) .chain_id(self.l2_provider().get_chainid().await?) @@ -533,16 +533,17 @@ where self.l2_provider() .get_transaction_count(self.l2_address(), None) .await?, - ) - .gas_price(gas_price) - .max_fee_per_gas(gas_price); + ); let custom_data = request.clone().custom_data; let fee = self.l2_provider().estimate_fee(request.clone()).await?; + let gas = self.l2_provider().zk_estimate_gas(request.clone()).await?; + let gas_price = self.l2_provider().get_gas_price().await?; request = request .max_priority_fee_per_gas(fee.max_priority_fee_per_gas) - .gas_limit(fee.gas_limit) - .max_fee_per_gas(fee.max_fee_per_gas); + .gas_limit(gas) + .max_fee_per_gas(fee.max_fee_per_gas) + .gas_price(gas_price); let signable_data: Eip712Transaction = request.clone().try_into().map_err(|e| { ZKWalletError::SendEIP712(format!("error converting deploy to eip 712 {e}")) })?; diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 047e3fe..9b993c0 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -46,7 +46,7 @@ pub async fn signer( Arc::new(SignerMiddleware::, LocalWallet>::new( provider, LocalWallet::from_str(&std::env::var("PRIVATE_KEY").unwrap_or( - "0x385c546456b6a603a1cfcaa9ec9494ba4832da08dd6bcf4de9a71e4a01b74924".to_owned(), + "0x850683b40d4a740aa6e745f889a6fdc8327be76e122f5aba645a5b02d0248db8".to_owned(), )) .unwrap() .with_chain_id(chain_id), diff --git a/tests/deploy.rs b/tests/deploy.rs index 3944528..0f76168 100644 --- a/tests/deploy.rs +++ b/tests/deploy.rs @@ -1,8 +1,7 @@ use std::{fs::File, path::PathBuf}; -use common::{ - l1_signer, l2_signer, CompiledContract, -}; +use common::{l1_signer, l2_signer, CompiledContract}; +use ethers::utils::parse_ether; use zksync_ethers_rs::{ eip712::{DeployRequest, Eip712TransactionRequest}, zk_wallet::ZKWallet, @@ -12,6 +11,10 @@ mod common; #[tokio::test] async fn test_deploy() { let zk_wallet = ZKWallet::new(l1_signer().await, l2_signer().await); + zk_wallet + .deposit_base_token(parse_ether("10").unwrap()) + .await + .unwrap(); let mut contract_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); contract_path.push("abi/test_contracts/storage_combined.json"); let contract: CompiledContract = From 1356be6b55c817924a835410cf4f30721288ebb3 Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Fri, 20 Sep 2024 17:08:30 -0300 Subject: [PATCH 75/75] add todo comment --- src/eip712/transaction_request.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/eip712/transaction_request.rs b/src/eip712/transaction_request.rs index 546f87f..616e569 100644 --- a/src/eip712/transaction_request.rs +++ b/src/eip712/transaction_request.rs @@ -317,6 +317,8 @@ impl TryFrom for Eip712TransactionRequest { factory_deps.push(request.contract_bytecode.clone()); factory_deps }) + // TODO CHECK THIS GAS_PER_PUBDATA + // IT IS NEEDED TO COMPLETE THE TX, but is not set dynamically .gas_per_pubdata(U256::from(50000_u32)); let contract_deployer = Abi::load(BufReader::new(