From 21d498af9e586db2c302ae10f68f3c9aa9fc4d8d Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 3 Oct 2024 14:40:57 +0300 Subject: [PATCH 01/32] Sketch test contracts --- core/tests/test_account/Cargo.toml | 4 +- core/tests/test_account/build.rs | 118 + .../complex-upgrade/complex-upgrade.sol | 112 + .../contracts/complex-upgrade/msg-sender.sol | 11 + .../contracts/context/context.sol | 47 + .../contracts/counter/counter.sol | 27 + .../contracts/counter/proxy_counter.sol | 26 + .../test_account/contracts/create/Foo.sol | 8 + .../test_account/contracts/create/create.sol | 17 + .../contracts/custom-account/Constants.sol | 37 + .../contracts/custom-account/RLPEncoder.sol | 100 + .../custom-account/SystemContext.sol | 67 + .../custom-account/SystemContractsCaller.sol | 266 ++ .../custom-account/TransactionHelper.sol | 467 ++++ .../contracts/custom-account/Utils.sol | 38 + .../custom-account/custom-account.sol | 106 + .../custom-account/custom-paymaster.sol | 81 + .../custom-account/interfaces/IAccount.sol | 47 + .../interfaces/IContractDeployer.sol | 110 + .../custom-account/interfaces/IERC20.sol | 82 + .../interfaces/INonceHolder.sol | 42 + .../custom-account/interfaces/IPaymaster.sol | 51 + .../interfaces/IPaymasterFlow.sol | 16 + .../many-owners-custom-account.sol | 151 ++ .../custom-account/nonce-holder-test.sol | 100 + .../test_account/contracts/error/error.sol | 22 + .../contracts/estimator/estimator.sol | 30 + .../test_account/contracts/events/events.sol | 15 + .../contracts/events/sample-calldata | Bin 0 -> 96 bytes .../contracts/expensive/expensive.sol | 21 + .../contracts/failed-call/failed_call.sol | 24 + .../contracts/infinite/infinite.sol | 19 + .../contracts/loadnext/loadnext_contract.sol | 56 + .../long-return-data/long-return-data.sol | 13 + .../contracts/precompiles/precompiles.sol | 39 + .../simple-transfer/simple-transfer.sol | 35 + .../contracts/storage/storage.sol | 103 + .../contracts/transfer/transfer.sol | 44 + core/tests/test_account/hardhat.config.ts | 36 + core/tests/test_account/package.json | 16 + core/tests/test_account/src/contracts.rs | 186 ++ core/tests/test_account/src/lib.rs | 22 +- core/tests/test_account/yarn.lock | 2310 +++++++++++++++++ 43 files changed, 5107 insertions(+), 15 deletions(-) create mode 100644 core/tests/test_account/build.rs create mode 100644 core/tests/test_account/contracts/complex-upgrade/complex-upgrade.sol create mode 100644 core/tests/test_account/contracts/complex-upgrade/msg-sender.sol create mode 100644 core/tests/test_account/contracts/context/context.sol create mode 100644 core/tests/test_account/contracts/counter/counter.sol create mode 100644 core/tests/test_account/contracts/counter/proxy_counter.sol create mode 100644 core/tests/test_account/contracts/create/Foo.sol create mode 100644 core/tests/test_account/contracts/create/create.sol create mode 100644 core/tests/test_account/contracts/custom-account/Constants.sol create mode 100644 core/tests/test_account/contracts/custom-account/RLPEncoder.sol create mode 100644 core/tests/test_account/contracts/custom-account/SystemContext.sol create mode 100644 core/tests/test_account/contracts/custom-account/SystemContractsCaller.sol create mode 100644 core/tests/test_account/contracts/custom-account/TransactionHelper.sol create mode 100644 core/tests/test_account/contracts/custom-account/Utils.sol create mode 100644 core/tests/test_account/contracts/custom-account/custom-account.sol create mode 100644 core/tests/test_account/contracts/custom-account/custom-paymaster.sol create mode 100644 core/tests/test_account/contracts/custom-account/interfaces/IAccount.sol create mode 100644 core/tests/test_account/contracts/custom-account/interfaces/IContractDeployer.sol create mode 100644 core/tests/test_account/contracts/custom-account/interfaces/IERC20.sol create mode 100644 core/tests/test_account/contracts/custom-account/interfaces/INonceHolder.sol create mode 100644 core/tests/test_account/contracts/custom-account/interfaces/IPaymaster.sol create mode 100644 core/tests/test_account/contracts/custom-account/interfaces/IPaymasterFlow.sol create mode 100644 core/tests/test_account/contracts/custom-account/many-owners-custom-account.sol create mode 100644 core/tests/test_account/contracts/custom-account/nonce-holder-test.sol create mode 100644 core/tests/test_account/contracts/error/error.sol create mode 100644 core/tests/test_account/contracts/estimator/estimator.sol create mode 100644 core/tests/test_account/contracts/events/events.sol create mode 100644 core/tests/test_account/contracts/events/sample-calldata create mode 100644 core/tests/test_account/contracts/expensive/expensive.sol create mode 100644 core/tests/test_account/contracts/failed-call/failed_call.sol create mode 100644 core/tests/test_account/contracts/infinite/infinite.sol create mode 100644 core/tests/test_account/contracts/loadnext/loadnext_contract.sol create mode 100644 core/tests/test_account/contracts/long-return-data/long-return-data.sol create mode 100644 core/tests/test_account/contracts/precompiles/precompiles.sol create mode 100644 core/tests/test_account/contracts/simple-transfer/simple-transfer.sol create mode 100644 core/tests/test_account/contracts/storage/storage.sol create mode 100644 core/tests/test_account/contracts/transfer/transfer.sol create mode 100644 core/tests/test_account/hardhat.config.ts create mode 100644 core/tests/test_account/package.json create mode 100644 core/tests/test_account/src/contracts.rs create mode 100644 core/tests/test_account/yarn.lock diff --git a/core/tests/test_account/Cargo.toml b/core/tests/test_account/Cargo.toml index 0dda4f8ac77..4bc62b16686 100644 --- a/core/tests/test_account/Cargo.toml +++ b/core/tests/test_account/Cargo.toml @@ -15,8 +15,10 @@ zksync_types.workspace = true zksync_system_constants.workspace = true zksync_utils.workspace = true zksync_eth_signer.workspace = true -zksync_contracts.workspace = true hex.workspace = true +once_cell.workspace = true ethabi.workspace = true rand.workspace = true +serde.workspace = true +serde_json.workspace = true diff --git a/core/tests/test_account/build.rs b/core/tests/test_account/build.rs new file mode 100644 index 00000000000..239c01ecd1d --- /dev/null +++ b/core/tests/test_account/build.rs @@ -0,0 +1,118 @@ +use std::{ + env, fs, + path::Path, + process::{Command, Output}, +}; + +fn assert_output_success(output: &Output, cmd: &str) { + if !output.status.success() { + let stdout = String::from_utf8_lossy(&output.stdout); + let stderr = String::from_utf8_lossy(&output.stderr); + panic!( + "`{cmd}` failed with {status}\n---- stdout ---- \n{stdout}\n---- stderr ----\n{stderr}", + status = output.status + ); + } +} + +fn check_yarn() { + let output = Command::new("yarn") + .arg("--version") + .output() + .expect("failed running `yarn --version`"); + assert_output_success(&output, "yarn --version"); + let yarn_version = output.stdout; + let yarn_version = String::from_utf8(yarn_version).expect("yarn version is not UFT-8"); + assert!( + yarn_version.starts_with("1."), + "Unsupported yarn version: {yarn_version}" + ); +} + +fn copy_recursively(src_dir: &Path, dest_dir: &Path) { + fs::create_dir_all(dest_dir).unwrap_or_else(|err| { + panic!( + "failed creating destination dir `{}`: {err}", + dest_dir.display() + ); + }); + for entry in fs::read_dir(src_dir).expect("failed reading source dir") { + let entry = entry.unwrap(); + let dest_path = dest_dir.join(entry.file_name()); + if entry.file_type().unwrap().is_dir() { + copy_recursively(&entry.path(), &dest_path); + } else { + fs::copy(entry.path(), &dest_path).unwrap_or_else(|err| { + panic!( + "failed copying `{}` to `{}`: {err}", + entry.path().display(), + dest_path.display() + ); + }); + } + } +} + +fn copy_contract_files(out_dir: &str) { + const COPIED_FILES: &[&str] = &["package.json", "yarn.lock", "hardhat.config.ts"]; + const COPIED_DIRS: &[&str] = &["contracts"]; + + let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("no `CARGO_MANIFEST_DIR` provided"); + + for &copied_file in COPIED_FILES { + let src = Path::new(&crate_dir).join(copied_file); + let dest = Path::new(&out_dir).join(copied_file); + + if fs::exists(&dest).unwrap_or(false) { + fs::remove_file(&dest).unwrap_or_else(|err| { + panic!("failed removing `{}`: {err}", dest.display()); + }); + } + fs::copy(&src, &dest).unwrap_or_else(|err| { + panic!("failed copying `{copied_file}`: {err}"); + }); + } + for &copied_dir in COPIED_DIRS { + let src = Path::new(&crate_dir).join(copied_dir); + let dest = Path::new(&out_dir).join(copied_dir); + + if fs::exists(&dest).unwrap_or(false) { + fs::remove_dir_all(&dest).unwrap_or_else(|err| { + panic!("failed removing `{}`: {err}", dest.display()); + }); + } + copy_recursively(&src, &dest); + } +} + +fn install_yarn_deps(working_dir: &str) { + let output = Command::new("yarn") + .current_dir(working_dir) + .args(["--non-interactive", "install"]) + .output() + .expect("failed running `yarn install`"); + assert_output_success(&output, "yarn install"); +} + +fn compile_contracts(working_dir: &str) { + let output = Command::new("yarn") + .current_dir(working_dir) + .args(["--non-interactive", "run", "build"]) + .output() + .expect("failed running `yarn run build`"); + assert_output_success(&output, "yarn run build"); +} + +fn main() { + check_yarn(); + + println!("cargo::rerun-if-changed=package.json"); + println!("cargo::rerun-if-changed=yarn.lock"); + println!("cargo::rerun-if-changed=hardhat.config.ts"); + println!("cargo::rerun-if-changed=contracts"); + + let temp_dir = env::var("OUT_DIR").expect("no `OUT_DIR` provided"); + copy_contract_files(&temp_dir); + install_yarn_deps(&temp_dir); + compile_contracts(&temp_dir); +} diff --git a/core/tests/test_account/contracts/complex-upgrade/complex-upgrade.sol b/core/tests/test_account/contracts/complex-upgrade/complex-upgrade.sol new file mode 100644 index 00000000000..e65f51d5652 --- /dev/null +++ b/core/tests/test_account/contracts/complex-upgrade/complex-upgrade.sol @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import {MIMIC_CALL_CALL_ADDRESS, SystemContractsCaller, CalldataForwardingMode} from "../custom-account/SystemContractsCaller.sol"; +import "../custom-account/interfaces/IContractDeployer.sol"; + +import { DEPLOYER_SYSTEM_CONTRACT, FORCE_DEPLOYER } from "../custom-account/Constants.sol"; +import "./msg-sender.sol"; + +contract ComplexUpgrade { + constructor() {} + + struct MimicCallInfo { + address to; + address whoToMimic; + bytes data; + } + + function _mimicCall(MimicCallInfo memory info) internal { + address callAddr = MIMIC_CALL_CALL_ADDRESS; + + bytes memory data = info.data; + address to = info.to; + address whoToMimic = info.whoToMimic; + + uint32 dataStart; + uint32 dataLength; + assembly { + dataStart := add(data, 0x20) + dataLength := mload(data) + } + + uint256 farCallAbi = SystemContractsCaller.getFarCallABI( + 0, + 0, + dataStart, + dataLength, + uint32(gasleft()), + // Only rollup is supported for now + 0, + CalldataForwardingMode.UseHeap, + false, + true + ); + + assembly { + let success := call(to, callAddr, 0, farCallAbi, whoToMimic, 0, 0) + + if iszero(success) { + returndatacopy(0, 0, returndatasize()) + revert(0, returndatasize()) + } + } + } + + function mimicCalls( + MimicCallInfo[] memory info + ) public { + for (uint256 i = 0; i < info.length; i++) { + _mimicCall(info[i]); + } + } + + // This function is used to imitate some complex upgrade logic + function someComplexUpgrade( + address _address1, + address _address2, + bytes32 _bytecodeHash + ) external { + IContractDeployer.ForceDeployment memory forceDeployment1 = IContractDeployer.ForceDeployment( + _bytecodeHash, + _address1, + false, + 0, + new bytes(0) + ); + + IContractDeployer.ForceDeployment memory forceDeployment2 = IContractDeployer.ForceDeployment( + _bytecodeHash, + _address2, + false, + 0, + new bytes(0) + ); + + IContractDeployer.ForceDeployment[] memory deploymentInput1 = new IContractDeployer.ForceDeployment[](1); + deploymentInput1[0] = forceDeployment1; + + IContractDeployer.ForceDeployment[] memory deploymentInput2 = new IContractDeployer.ForceDeployment[](1); + deploymentInput2[0] = forceDeployment2; + + DEPLOYER_SYSTEM_CONTRACT.forceDeployOnAddresses(deploymentInput1); + DEPLOYER_SYSTEM_CONTRACT.forceDeployOnAddresses(deploymentInput2); + + // Here we also test the fact that complex upgrade implementation can use mimicCall + MsgSenderTest msgSenderTest = new MsgSenderTest(); + address toMimic = address(0x1); + bytes memory _mimicCallCalldata = abi.encodeWithSelector( + MsgSenderTest.testMsgSender.selector, + toMimic + ); + + MimicCallInfo memory info = MimicCallInfo({ + to: address(msgSenderTest), + whoToMimic: toMimic, + data: _mimicCallCalldata + }); + + _mimicCall(info); + } +} diff --git a/core/tests/test_account/contracts/complex-upgrade/msg-sender.sol b/core/tests/test_account/contracts/complex-upgrade/msg-sender.sol new file mode 100644 index 00000000000..0388f2f5408 --- /dev/null +++ b/core/tests/test_account/contracts/complex-upgrade/msg-sender.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +contract MsgSenderTest { + function testMsgSender( + address _expectedSender + ) external view { + require(msg.sender == _expectedSender, "Wrong sender"); + } +} diff --git a/core/tests/test_account/contracts/context/context.sol b/core/tests/test_account/contracts/context/context.sol new file mode 100644 index 00000000000..94969ac66f9 --- /dev/null +++ b/core/tests/test_account/contracts/context/context.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: UNLICENSED + +pragma solidity ^0.8.0; + +contract Context { + function getBlockNumber() public view returns (uint256) { + return block.number; + } + + function getBlockTimestamp() public view returns (uint256) { + return block.timestamp; + } + + function getBlockGasLimit() public view returns (uint256) { + return block.gaslimit; + } + + function getTxGasPrice() public view returns (uint256) { + return tx.gasprice; + } + + function checkBlockNumber(uint256 fromBlockNumber, uint256 toBlockNumber) public { + require(fromBlockNumber <= block.number && block.number <= toBlockNumber, "block number is out of range"); + } + + function checkBlockTimestamp(uint256 fromTimestamp, uint256 toTimestamp) public { + require(fromTimestamp <= block.timestamp && block.timestamp <= toTimestamp, "block timestamp is out of range"); + } + + function checkTxOrigin(address expectedOrigin) public { + require(tx.origin == expectedOrigin, "tx.origin is invalid"); + } + + function getBaseFee() public view returns (uint256) { + return block.basefee; + } + + function requireMsgValue(uint256 _requiredValue) external payable { + require(msg.value == _requiredValue); + } + + uint256 public valueOnCreate; + + constructor() payable { + valueOnCreate = msg.value; + } +} diff --git a/core/tests/test_account/contracts/counter/counter.sol b/core/tests/test_account/contracts/counter/counter.sol new file mode 100644 index 00000000000..c0f4bda130d --- /dev/null +++ b/core/tests/test_account/contracts/counter/counter.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: UNLICENSED + +pragma solidity ^0.8.0; + +contract Counter { + uint256 value; + + function increment(uint256 x) external { + value += x; + } + + function incrementWithRevertPayable(uint256 x, bool shouldRevert) payable public returns (uint256) { + return incrementWithRevert(x, shouldRevert); + } + + function incrementWithRevert(uint256 x, bool shouldRevert) public returns (uint256) { + value += x; + if(shouldRevert) { + revert("This method always reverts"); + } + return value; + } + + function get() public view returns (uint256) { + return value; + } +} diff --git a/core/tests/test_account/contracts/counter/proxy_counter.sol b/core/tests/test_account/contracts/counter/proxy_counter.sol new file mode 100644 index 00000000000..b3bbf9dda93 --- /dev/null +++ b/core/tests/test_account/contracts/counter/proxy_counter.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +interface ICounter { + function increment(uint256 x) external; +} + +contract ProxyCounter { + ICounter counter; + + constructor(ICounter _counter) { + counter = _counter; + } + + uint256 lastFarCallCost; + + function increment(uint256 x, uint gasToPass) public { + while (gasleft() > gasToPass) { + // Burn gas so that there's about `gasToPass` left before the external call. + } + uint256 gasBefore = gasleft(); + counter.increment(x); + lastFarCallCost = gasBefore - gasleft(); + } +} diff --git a/core/tests/test_account/contracts/create/Foo.sol b/core/tests/test_account/contracts/create/Foo.sol new file mode 100644 index 00000000000..1ae4868e5bf --- /dev/null +++ b/core/tests/test_account/contracts/create/Foo.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.8.1; +pragma abicoder v2; + +contract Foo { + string public name = "Foo"; +} diff --git a/core/tests/test_account/contracts/create/create.sol b/core/tests/test_account/contracts/create/create.sol new file mode 100644 index 00000000000..ef03e7c457c --- /dev/null +++ b/core/tests/test_account/contracts/create/create.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.8.1; +pragma abicoder v2; + +// import Foo.sol from current directory +import "./Foo.sol"; + +contract Import { + // Initialize Foo.sol + Foo public foo = new Foo(); + + // Test Foo.sol by getting it's name. + function getFooName() public view returns (string memory) { + return foo.name(); + } +} \ No newline at end of file diff --git a/core/tests/test_account/contracts/custom-account/Constants.sol b/core/tests/test_account/contracts/custom-account/Constants.sol new file mode 100644 index 00000000000..59399d232ea --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/Constants.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import "./interfaces/INonceHolder.sol"; +import "./interfaces/IContractDeployer.sol"; +import "./SystemContext.sol"; + +uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15 + +address constant ECRECOVER_SYSTEM_CONTRACT = address(0x01); +address constant SHA256_SYSTEM_CONTRACT = address(0x02); + +address payable constant BOOTLOADER_FORMAL_ADDRESS = payable(address(SYSTEM_CONTRACTS_OFFSET + 0x01)); +INonceHolder constant NONCE_HOLDER_SYSTEM_CONTRACT = INonceHolder(address(SYSTEM_CONTRACTS_OFFSET + 0x03)); + +// A contract that is allowed to deploy any codehash +// on any address. To be used only during an upgrade. +address constant FORCE_DEPLOYER = address(SYSTEM_CONTRACTS_OFFSET + 0x07); +address constant MSG_VALUE_SYSTEM_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x09); +IContractDeployer constant DEPLOYER_SYSTEM_CONTRACT = IContractDeployer(address(SYSTEM_CONTRACTS_OFFSET + 0x06)); + + +address constant KECCAK256_SYSTEM_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x10); + +address constant BASE_TOKEN_SYSTEM_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x0a); +SystemContext constant SYSTEM_CONTEXT_CONTRACT = SystemContext(address(SYSTEM_CONTRACTS_OFFSET + 0x0b)); + +uint256 constant MAX_SYSTEM_CONTRACT_ADDRESS = 0xffff; + +bytes32 constant DEFAULT_ACCOUNT_CODE_HASH = 0x00; + +// The number of bytes that are published during the contract deployment +// in addition to the bytecode itself. +uint256 constant BYTECODE_PUBLISHING_OVERHEAD = 100; + +uint256 constant MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT = 2**128; diff --git a/core/tests/test_account/contracts/custom-account/RLPEncoder.sol b/core/tests/test_account/contracts/custom-account/RLPEncoder.sol new file mode 100644 index 00000000000..409f3d16b37 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/RLPEncoder.sol @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +library RLPEncoder { + function encodeAddress(address _val) internal pure returns (bytes memory encoded) { + // The size is equal to 14 bytes of the address itself + 1 for encoding bytes length in RLP. + encoded = new bytes(0x15); + + bytes20 shiftedVal = bytes20(_val); + assembly { + // In the first byte we write the encoded length as 0x80 + 0x14 == 0x94. + mstore(add(encoded, 0x20), 0x9400000000000000000000000000000000000000000000000000000000000000) + // Write address data without stripping zeros. + mstore(add(encoded, 0x21), shiftedVal) + } + } + + function encodeUint256(uint256 _val) internal pure returns (bytes memory encoded) { + unchecked { + if (_val < 128) { + encoded = new bytes(1); + // Handle zero as a non-value, since stripping zeroes results in an empty byte array + encoded[0] = (_val == 0) ? bytes1(uint8(128)) : bytes1(uint8(_val)); + } else { + uint256 hbs = _highestByteSet(_val); + + encoded = new bytes(hbs + 2); + encoded[0] = bytes1(uint8(hbs + 0x81)); + + uint256 lbs = 31 - hbs; + uint256 shiftedVal = _val << (lbs * 8); + + assembly { + mstore(add(encoded, 0x21), shiftedVal) + } + } + } + } + + /// @notice Encodes the size of bytes in RLP format. + /// NOTE: panics if the length is 1, since the length encoding is ambiguous in this case. + function encodeNonSingleBytesLen(uint256 _len) internal pure returns (bytes memory) { + assert(_len != 1); + return _encodeLength(_len, 0x80); + } + + /// @notice Encodes the size of list items in RLP format. + function encodeListLen(uint256 _len) internal pure returns (bytes memory) { + return _encodeLength(_len, 0xc0); + } + + function _encodeLength(uint256 _len, uint256 _offset) private pure returns (bytes memory encoded) { + unchecked { + if (_len < 56) { + encoded = new bytes(1); + encoded[0] = bytes1(uint8(_len + _offset)); + } else { + uint256 hbs = _highestByteSet(_len); + + encoded = new bytes(hbs + 2); + encoded[0] = bytes1(uint8(_offset + hbs + 56)); + + uint256 lbs = 31 - hbs; + uint256 shiftedVal = _len << (lbs * 8); + + assembly { + mstore(add(encoded, 0x21), shiftedVal) + } + } + } + } + + /// @notice Computes the index of the highest byte set in number. + /// @notice Uses little endian ordering (The least significant byte has index `0`). + /// NOTE: returns `0` for `0` + function _highestByteSet(uint256 _number) private pure returns (uint256 hbs) { + // TODO: for optimization, the comparison can be replaced with bitwise operations + // should be resolver after evaluating the cost of opcodes. + if (_number >= 2**128) { + _number >>= 128; + hbs += 16; + } + if (_number >= 2**64) { + _number >>= 64; + hbs += 8; + } + if (_number >= 2**32) { + _number >>= 32; + hbs += 4; + } + if (_number >= 2**16) { + _number >>= 16; + hbs += 2; + } + if (_number >= 2**8) { + hbs += 1; + } + } +} diff --git a/core/tests/test_account/contracts/custom-account/SystemContext.sol b/core/tests/test_account/contracts/custom-account/SystemContext.sol new file mode 100644 index 00000000000..dbf81002d51 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/SystemContext.sol @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import "./Constants.sol"; + +/** + * @author Matter Labs + * @notice Contract that stores some of the context variables, that may be either + * block-scoped, tx-scoped or system-wide. + */ +contract SystemContext { + modifier onlyBootloader { + require(msg.sender == BOOTLOADER_FORMAL_ADDRESS); + _; + } + + uint256 public chainId = 270; + address public origin; + uint256 public gasPrice; + // Some dummy value, maybe will be possible to change it in the future. + uint256 public blockGasLimit = (1 << 30); + // For the support of coinbase, we will the bootloader formal address for now + address public coinbase = BOOTLOADER_FORMAL_ADDRESS; + // For consistency with other L2s + uint256 public difficulty = 2500000000000000; + uint256 public msize = (1 << 24); + uint256 public baseFee; + + uint256 constant BLOCK_INFO_BLOCK_NUMBER_PART = (1<<128); + // 2^128 * block_number + block_timestamp + uint256 public currentBlockInfo; + + mapping(uint256 => bytes32) public blockHash; + + function setTxOrigin(address _newOrigin) external { + origin = _newOrigin; + } + + function setGasPrice(uint256 _gasPrice) external onlyBootloader { + gasPrice = _gasPrice; + } + + function getBlockHashEVM(uint256 _block) external view returns (bytes32 hash) { + if(block.number < _block || block.number - _block > 256) { + hash = bytes32(0); + } else { + hash = blockHash[_block]; + } + } + + function getBlockNumberAndTimestamp() public view returns (uint256 blockNumber, uint256 blockTimestamp) { + uint256 blockInfo = currentBlockInfo; + blockNumber = blockInfo / BLOCK_INFO_BLOCK_NUMBER_PART; + blockTimestamp = blockInfo % BLOCK_INFO_BLOCK_NUMBER_PART; + } + + // Note, that for now, the implementation of the bootloader allows this variables to + // be incremented multiple times inside a block, so it should not relied upon right now. + function getBlockNumber() public view returns (uint256 blockNumber) { + (blockNumber, ) = getBlockNumberAndTimestamp(); + } + + function getBlockTimestamp() public view returns (uint256 timestamp) { + (, timestamp) = getBlockNumberAndTimestamp(); + } +} diff --git a/core/tests/test_account/contracts/custom-account/SystemContractsCaller.sol b/core/tests/test_account/contracts/custom-account/SystemContractsCaller.sol new file mode 100644 index 00000000000..3ec2b81a107 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/SystemContractsCaller.sol @@ -0,0 +1,266 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8; + +import {MSG_VALUE_SYSTEM_CONTRACT, MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT} from "./Constants.sol"; +import "./Utils.sol"; + +// Addresses used for the compiler to be replaced with the +// ZKsync-specific opcodes during the compilation. +// IMPORTANT: these are just compile-time constants and are used +// only if used in-place by Yul optimizer. +address constant TO_L1_CALL_ADDRESS = address((1 << 16) - 1); +address constant CODE_ADDRESS_CALL_ADDRESS = address((1 << 16) - 2); +address constant PRECOMPILE_CALL_ADDRESS = address((1 << 16) - 3); +address constant META_CALL_ADDRESS = address((1 << 16) - 4); +address constant MIMIC_CALL_CALL_ADDRESS = address((1 << 16) - 5); +address constant SYSTEM_MIMIC_CALL_CALL_ADDRESS = address((1 << 16) - 6); +address constant MIMIC_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 7); +address constant SYSTEM_MIMIC_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 8); +address constant RAW_FAR_CALL_CALL_ADDRESS = address((1 << 16) - 9); +address constant RAW_FAR_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 10); +address constant SYSTEM_CALL_CALL_ADDRESS = address((1 << 16) - 11); +address constant SYSTEM_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 12); +address constant SET_CONTEXT_VALUE_CALL_ADDRESS = address((1 << 16) - 13); +address constant SET_PUBDATA_PRICE_CALL_ADDRESS = address((1 << 16) - 14); +address constant INCREMENT_TX_COUNTER_CALL_ADDRESS = address((1 << 16) - 15); +address constant PTR_CALLDATA_CALL_ADDRESS = address((1 << 16) - 16); +address constant CALLFLAGS_CALL_ADDRESS = address((1 << 16) - 17); +address constant PTR_RETURNDATA_CALL_ADDRESS = address((1 << 16) - 18); +address constant EVENT_INITIALIZE_ADDRESS = address((1 << 16) - 19); +address constant EVENT_WRITE_ADDRESS = address((1 << 16) - 20); +address constant LOAD_CALLDATA_INTO_ACTIVE_PTR_CALL_ADDRESS = address((1 << 16) - 21); +address constant LOAD_LATEST_RETURNDATA_INTO_ACTIVE_PTR_CALL_ADDRESS = address((1 << 16) - 22); +address constant PTR_ADD_INTO_ACTIVE_CALL_ADDRESS = address((1 << 16) - 23); +address constant PTR_SHRINK_INTO_ACTIVE_CALL_ADDRESS = address((1 << 16) - 24); +address constant PTR_PACK_INTO_ACTIVE_CALL_ADDRESS = address((1 << 16) - 25); +address constant MULTIPLICATION_HIGH_ADDRESS = address((1 << 16) - 26); +address constant GET_EXTRA_ABI_DATA_ADDRESS = address((1 << 16) - 27); + +// All the offsets are in bits +uint256 constant META_GAS_PER_PUBDATA_BYTE_OFFSET = 0 * 8; +uint256 constant META_HEAP_SIZE_OFFSET = 8 * 8; +uint256 constant META_AUX_HEAP_SIZE_OFFSET = 12 * 8; +uint256 constant META_SHARD_ID_OFFSET = 28 * 8; +uint256 constant META_CALLER_SHARD_ID_OFFSET = 29 * 8; +uint256 constant META_CODE_SHARD_ID_OFFSET = 30 * 8; + +/// @notice The way to forward the calldata: +/// - Use the current heap (i.e. the same as on EVM). +/// - Use the auxiliary heap. +/// - Forward via a pointer +/// @dev Note, that currently, users do not have access to the auxiliary +/// heap and so the only type of forwarding that will be used by the users +/// are UseHeap and ForwardFatPointer for forwarding a slice of the current calldata +/// to the next call. +enum CalldataForwardingMode { + UseHeap, + ForwardFatPointer, + UseAuxHeap +} + +/** + * @author Matter Labs + * @notice A library that allows calling contracts with the `isSystem` flag. + * @dev It is needed to call ContractDeployer and NonceHolder. + */ +library SystemContractsCaller { + /// @notice Makes a call with the `isSystem` flag. + /// @param gasLimit The gas limit for the call. + /// @param to The address to call. + /// @param value The value to pass with the transaction. + /// @param data The calldata. + /// @return success Whether the transaction has been successful. + /// @dev Note, that the `isSystem` flag can only be set when calling system contracts. + function systemCall(uint32 gasLimit, address to, uint256 value, bytes memory data) internal returns (bool success) { + address callAddr = SYSTEM_CALL_CALL_ADDRESS; + + uint32 dataStart; + assembly { + dataStart := add(data, 0x20) + } + uint32 dataLength = uint32(Utils.safeCastToU32(data.length)); + + uint256 farCallAbi = SystemContractsCaller.getFarCallABI( + 0, + 0, + dataStart, + dataLength, + gasLimit, + // Only rollup is supported for now + 0, + CalldataForwardingMode.UseHeap, + false, + true + ); + + if (value == 0) { + // Doing the system call directly + assembly { + success := call(to, callAddr, 0, 0, farCallAbi, 0, 0) + } + } else { + address msgValueSimulator = MSG_VALUE_SYSTEM_CONTRACT; + // We need to supply the mask to the MsgValueSimulator to denote + // that the call should be a system one. + uint256 forwardMask = MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT; + + assembly { + success := call(msgValueSimulator, callAddr, value, to, farCallAbi, forwardMask, 0) + } + } + } + + /// @notice Makes a call with the `isSystem` flag. + /// @param gasLimit The gas limit for the call. + /// @param to The address to call. + /// @param value The value to pass with the transaction. + /// @param data The calldata. + /// @return success Whether the transaction has been successful. + /// @return returnData The returndata of the transaction (revert reason in case the transaction has failed). + /// @dev Note, that the `isSystem` flag can only be set when calling system contracts. + function systemCallWithReturndata( + uint32 gasLimit, + address to, + uint128 value, + bytes memory data + ) internal returns (bool success, bytes memory returnData) { + success = systemCall(gasLimit, to, value, data); + + uint256 size; + assembly { + size := returndatasize() + } + + returnData = new bytes(size); + assembly { + returndatacopy(add(returnData, 0x20), 0, size) + } + } + + /// @notice Makes a call with the `isSystem` flag. + /// @param gasLimit The gas limit for the call. + /// @param to The address to call. + /// @param value The value to pass with the transaction. + /// @param data The calldata. + /// @return returnData The returndata of the transaction. In case the transaction reverts, the error + /// bubbles up to the parent frame. + /// @dev Note, that the `isSystem` flag can only be set when calling system contracts. + function systemCallWithPropagatedRevert( + uint32 gasLimit, + address to, + uint128 value, + bytes memory data + ) internal returns (bytes memory returnData) { + bool success; + (success, returnData) = systemCallWithReturndata(gasLimit, to, value, data); + + if (!success) { + assembly { + let size := mload(returnData) + revert(add(returnData, 0x20), size) + } + } + } + + /// @notice Calculates the packed representation of the FarCallABI. + /// @param dataOffset Calldata offset in memory. Provide 0 unless using custom pointer. + /// @param memoryPage Memory page to use. Provide 0 unless using custom pointer. + /// @param dataStart The start of the calldata slice. Provide the offset in memory + /// if not using custom pointer. + /// @param dataLength The calldata length. Provide the length of the calldata in bytes + /// unless using custom pointer. + /// @param gasPassed The gas to pass with the call. + /// @param shardId Of the account to call. Currently only 0 is supported. + /// @param forwardingMode The forwarding mode to use: + /// - provide CalldataForwardingMode.UseHeap when using your current memory + /// - provide CalldataForwardingMode.ForwardFatPointer when using custom pointer. + /// @param isConstructorCall Whether the call will be a call to the constructor + /// (ignored when the caller is not a system contract). + /// @param isSystemCall Whether the call will have the `isSystem` flag. + /// @return farCallAbi The far call ABI. + /// @dev The `FarCallABI` has the following structure: + /// pub struct FarCallABI { + /// pub memory_quasi_fat_pointer: FatPointer, + /// pub gas_passed: u32, + /// pub shard_id: u8, + /// pub forwarding_mode: FarCallForwardPageType, + /// pub constructor_call: bool, + /// pub to_system: bool, + /// } + /// + /// The FatPointer struct: + /// + /// pub struct FatPointer { + /// pub offset: u32, // offset relative to `start` + /// pub memory_page: u32, // memory page where slice is located + /// pub start: u32, // absolute start of the slice + /// pub length: u32, // length of the slice + /// } + /// + /// @dev Note, that the actual layout is the following: + /// + /// [0..32) bits -- the calldata offset + /// [32..64) bits -- the memory page to use. Can be left blank in most of the cases. + /// [64..96) bits -- the absolute start of the slice + /// [96..128) bits -- the length of the slice. + /// [128..192) bits -- empty bits. + /// [192..224) bits -- gasPassed. + /// [224..232) bits -- forwarding_mode + /// [232..240) bits -- shard id. + /// [240..248) bits -- constructor call flag + /// [248..256] bits -- system call flag + function getFarCallABI( + uint32 dataOffset, + uint32 memoryPage, + uint32 dataStart, + uint32 dataLength, + uint32 gasPassed, + uint8 shardId, + CalldataForwardingMode forwardingMode, + bool isConstructorCall, + bool isSystemCall + ) internal pure returns (uint256 farCallAbi) { + // Fill in the call parameter fields + farCallAbi = getFarCallABIWithEmptyFatPointer( + gasPassed, + shardId, + forwardingMode, + isConstructorCall, + isSystemCall + ); + // Fill in the fat pointer fields + farCallAbi |= dataOffset; + farCallAbi |= (uint256(memoryPage) << 32); + farCallAbi |= (uint256(dataStart) << 64); + farCallAbi |= (uint256(dataLength) << 96); + } + + /// @notice Calculates the packed representation of the FarCallABI with zero fat pointer fields. + /// @param gasPassed The gas to pass with the call. + /// @param shardId Of the account to call. Currently only 0 is supported. + /// @param forwardingMode The forwarding mode to use: + /// - provide CalldataForwardingMode.UseHeap when using your current memory + /// - provide CalldataForwardingMode.ForwardFatPointer when using custom pointer. + /// @param isConstructorCall Whether the call will be a call to the constructor + /// (ignored when the caller is not a system contract). + /// @param isSystemCall Whether the call will have the `isSystem` flag. + /// @return farCallAbiWithEmptyFatPtr The far call ABI with zero fat pointer fields. + function getFarCallABIWithEmptyFatPointer( + uint32 gasPassed, + uint8 shardId, + CalldataForwardingMode forwardingMode, + bool isConstructorCall, + bool isSystemCall + ) internal pure returns (uint256 farCallAbiWithEmptyFatPtr) { + farCallAbiWithEmptyFatPtr |= (uint256(gasPassed) << 192); + farCallAbiWithEmptyFatPtr |= (uint256(forwardingMode) << 224); + farCallAbiWithEmptyFatPtr |= (uint256(shardId) << 232); + if (isConstructorCall) { + farCallAbiWithEmptyFatPtr |= (1 << 240); + } + if (isSystemCall) { + farCallAbiWithEmptyFatPtr |= (1 << 248); + } + } +} diff --git a/core/tests/test_account/contracts/custom-account/TransactionHelper.sol b/core/tests/test_account/contracts/custom-account/TransactionHelper.sol new file mode 100644 index 00000000000..82747b88d35 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/TransactionHelper.sol @@ -0,0 +1,467 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; + +import "./interfaces/IPaymasterFlow.sol"; +import "./interfaces/IContractDeployer.sol"; +import {BASE_TOKEN_SYSTEM_CONTRACT, BOOTLOADER_FORMAL_ADDRESS} from "./Constants.sol"; +import "./RLPEncoder.sol"; + +/// @dev The type id of ZKsync's EIP-712-signed transaction. +uint8 constant EIP_712_TX_TYPE = 0x71; + +/// @dev The type id of legacy transactions. +uint8 constant LEGACY_TX_TYPE = 0x0; +/// @dev The type id of legacy transactions. +uint8 constant EIP_2930_TX_TYPE = 0x01; +/// @dev The type id of EIP1559 transactions. +uint8 constant EIP_1559_TX_TYPE = 0x02; + +/// @notice Structure used to represent ZKsync transaction. +struct Transaction { + // The type of the transaction. + uint256 txType; + // The caller. + uint256 from; + // The callee. + uint256 to; + // The gasLimit to pass with the transaction. + // It has the same meaning as Ethereum's gasLimit. + uint256 gasLimit; + // The maximum amount of gas the user is willing to pay for a byte of pubdata. + uint256 gasPerPubdataByteLimit; + // The maximum fee per gas that the user is willing to pay. + // It is akin to EIP1559's maxFeePerGas. + uint256 maxFeePerGas; + // The maximum priority fee per gas that the user is willing to pay. + // It is akin to EIP1559's maxPriorityFeePerGas. + uint256 maxPriorityFeePerGas; + // The transaction's paymaster. If there is no paymaster, it is equal to 0. + uint256 paymaster; + // The nonce of the transaction. + uint256 nonce; + // The value to pass with the transaction. + uint256 value; + // In the future, we might want to add some + // new fields to the struct. The `txData` struct + // is to be passed to account and any changes to its structure + // would mean a breaking change to these accounts. In order to prevent this, + // we should keep some fields as "reserved". + // It is also recommended that their length is fixed, since + // it would allow easier proof integration (in case we will need + // some special circuit for preprocessing transactions). + uint256[4] reserved; + // The transaction's calldata. + bytes data; + // The signature of the transaction. + bytes signature; + // The properly formatted hashes of bytecodes that must be published on L1 + // with the inclusion of this transaction. Note, that a bytecode has been published + // before, the user won't pay fees for its republishing. + bytes32[] factoryDeps; + // The input to the paymaster. + bytes paymasterInput; + // Reserved dynamic type for the future use-case. Using it should be avoided, + // But it is still here, just in case we want to enable some additional functionality. + bytes reservedDynamic; +} + +/** + * @author Matter Labs + * @notice Library is used to help custom accounts to work with common methods for the Transaction type. + */ +library TransactionHelper { + using SafeERC20 for IERC20; + + /// @notice The EIP-712 typehash for the contract's domain + bytes32 constant EIP712_DOMAIN_TYPEHASH = + keccak256("EIP712Domain(string name,string version,uint256 chainId)"); + + bytes32 constant EIP712_TRANSACTION_TYPE_HASH = + keccak256( + "Transaction(uint256 txType,uint256 from,uint256 to,uint256 gasLimit,uint256 gasPerPubdataByteLimit,uint256 maxFeePerGas,uint256 maxPriorityFeePerGas,uint256 paymaster,uint256 nonce,uint256 value,bytes data,bytes32[] factoryDeps,bytes paymasterInput)" + ); + + /// @notice Whether the token is Ethereum. + /// @param _addr The address of the token + /// @return `true` or `false` based on whether the token is Ether. + /// @dev This method assumes that address is Ether either if the address is 0 (for convenience) + /// or if the address is the address of the L2BaseToken system contract. + function isEthToken(uint256 _addr) internal pure returns (bool) { + return + _addr == uint256(uint160(address(BASE_TOKEN_SYSTEM_CONTRACT))) || + _addr == 0; + } + + /// @notice Calculate the suggested signed hash of the transaction, + /// i.e. the hash that is signed by EOAs and is recommended to be signed by other accounts. + function encodeHash(Transaction calldata _transaction) + internal + view + returns (bytes32 resultHash) + { + if (_transaction.txType == LEGACY_TX_TYPE) { + resultHash = _encodeHashLegacyTransaction(_transaction); + } else if (_transaction.txType == EIP_712_TX_TYPE) { + resultHash = _encodeHashEIP712Transaction(_transaction); + } else if (_transaction.txType == EIP_1559_TX_TYPE) { + resultHash = _encodeHashEIP1559Transaction(_transaction); + } else if (_transaction.txType == EIP_2930_TX_TYPE) { + resultHash = _encodeHashEIP2930Transaction(_transaction); + } else { + // Currently no other transaction types are supported. + // Any new transaction types will be processed in a similar manner. + revert("Encoding unsupported tx"); + } + } + + /// @notice Encode hash of the ZKsync native transaction type. + /// @return keccak256 hash of the EIP-712 encoded representation of transaction + function _encodeHashEIP712Transaction(Transaction calldata _transaction) + private + view + returns (bytes32) + { + bytes32 structHash = keccak256( + abi.encode( + EIP712_TRANSACTION_TYPE_HASH, + _transaction.txType, + _transaction.from, + _transaction.to, + _transaction.gasLimit, + _transaction.gasPerPubdataByteLimit, + _transaction.maxFeePerGas, + _transaction.maxPriorityFeePerGas, + _transaction.paymaster, + _transaction.nonce, + _transaction.value, + keccak256(_transaction.data), + keccak256(abi.encodePacked(_transaction.factoryDeps)), + keccak256(_transaction.paymasterInput) + ) + ); + + bytes32 domainSeparator = keccak256( + abi.encode( + EIP712_DOMAIN_TYPEHASH, + keccak256("zkSync"), + keccak256("2"), + block.chainid + ) + ); + + return + keccak256( + abi.encodePacked("\x19\x01", domainSeparator, structHash) + ); + } + + /// @notice Encode hash of the legacy transaction type. + /// @return keccak256 of the serialized RLP encoded representation of transaction + function _encodeHashLegacyTransaction(Transaction calldata _transaction) + private + view + returns (bytes32) + { + // Hash of legacy transactions are encoded as one of the: + // - RLP(nonce, gasPrice, gasLimit, to, value, data, chainId, 0, 0) + // - RLP(nonce, gasPrice, gasLimit, to, value, data) + // + // In this RLP encoding, only the first one above list appears, so we encode each element + // inside list and then concatenate the length of all elements with them. + + bytes memory encodedNonce = RLPEncoder.encodeUint256(_transaction.nonce); + // Encode `gasPrice` and `gasLimit` together to prevent "stack too deep error". + bytes memory encodedGasParam; + { + bytes memory encodedGasPrice = RLPEncoder.encodeUint256( + _transaction.maxFeePerGas + ); + bytes memory encodedGasLimit = RLPEncoder.encodeUint256( + _transaction.gasLimit + ); + encodedGasParam = bytes.concat(encodedGasPrice, encodedGasLimit); + } + + bytes memory encodedTo = RLPEncoder.encodeAddress(address(uint160(_transaction.to))); + bytes memory encodedValue = RLPEncoder.encodeUint256(_transaction.value); + // Encode only the length of the transaction data, and not the data itself, + // so as not to copy to memory a potentially huge transaction data twice. + bytes memory encodedDataLength; + { + // Safe cast, because the length of the transaction data can't be so large. + uint64 txDataLen = uint64(_transaction.data.length); + if (txDataLen != 1) { + // If the length is not equal to one, then only using the length can it be encoded definitely. + encodedDataLength = RLPEncoder.encodeNonSingleBytesLen( + txDataLen + ); + } else if (_transaction.data[0] >= 0x80) { + // If input is a byte in [0x80, 0xff] range, RLP encoding will concatenates 0x81 with the byte. + encodedDataLength = hex"81"; + } + // Otherwise the length is not encoded at all. + } + + // Encode `chainId` according to EIP-155, but only if the `chainId` is specified in the transaction. + bytes memory encodedChainId; + if (_transaction.reserved[0] != 0) { + encodedChainId = bytes.concat(RLPEncoder.encodeUint256(block.chainid), hex"80_80"); + } + + bytes memory encodedListLength; + unchecked { + uint256 listLength = encodedNonce.length + + encodedGasParam.length + + encodedTo.length + + encodedValue.length + + encodedDataLength.length + + _transaction.data.length + + encodedChainId.length; + + // Safe cast, because the length of the list can't be so large. + encodedListLength = RLPEncoder.encodeListLen(uint64(listLength)); + } + + return + keccak256( + bytes.concat( + encodedListLength, + encodedNonce, + encodedGasParam, + encodedTo, + encodedValue, + encodedDataLength, + _transaction.data, + encodedChainId + ) + ); + } + + /// @notice Encode hash of the EIP2930 transaction type. + /// @return keccak256 of the serialized RLP encoded representation of transaction + function _encodeHashEIP2930Transaction(Transaction calldata _transaction) + private + view + returns (bytes32) + { + // Hash of EIP2930 transactions is encoded the following way: + // H(0x01 || RLP(chain_id, nonce, gas_price, gas_limit, destination, amount, data, access_list)) + // + // Note, that on ZKsync access lists are not supported and should always be empty. + + // Encode all fixed-length params to avoid "stack too deep error" + bytes memory encodedFixedLengthParams; + { + bytes memory encodedChainId = RLPEncoder.encodeUint256(block.chainid); + bytes memory encodedNonce = RLPEncoder.encodeUint256(_transaction.nonce); + bytes memory encodedGasPrice = RLPEncoder.encodeUint256(_transaction.maxFeePerGas); + bytes memory encodedGasLimit = RLPEncoder.encodeUint256(_transaction.gasLimit); + bytes memory encodedTo = RLPEncoder.encodeAddress(address(uint160(_transaction.to))); + bytes memory encodedValue = RLPEncoder.encodeUint256(_transaction.value); + encodedFixedLengthParams = bytes.concat( + encodedChainId, + encodedNonce, + encodedGasPrice, + encodedGasLimit, + encodedTo, + encodedValue + ); + } + + // Encode only the length of the transaction data, and not the data itself, + // so as not to copy to memory a potentially huge transaction data twice. + bytes memory encodedDataLength; + { + // Safe cast, because the length of the transaction data can't be so large. + uint64 txDataLen = uint64(_transaction.data.length); + if (txDataLen != 1) { + // If the length is not equal to one, then only using the length can it be encoded definitely. + encodedDataLength = RLPEncoder.encodeNonSingleBytesLen( + txDataLen + ); + } else if (_transaction.data[0] >= 0x80) { + // If input is a byte in [0x80, 0xff] range, RLP encoding will concatenates 0x81 with the byte. + encodedDataLength = hex"81"; + } + // Otherwise the length is not encoded at all. + } + + // On ZKsync, access lists are always zero length (at least for now). + bytes memory encodedAccessListLength = RLPEncoder.encodeListLen(0); + + bytes memory encodedListLength; + unchecked { + uint256 listLength = encodedFixedLengthParams.length + + encodedDataLength.length + + _transaction.data.length + + encodedAccessListLength.length; + + // Safe cast, because the length of the list can't be so large. + encodedListLength = RLPEncoder.encodeListLen(uint64(listLength)); + } + + return + keccak256( + bytes.concat( + "\x01", + encodedListLength, + encodedFixedLengthParams, + encodedDataLength, + _transaction.data, + encodedAccessListLength + ) + ); + } + + /// @notice Encode hash of the EIP1559 transaction type. + /// @return keccak256 of the serialized RLP encoded representation of transaction + function _encodeHashEIP1559Transaction(Transaction calldata _transaction) + private + view + returns (bytes32) + { + // Hash of EIP1559 transactions is encoded the following way: + // H(0x02 || RLP(chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list)) + // + // Note, that on ZKsync access lists are not supported and should always be empty. + + // Encode all fixed-length params to avoid "stack too deep error" + bytes memory encodedFixedLengthParams; + { + bytes memory encodedChainId = RLPEncoder.encodeUint256(block.chainid); + bytes memory encodedNonce = RLPEncoder.encodeUint256(_transaction.nonce); + bytes memory encodedMaxPriorityFeePerGas = RLPEncoder.encodeUint256(_transaction.maxPriorityFeePerGas); + bytes memory encodedMaxFeePerGas = RLPEncoder.encodeUint256(_transaction.maxFeePerGas); + bytes memory encodedGasLimit = RLPEncoder.encodeUint256(_transaction.gasLimit); + bytes memory encodedTo = RLPEncoder.encodeAddress(address(uint160(_transaction.to))); + bytes memory encodedValue = RLPEncoder.encodeUint256(_transaction.value); + encodedFixedLengthParams = bytes.concat( + encodedChainId, + encodedNonce, + encodedMaxPriorityFeePerGas, + encodedMaxFeePerGas, + encodedGasLimit, + encodedTo, + encodedValue + ); + } + + // Encode only the length of the transaction data, and not the data itself, + // so as not to copy to memory a potentially huge transaction data twice. + bytes memory encodedDataLength; + { + // Safe cast, because the length of the transaction data can't be so large. + uint64 txDataLen = uint64(_transaction.data.length); + if (txDataLen != 1) { + // If the length is not equal to one, then only using the length can it be encoded definitely. + encodedDataLength = RLPEncoder.encodeNonSingleBytesLen( + txDataLen + ); + } else if (_transaction.data[0] >= 0x80) { + // If input is a byte in [0x80, 0xff] range, RLP encoding will concatenates 0x81 with the byte. + encodedDataLength = hex"81"; + } + // Otherwise the length is not encoded at all. + } + + // On ZKsync, access lists are always zero length (at least for now). + bytes memory encodedAccessListLength = RLPEncoder.encodeListLen(0); + + bytes memory encodedListLength; + unchecked { + uint256 listLength = encodedFixedLengthParams.length + + encodedDataLength.length + + _transaction.data.length + + encodedAccessListLength.length; + + // Safe cast, because the length of the list can't be so large. + encodedListLength = RLPEncoder.encodeListLen(uint64(listLength)); + } + + return + keccak256( + bytes.concat( + "\x02", + encodedListLength, + encodedFixedLengthParams, + encodedDataLength, + _transaction.data, + encodedAccessListLength + ) + ); + } + + /// @notice Processes the common paymaster flows, e.g. setting proper allowance + /// for tokens, etc. For more information on the expected behavior, check out + /// the "Paymaster flows" section in the documentation. + function processPaymasterInput(Transaction calldata _transaction) internal { + require( + _transaction.paymasterInput.length >= 4, + "The standard paymaster input must be at least 4 bytes long" + ); + + bytes4 paymasterInputSelector = bytes4( + _transaction.paymasterInput[0:4] + ); + if (paymasterInputSelector == IPaymasterFlow.approvalBased.selector) { + require( + _transaction.paymasterInput.length >= 68, + "The approvalBased paymaster input must be at least 68 bytes long" + ); + + // While the actual data consists of address, uint256 and bytes data, + // the data is needed only for the paymaster, so we ignore it here for the sake of optimization + (address token, uint256 minAllowance) = abi.decode( + _transaction.paymasterInput[4:68], + (address, uint256) + ); + address paymaster = address(uint160(_transaction.paymaster)); + + uint256 currentAllowance = IERC20(token).allowance( + address(this), + paymaster + ); + if (currentAllowance < minAllowance) { + // Some tokens, e.g. USDT require that the allowance is firsty set to zero + // and only then updated to the new value. + + IERC20(token).safeApprove(paymaster, 0); + IERC20(token).safeApprove(paymaster, minAllowance); + } + } else if (paymasterInputSelector == IPaymasterFlow.general.selector) { + // Do nothing. general(bytes) paymaster flow means that the paymaster must interpret these bytes on his own. + } else { + revert("Unsupported paymaster flow"); + } + } + + /// @notice Pays the required fee for the transaction to the bootloader. + /// @dev Currently it pays the maximum amount "_transaction.maxFeePerGas * _transaction.gasLimit", + /// it will change in the future. + function payToTheBootloader(Transaction calldata _transaction) + internal + returns (bool success) + { + address bootloaderAddr = BOOTLOADER_FORMAL_ADDRESS; + uint256 amount = _transaction.maxFeePerGas * _transaction.gasLimit; + + assembly { + success := call(gas(), bootloaderAddr, amount, 0, 0, 0, 0) + } + } + + // Returns the balance required to process the transaction. + function totalRequiredBalance(Transaction calldata _transaction) internal pure returns (uint256 requiredBalance) { + if(address(uint160(_transaction.paymaster)) != address(0)) { + // Paymaster pays for the fee + requiredBalance = _transaction.value; + } else { + // The user should have enough balance for both the fee and the value of the transaction + requiredBalance = _transaction.maxFeePerGas * _transaction.gasLimit + _transaction.value; + } + } +} diff --git a/core/tests/test_account/contracts/custom-account/Utils.sol b/core/tests/test_account/contracts/custom-account/Utils.sol new file mode 100644 index 00000000000..e562948942d --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/Utils.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +pragma solidity >=0.8.0; + +/** + * @author Matter Labs + * @dev Common utilities used in ZKsync system contracts + */ +library Utils { + function safeCastToU128(uint256 _x) internal pure returns (uint128) { + require(_x <= type(uint128).max, "Overflow"); + + return uint128(_x); + } + + function safeCastToU32(uint256 _x) internal pure returns (uint32) { + require(_x <= type(uint32).max, "Overflow"); + + return uint32(_x); + } + + function safeCastToU24(uint256 _x) internal pure returns (uint24) { + require(_x <= type(uint24).max, "Overflow"); + + return uint24(_x); + } + + /// @return codeLength The bytecode length in bytes + function bytecodeLenInBytes(bytes32 _bytecodeHash) internal pure returns (uint256 codeLength) { + codeLength = bytecodeLenInWords(_bytecodeHash) << 5; // _bytecodeHash * 32 + } + + /// @return codeLengthInWords The bytecode length in machine words + function bytecodeLenInWords(bytes32 _bytecodeHash) internal pure returns (uint256 codeLengthInWords) { + unchecked { + codeLengthInWords = uint256(uint8(_bytecodeHash[2])) * 256 + uint256(uint8(_bytecodeHash[3])); + } + } +} diff --git a/core/tests/test_account/contracts/custom-account/custom-account.sol b/core/tests/test_account/contracts/custom-account/custom-account.sol new file mode 100644 index 00000000000..7601f5cd7b8 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/custom-account.sol @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import './Constants.sol'; +import './TransactionHelper.sol'; + +import './SystemContractsCaller.sol'; + +import './interfaces/IAccount.sol'; + +contract CustomAccount is IAccount { + using TransactionHelper for Transaction; + + bool public violateValidationRules; + + bytes32 public lastTxHash; + + constructor(bool _violateValidationRules) { + violateValidationRules = _violateValidationRules; + } + + // bytes4(keccak256("isValidSignature(bytes32,bytes)") + bytes4 constant EIP1271_SUCCESS_RETURN_VALUE = 0x1626ba7e; + + function validateTransaction(bytes32 _txHash, bytes32 _suggestedSignedTxHash, Transaction calldata _transaction) external payable override returns (bytes4 magic) { + // By default we consider the transaction as successful + magic = VALIDATION_SUCCESS_MAGIC; + + _validateTransaction(_suggestedSignedTxHash, _transaction); + lastTxHash = _txHash; + + if (violateValidationRules) { + // Such a tx should not pass the validation step, because it depends on the balance of another account + require(BOOTLOADER_FORMAL_ADDRESS.balance == 0, "Bootloader balance must be zero"); + } + } + + function _validateTransaction(bytes32 _suggestedSignedTxHash, Transaction calldata _transaction) internal { + if (_suggestedSignedTxHash == bytes32(0)) { + _suggestedSignedTxHash = _transaction.encodeHash(); + } + + SystemContractsCaller.systemCallWithPropagatedRevert( + uint32(gasleft()), + address(NONCE_HOLDER_SYSTEM_CONTRACT), + 0, + abi.encodeCall(INonceHolder.incrementMinNonceIfEquals, (_transaction.nonce)) + ); + + bytes memory correctSignature = abi.encodePacked(_suggestedSignedTxHash, address(this)); + require(keccak256(_transaction.signature) == keccak256(correctSignature), "Incorrect signature"); + } + + function executeTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable override { + _execute(_transaction); + } + + function executeTransactionFromOutside(Transaction calldata _transaction) external payable override { + _validateTransaction(bytes32(0), _transaction); + _execute(_transaction); + } + + function _execute(Transaction calldata _transaction) internal { + address to = address(uint160(_transaction.to)); + uint256 value = _transaction.reserved[1]; + bytes memory data = _transaction.data; + + if(to == address(DEPLOYER_SYSTEM_CONTRACT)) { + // We allow calling ContractDeployer with any calldata + SystemContractsCaller.systemCallWithPropagatedRevert( + uint32(gasleft()), + to, + uint128(_transaction.reserved[1]), // By convention, reserved[1] is `value` + _transaction.data + ); + } else { + bool success; + assembly { + success := call(gas(), to, value, add(data, 0x20), mload(data), 0, 0) + } + require(success); + } + } + + // Here, the user pays the bootloader for the transaction + function payForTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable { + bool success = _transaction.payToTheBootloader(); + require(success, "Failed to pay the fee to the operator"); + } + + // Here, the user should prepare for the transaction to be paid for by a paymaster + // Here, the account should set the allowance for the smart contracts + function prepareForPaymaster(bytes32, bytes32, Transaction calldata _transaction) external payable { + _transaction.processPaymasterInput(); + } + + fallback() external payable { + // fallback of default AA shouldn't be called by bootloader under no circumstances + assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS); + + // If the contract is called directly, behave like an EOA + } + + receive() external payable {} +} diff --git a/core/tests/test_account/contracts/custom-account/custom-paymaster.sol b/core/tests/test_account/contracts/custom-account/custom-paymaster.sol new file mode 100644 index 00000000000..af9fec30f7d --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/custom-paymaster.sol @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "./interfaces/IPaymaster.sol"; +import "./interfaces/IPaymasterFlow.sol"; +import "./TransactionHelper.sol"; +import "./Constants.sol"; + +// This is a dummy paymaster. It expects the paymasterInput to contain its "signature" as well as the needed exchange rate. +// It supports only approval-based paymaster flow. +contract CustomPaymaster is IPaymaster { + using TransactionHelper for Transaction; + + uint256 public txCounter = 0; + mapping(uint256 => bool) public calledContext; + uint256 public wasAnytime = 0; + + bytes32 lastTxHash = 0; + + function validateSignature(bytes memory _signature) internal pure { + // For the purpose of this test, any signature of length 46 is fine. + require(_signature.length == 46); + } + + function validateAndPayForPaymasterTransaction(bytes32 _txHash, bytes32, Transaction calldata _transaction) override external payable returns (bytes4 magic, bytes memory context) { + // By default we consider the transaction as passed + magic = PAYMASTER_VALIDATION_SUCCESS_MAGIC; + + lastTxHash = _txHash; + require(_transaction.paymasterInput.length >= 4, "The standard paymaster input must be at least 4 bytes long"); + + bytes4 paymasterInputSelector = bytes4(_transaction.paymasterInput[0:4]); + if (paymasterInputSelector == IPaymasterFlow.approvalBased.selector) { + // While the actual data consists of address, uint256 and bytes data, + // the data is needed only for the paymaster, so we ignore it here for the sake of optimization + (address token,, bytes memory input) = abi.decode(_transaction.paymasterInput[4:], (address, uint256, bytes)); + + (bytes memory pseudoSignature, uint256 rateNumerator, uint256 rateDenominator, uint256 amount) = abi.decode(input, (bytes, uint256, uint256, uint256)); + validateSignature(pseudoSignature); + + // Firstly, we verify that the user has provided enough allowance + address userAddress = address(uint160(_transaction.from)); + address thisAddress = address(this); + + uint256 providedAllowance = IERC20(token).allowance(userAddress, thisAddress); + require(providedAllowance >= amount, "The user did not provide enough allowance"); + + uint256 requiredETH = _transaction.gasLimit * _transaction.maxFeePerGas; + uint256 ethExchnaged = amount * rateNumerator / rateDenominator; + + require(ethExchnaged >= requiredETH, "User does not provide enough tokens to exchange"); + + // Pulling all the tokens from the user + IERC20(token).transferFrom(userAddress, thisAddress, amount); + bool success = _transaction.payToTheBootloader(); + require(success, "Failed to transfer funds to the bootloader"); + + // For now, refunds are not supported, so we just test the fact that the transferred context is correct + txCounter += 1; + context = abi.encode(txCounter); + } else { + revert("Unsupported paymaster flow"); + } + } + + function postTransaction( + bytes calldata _context, + Transaction calldata, + bytes32 _txHash, + bytes32, + ExecutionResult, + uint256 + ) override external payable { + require(_txHash == lastTxHash, "Incorrect last tx hash"); + uint256 contextCounter = abi.decode(_context, (uint256)); + calledContext[contextCounter] = true; + } + + receive() external payable {} +} diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IAccount.sol b/core/tests/test_account/contracts/custom-account/interfaces/IAccount.sol new file mode 100644 index 00000000000..521ae96d413 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/interfaces/IAccount.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import "../TransactionHelper.sol"; + +bytes4 constant VALIDATION_SUCCESS_MAGIC = IAccount.validateTransaction.selector; + +interface IAccount { + /// @notice Called by the bootloader to validate that an account agrees to process the transaction + /// (and potentially pay for it). + /// @param _txHash The hash of the transaction to be used in the explorer + /// @param _suggestedSignedHash The hash of the transaction is signed by EOAs + /// @param _transaction The transaction itself + /// @return magic The magic value that should be equal to the signature of this function + /// if the user agrees to proceed with the transaction. + /// @dev The developer should strive to preserve as many steps as possible both for valid + /// and invalid transactions as this very method is also used during the gas fee estimation + /// (without some of the necessary data, e.g. signature). + function validateTransaction( + bytes32 _txHash, + bytes32 _suggestedSignedHash, + Transaction calldata _transaction + ) external payable returns (bytes4 magic); + + function executeTransaction( + bytes32 _txHash, + bytes32 _suggestedSignedHash, + Transaction calldata _transaction + ) external payable; + + // There is no point in providing possible signed hash in the `executeTransactionFromOutside` method, + // since it typically should not be trusted. + function executeTransactionFromOutside(Transaction calldata _transaction) external payable; + + function payForTransaction( + bytes32 _txHash, + bytes32 _suggestedSignedHash, + Transaction calldata _transaction + ) external payable; + + function prepareForPaymaster( + bytes32 _txHash, + bytes32 _possibleSignedHash, + Transaction calldata _transaction + ) external payable; +} diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IContractDeployer.sol b/core/tests/test_account/contracts/custom-account/interfaces/IContractDeployer.sol new file mode 100644 index 00000000000..f9a6db8c467 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/interfaces/IContractDeployer.sol @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +interface IContractDeployer { + /// @notice Defines the version of the account abstraction protocol + /// that a contract claims to follow. + /// - `None` means that the account is just a contract and it should never be interacted + /// with as a custom account + /// - `Version1` means that the account follows the first version of the account abstraction protocol + enum AccountAbstractionVersion { + None, + Version1 + } + + /// @notice Defines the nonce ordering used by the account + /// - `Sequential` means that it is expected that the nonces are monotonic and increment by 1 + /// at a time (the same as EOAs). + /// - `Arbitrary` means that the nonces for the accounts can be arbitrary. The operator + /// should serve the transactions from such an account on a first-come-first-serve basis. + /// @dev This ordering is more of a suggestion to the operator on how the AA expects its transactions + /// to be processed and is not considered as a system invariant. + enum AccountNonceOrdering { + Sequential, + Arbitrary + } + + struct AccountInfo { + AccountAbstractionVersion supportedAAVersion; + AccountNonceOrdering nonceOrdering; + } + + event ContractDeployed( + address indexed deployerAddress, + bytes32 indexed bytecodeHash, + address indexed contractAddress + ); + + function getNewAddressCreate2( + address _sender, + bytes32 _bytecodeHash, + bytes32 _salt, + bytes calldata _input + ) external pure returns (address newAddress); + + function getNewAddressCreate(address _sender, uint256 _senderNonce) external pure returns (address newAddress); + + function create2( + bytes32 _salt, + bytes32 _bytecodeHash, + bytes calldata _input + ) external payable returns (address newAddress); + + function create2Account( + bytes32 _salt, + bytes32 _bytecodeHash, + bytes calldata _input, + AccountAbstractionVersion _aaVersion + ) external payable returns (address newAddress); + + /// @dev While the `_salt` parameter is not used anywhere here, + /// it is still needed for consistency between `create` and + /// `create2` functions (required by the compiler). + function create( + bytes32 _salt, + bytes32 _bytecodeHash, + bytes calldata _input + ) external payable returns (address newAddress); + + /// @dev While `_salt` is never used here, we leave it here as a parameter + /// for the consistency with the `create` function. + function createAccount( + bytes32 _salt, + bytes32 _bytecodeHash, + bytes calldata _input, + AccountAbstractionVersion _aaVersion + ) external payable returns (address newAddress); + + /// @notice Returns the information about a certain AA. + function getAccountInfo( + address _address + ) external view returns (AccountInfo memory info); + + /// @notice Can be called by an account to update its account version + function updateAccountVersion(AccountAbstractionVersion _version) external; + + /// @notice Can be called by an account to update its nonce ordering + function updateNonceOrdering(AccountNonceOrdering _nonceOrdering) external; + + /// @notice A struct that describes a forced deployment on an address + struct ForceDeployment { + // The bytecode hash to put on an address + bytes32 bytecodeHash; + // The address on which to deploy the bytecodehash to + address newAddress; + // Whether to call the constructor or not + bool callConstructor; + // The value with which to initialize a contract + uint256 value; + // The constructor calldata + bytes input; + } + + /// @notice This method is to be used only during an upgrade to set a bytecode on any address. + /// @dev We do not require `onlySystemCall` here, since the method is accessible only + /// by `FORCE_DEPLOYER`. + function forceDeployOnAddresses( + ForceDeployment[] calldata _deployments + ) external payable; +} diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IERC20.sol b/core/tests/test_account/contracts/custom-account/interfaces/IERC20.sol new file mode 100644 index 00000000000..b816bfed086 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/interfaces/IERC20.sol @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) + +pragma solidity ^0.8.0; + +/** + * @dev Interface of the ERC20 standard as defined in the EIP. + */ +interface IERC20 { + /** + * @dev Emitted when `value` tokens are moved from one account (`from`) to + * another (`to`). + * + * Note that `value` may be zero. + */ + event Transfer(address indexed from, address indexed to, uint256 value); + + /** + * @dev Emitted when the allowance of a `spender` for an `owner` is set by + * a call to {approve}. `value` is the new allowance. + */ + event Approval(address indexed owner, address indexed spender, uint256 value); + + /** + * @dev Returns the amount of tokens in existence. + */ + function totalSupply() external view returns (uint256); + + /** + * @dev Returns the amount of tokens owned by `account`. + */ + function balanceOf(address account) external view returns (uint256); + + /** + * @dev Moves `amount` tokens from the caller's account to `to`. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transfer(address to, uint256 amount) external returns (bool); + + /** + * @dev Returns the remaining number of tokens that `spender` will be + * allowed to spend on behalf of `owner` through {transferFrom}. This is + * zero by default. + * + * This value changes when {approve} or {transferFrom} are called. + */ + function allowance(address owner, address spender) external view returns (uint256); + + /** + * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * IMPORTANT: Beware that changing an allowance with this method brings the risk + * that someone may use both the old and the new allowance by unfortunate + * transaction ordering. One possible solution to mitigate this race + * condition is to first reduce the spender's allowance to 0 and set the + * desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * + * Emits an {Approval} event. + */ + function approve(address spender, uint256 amount) external returns (bool); + + /** + * @dev Moves `amount` tokens from `from` to `to` using the + * allowance mechanism. `amount` is then deducted from the caller's + * allowance. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool); +} diff --git a/core/tests/test_account/contracts/custom-account/interfaces/INonceHolder.sol b/core/tests/test_account/contracts/custom-account/interfaces/INonceHolder.sol new file mode 100644 index 00000000000..18ac4702326 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/interfaces/INonceHolder.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +/** + * @author Matter Labs + * @dev Interface of the nonce holder contract -- a contract used by the system to ensure + * that there is always a unique identifier for a transaction with a particular account (we call it nonce). + * In other words, the pair of (address, nonce) should always be unique. + * @dev Custom accounts should use methods of this contract to store nonces or other possible unique identifiers + * for the transaction. + */ +interface INonceHolder { + /// @dev Returns the current minimal nonce for account. + function getMinNonce(address _address) external view returns (uint256); + + /// @dev Returns the raw version of the current minimal nonce + /// (equal to minNonce + 2^128 * deployment nonce). + function getRawNonce(address _address) external view returns (uint256); + + /// @dev Increases the minimal nonce for the msg.sender. + function increaseMinNonce(uint256 _value) external returns (uint256); + + /// @dev Sets the nonce value `key` as used. + function setValueUnderNonce(uint256 _key, uint256 _value) external; + + /// @dev Gets the value stored inside a custom nonce. + function getValueUnderNonce(uint256 _key) external view returns (uint256); + + /// @dev A convenience method to increment the minimal nonce if it is equal + /// to the `_expectedNonce`. + function incrementMinNonceIfEquals(uint256 _expectedNonce) external; + + /// @dev Returns the deployment nonce for the accounts used for CREATE opcode. + function getDeploymentNonce(address _address) external view returns (uint256); + + /// @dev Increments the deployment nonce for the account and returns the previous one. + function incrementDeploymentNonce(address _address) external returns (uint256); + + /// @dev Determines whether a certain nonce has been already used for an account. + function validateNonceUsage(address _address, uint256 _key, bool _shouldBeUsed) external view; +} diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IPaymaster.sol b/core/tests/test_account/contracts/custom-account/interfaces/IPaymaster.sol new file mode 100644 index 00000000000..1bd5b81f32b --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/interfaces/IPaymaster.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import "../TransactionHelper.sol"; + +enum ExecutionResult { + Revert, + Success +} + +bytes4 constant PAYMASTER_VALIDATION_SUCCESS_MAGIC = IPaymaster.validateAndPayForPaymasterTransaction.selector; + +interface IPaymaster { + /// @dev Called by the bootloader to verify that the paymaster agrees to pay for the + /// fee for the transaction. This transaction should also send the necessary amount of funds onto the bootloader + /// address. + /// @param _txHash The hash of the transaction + /// @param _suggestedSignedHash The hash of the transaction that is signed by an EOA + /// @param _transaction The transaction itself. + /// @return magic The value that should be equal to the signature of the validateAndPayForPaymasterTransaction + /// if the paymaster agrees to pay for the transaction. + /// @return context The "context" of the transaction: an array of bytes of length at most 1024 bytes, which will be + /// passed to the `postTransaction` method of the account. + /// @dev The developer should strive to preserve as many steps as possible both for valid + /// and invalid transactions as this very method is also used during the gas fee estimation + /// (without some of the necessary data, e.g. signature). + function validateAndPayForPaymasterTransaction( + bytes32 _txHash, + bytes32 _suggestedSignedHash, + Transaction calldata _transaction + ) external payable returns (bytes4 magic, bytes memory context); + + /// @dev Called by the bootloader after the execution of the transaction. Please note that + /// there is no guarantee that this method will be called at all. Unlike the original EIP4337, + /// this method won't be called if the transaction execution results in out-of-gas. + /// @param _context, the context of the execution, returned by the "validateAndPayForPaymasterTransaction" method. + /// @param _transaction, the users' transaction. + /// @param _txResult, the result of the transaction execution (success or failure). + /// @param _maxRefundedGas, the upper bound on the amount of gas that could be refunded to the paymaster. + /// @dev The exact amount refunded depends on the gas spent by the "postOp" itself and so the developers should + /// take that into account. + function postTransaction( + bytes calldata _context, + Transaction calldata _transaction, + bytes32 _txHash, + bytes32 _suggestedSignedHash, + ExecutionResult _txResult, + uint256 _maxRefundedGas + ) external payable; +} diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IPaymasterFlow.sol b/core/tests/test_account/contracts/custom-account/interfaces/IPaymasterFlow.sol new file mode 100644 index 00000000000..97bd9507929 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/interfaces/IPaymasterFlow.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +/** + * @author Matter Labs + * @dev The interface that is used for encoding/decoding of + * different types of paymaster flows. + * @notice This is NOT an interface to be implementated + * by contracts. It is just used for encoding. + */ +interface IPaymasterFlow { + function general(bytes calldata input) external; + + function approvalBased(address _token, uint256 _minAllowance, bytes calldata _innerInput) external; +} diff --git a/core/tests/test_account/contracts/custom-account/many-owners-custom-account.sol b/core/tests/test_account/contracts/custom-account/many-owners-custom-account.sol new file mode 100644 index 00000000000..e4d01207235 --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/many-owners-custom-account.sol @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +// Example custom account contract, that allows any of the selected owners to act on its behalf. +// This contract is for UNITTESTS ONLY. Do NOT use in production. +pragma solidity ^0.8.0; + +import "./Constants.sol"; +import "./TransactionHelper.sol"; + +import "./SystemContractsCaller.sol"; + +import "./interfaces/IAccount.sol"; + +contract ManyOwnersCustomAccount is IAccount { + using TransactionHelper for Transaction; + + address[] public owners; + + // Sets the current owners. + // This is NOT safe, this contract is for unittests ONLY. + function setOwners(address[] memory _owners) external { + owners = _owners; + } + + // bytes4(keccak256("isValidSignature(bytes32,bytes)") + bytes4 constant EIP1271_SUCCESS_RETURN_VALUE = 0x1626ba7e; + + function validateTransaction( + bytes32, + bytes32 _suggestedSignedTxHash, + Transaction calldata _transaction + ) external payable override returns (bytes4 magic) { + // By default we consider the transaction as successful + magic = VALIDATION_SUCCESS_MAGIC; + + _validateTransaction(_suggestedSignedTxHash, _transaction); + } + + function _validateTransaction( + bytes32 _suggestedSignedTxHash, + Transaction calldata _transaction + ) internal { + if (_suggestedSignedTxHash == bytes32(0)) { + _suggestedSignedTxHash = _transaction.encodeHash(); + } + + SystemContractsCaller.systemCallWithPropagatedRevert( + uint32(gasleft()), + address(NONCE_HOLDER_SYSTEM_CONTRACT), + 0, + abi.encodeCall( + INonceHolder.incrementMinNonceIfEquals, + (_transaction.nonce) + ) + ); + + bytes memory _signature = _transaction.signature; + + uint8 v; + bytes32 r; + bytes32 s; + // Signature loading code + // we jump 32 (0x20) as the first slot of bytes contains the length + // we jump 65 (0x41) per signature + // for v we load 32 bytes ending with v (the first 31 come from s) then apply a mask + assembly { + r := mload(add(_signature, 0x20)) + s := mload(add(_signature, 0x40)) + v := and(mload(add(_signature, 0x41)), 0xff) + } + require(v == 27 || v == 28, "v is neither 27 nor 28"); + require( + uint256(s) <= + 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, + "Invalid s" + ); + + address recoveredAddress = ecrecover(_suggestedSignedTxHash, v, r, s); + + for (uint i = 0; i < owners.length; i++) { + if (recoveredAddress == owners[i]) { + return; + } + } + revert("Invalid signature"); + } + + function executeTransaction( + bytes32, + bytes32, + Transaction calldata _transaction + ) external payable override { + _execute(_transaction); + } + + function executeTransactionFromOutside( + Transaction calldata _transaction + ) external payable override { + _validateTransaction(bytes32(0), _transaction); + _execute(_transaction); + } + + function _execute(Transaction calldata _transaction) internal { + address to = address(uint160(_transaction.to)); + uint256 value = _transaction.value; + + bytes memory data = _transaction.data; + bool success; + assembly { + success := call( + gas(), + to, + value, + add(data, 0x20), + mload(data), + 0, + 0 + ) + } + require(success); + } + + // Here, the user pays the bootloader for the transaction + function payForTransaction( + bytes32, + bytes32, + Transaction calldata _transaction + ) external payable { + bool success = _transaction.payToTheBootloader(); + require(success, "Failed to pay the fee to the operator"); + } + + // Here, the user should prepare for the transaction to be paid for by a paymaster + // Here, the account should set the allowance for the smart contracts + function prepareForPaymaster( + bytes32, + bytes32, + Transaction calldata _transaction + ) external payable { + _transaction.processPaymasterInput(); + } + + fallback() external payable { + // fallback of default AA shouldn't be called by bootloader under no circumstances + assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS); + + // If the contract is called directly, behave like an EOA + } + + receive() external payable {} +} diff --git a/core/tests/test_account/contracts/custom-account/nonce-holder-test.sol b/core/tests/test_account/contracts/custom-account/nonce-holder-test.sol new file mode 100644 index 00000000000..5e276eab3af --- /dev/null +++ b/core/tests/test_account/contracts/custom-account/nonce-holder-test.sol @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import './Constants.sol'; +import './TransactionHelper.sol'; + +import './interfaces/IAccount.sol'; +import './interfaces/IContractDeployer.sol'; + +import './SystemContractsCaller.sol'; + +/** +* @author Matter Labs +* @dev Dummy account used for tests that accepts any transaction. +*/ +contract NonceHolderTest is IAccount { + using TransactionHelper for Transaction; + + // bytes4(keccak256("isValidSignature(bytes32,bytes)") + bytes4 constant EIP1271_SUCCESS_RETURN_VALUE = 0x1626ba7e; + + function validateTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable override returns (bytes4 magic) { + // By default we consider the transaction as successful + magic = VALIDATION_SUCCESS_MAGIC; + + _validateTransaction(_transaction); + } + + function _validateTransaction(Transaction calldata _transaction) internal { + bytes memory data; + + if (uint8(_transaction.signature[0]) == 0) { + // It only erases nonce as non-allowed + data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.setValueUnderNonce, (_transaction.nonce, 1)); + } else if(uint8(_transaction.signature[0]) == 1) { + // It should increase minimal nonce by 5 + data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.increaseMinNonce, (5)); + } else if(uint8(_transaction.signature[0]) == 2) { + // It should try increasing nnonce by 2**90 + data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.increaseMinNonce, (2**90)); + } else if (uint8(_transaction.signature[0]) == 3) { + // Do nothing + return; + } else if(uint8(_transaction.signature[0]) == 4) { + // It should increase minimal nonce by 1 + data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.increaseMinNonce, (1)); + } else if (uint8(_transaction.signature[0]) == 5) { + // Increase minimal nonce by 5 and set the nonce ordering of the account as arbitrary + data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.increaseMinNonce, (5)); + SystemContractsCaller.systemCallWithPropagatedRevert( + uint32(gasleft()), + address(DEPLOYER_SYSTEM_CONTRACT), + 0, + abi.encodeCall(DEPLOYER_SYSTEM_CONTRACT.updateNonceOrdering, (IContractDeployer.AccountNonceOrdering.Arbitrary)) + ); + } else { + revert("Unsupported test"); + } + + SystemContractsCaller.systemCallWithPropagatedRevert( + uint32(gasleft()), + address(NONCE_HOLDER_SYSTEM_CONTRACT), + 0, + data + ); + } + + function executeTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable override { + _execute(_transaction); + } + + function executeTransactionFromOutside(Transaction calldata _transaction) external payable override { + _validateTransaction(_transaction); + _execute(_transaction); + } + + function _execute(Transaction calldata _transaction) internal {} + + // Here, the user pays the bootloader for the transaction + function payForTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable override { + bool success = _transaction.payToTheBootloader(); + require(success, "Failed to pay the fee to the operator"); + } + + // Here, the user should prepare for the transaction to be paid for by a paymaster + // Here, the account should set the allowance for the smart contracts + function prepareForPaymaster(bytes32, bytes32, Transaction calldata _transaction) external payable override { + _transaction.processPaymasterInput(); + } + + fallback() external payable { + // fallback of default AA shouldn't be called by bootloader under no circumstances + assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS); + + // If the contract is called directly, behave like an EOA + } + + receive() external payable {} +} diff --git a/core/tests/test_account/contracts/error/error.sol b/core/tests/test_account/contracts/error/error.sol new file mode 100644 index 00000000000..ba8085c2665 --- /dev/null +++ b/core/tests/test_account/contracts/error/error.sol @@ -0,0 +1,22 @@ +pragma solidity ^0.8.0; + +// SPDX-License-Identifier: MIT OR Apache-2.0 + +contract SimpleRequire { + error TestError(uint256 one, uint256 two, uint256 three, string data); + + function new_error() public pure { + revert TestError({one: 1, two: 2, three: 1, data: "data"}); + } + + function require_short() public pure { + require(false, "short"); + } + + function require_long() public pure { + require( + false, + 'longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong' + ); + } +} diff --git a/core/tests/test_account/contracts/estimator/estimator.sol b/core/tests/test_account/contracts/estimator/estimator.sol new file mode 100644 index 00000000000..7fc7dfffc64 --- /dev/null +++ b/core/tests/test_account/contracts/estimator/estimator.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: UNLICENSED + +// This contract is used to estimate the protocol properties +// related to the fee calculation, such as block capacity +// and different operations costs. + +pragma solidity ^0.8.0; + +// Copied from `contracts/zksync/contracts/L2ContractHelper.sol`. +interface IL2Messenger { + function sendToL1(bytes memory _message) external returns (bytes32); +} + +uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15 +IL2Messenger constant L2_MESSENGER = IL2Messenger(address(SYSTEM_CONTRACTS_OFFSET + 0x08)); + +// TODO: Should be set to the actual value (SMA-1185). +// Represents the maximum amount of L2->L1 messages that can happen in one block. +uint256 constant MAX_L2_L1_MESSAGES_IN_BLOCK = 256; + +contract Estimator { + function estimateBlockCapacity() public { + // Block capacity is defined by several parameters, but the "cheapest" way to seal the block + // is to send a limited amount of messages to the L1. + // Here we're going to do just it. + for (uint256 i = 0; i < MAX_L2_L1_MESSAGES_IN_BLOCK; i++) { + L2_MESSENGER.sendToL1(bytes("")); + } + } +} diff --git a/core/tests/test_account/contracts/events/events.sol b/core/tests/test_account/contracts/events/events.sol new file mode 100644 index 00000000000..93a451d5469 --- /dev/null +++ b/core/tests/test_account/contracts/events/events.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +contract Emitter { + event Trivial(); + event Simple(uint256 Number, address Account); + event Indexed(uint256 indexed Number, address Account); + + function test(uint256 number) public { + emit Trivial(); + emit Simple(number, address(0xdeadbeef)); + emit Indexed(number, address(0xc0ffee)); + } +} diff --git a/core/tests/test_account/contracts/events/sample-calldata b/core/tests/test_account/contracts/events/sample-calldata new file mode 100644 index 0000000000000000000000000000000000000000..c137101ba026010f41d872325c4d53eab9d99a27 GIT binary patch literal 96 UcmY#kARn;Lf2oO2HzQCI07%#Y-T(jq literal 0 HcmV?d00001 diff --git a/core/tests/test_account/contracts/expensive/expensive.sol b/core/tests/test_account/contracts/expensive/expensive.sol new file mode 100644 index 00000000000..27e18b6eb6c --- /dev/null +++ b/core/tests/test_account/contracts/expensive/expensive.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; +pragma abicoder v2; + +contract Expensive { + uint[] array; + + function expensive(uint iterations) public returns (bytes32) { + for (uint i = 0; i < iterations; i++) { + array.push(i); + } + return keccak256(abi.encodePacked(array)); + } + + function cleanUp() public { + for (uint i = 0; i < array.length; i++) { + array[i] = 0; + } + } +} diff --git a/core/tests/test_account/contracts/failed-call/failed_call.sol b/core/tests/test_account/contracts/failed-call/failed_call.sol new file mode 100644 index 00000000000..7a8f43fbd89 --- /dev/null +++ b/core/tests/test_account/contracts/failed-call/failed_call.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +contract FailedCall { + bool public success; + bytes1 public data_first_byte; + + constructor() { + address MSG_VALUE_SIMULATOR = 0x0000000000000000000000000000000000008009; + + while (gasleft() > 20000) { + // Burn gas so that there's about 20k left before the external call. + } + + // This call fails because MSG_VALUE_SIMULATOR forcibly takes 27k gas + (bool s, bytes memory data) = MSG_VALUE_SIMULATOR.call( + abi.encodeWithSignature("deadBeef()") + ); + + success = s; + data_first_byte = data[0]; + } +} diff --git a/core/tests/test_account/contracts/infinite/infinite.sol b/core/tests/test_account/contracts/infinite/infinite.sol new file mode 100644 index 00000000000..3ed4e035f60 --- /dev/null +++ b/core/tests/test_account/contracts/infinite/infinite.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; +pragma abicoder v2; + +contract InfiniteLoop { + event Iteration(uint256 number); + + function infiniteLoop() public { + uint256 x = 0; + + while (true) { + x += 1; + // This event is needed so that LLVM + // won't optimize the loop away. + emit Iteration(x); + } + } +} diff --git a/core/tests/test_account/contracts/loadnext/loadnext_contract.sol b/core/tests/test_account/contracts/loadnext/loadnext_contract.sol new file mode 100644 index 00000000000..b14286a4503 --- /dev/null +++ b/core/tests/test_account/contracts/loadnext/loadnext_contract.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; +pragma abicoder v2; + +contract LoadnextContract { + event Event(uint val); + uint[] readArray; + uint[] writeArray; + + constructor (uint reads) { + for (uint i = 0; i < reads; i++) { + readArray.push(i); + } + } + + function execute(uint reads, uint writes, uint hashes, uint events, uint max_recursion, uint deploys) external returns(uint) { + if (max_recursion > 0) { + return this.execute(reads, writes, hashes, events, max_recursion - 1, deploys); + } + + uint sum = 0; + + // Somehow use result of storage read for compiler to not optimize this place. + for (uint i = 0; i < reads; i++) { + sum += readArray[i]; + } + + for (uint i = 0; i < writes; i++) { + writeArray.push(i); + } + + for (uint i = 0; i < events; i++) { + emit Event(i); + } + + // Somehow use result of keccak for compiler to not optimize this place. + for (uint i = 0; i < hashes; i++) { + sum += uint8(keccak256(abi.encodePacked("Message for encoding"))[0]); + } + + for (uint i = 0; i < deploys; i++) { + Foo foo = new Foo(); + } + return sum; + } + + function burnGas(uint256 gasToBurn) external { + uint256 initialGas = gasleft(); + while(initialGas - gasleft() < gasToBurn) {} + } +} + +contract Foo { + string public name = "Foo"; +} diff --git a/core/tests/test_account/contracts/long-return-data/long-return-data.sol b/core/tests/test_account/contracts/long-return-data/long-return-data.sol new file mode 100644 index 00000000000..793bf191cbd --- /dev/null +++ b/core/tests/test_account/contracts/long-return-data/long-return-data.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +contract LongReturnData{ + function longReturnData() external returns (bool, bytes memory) { + // do some recursion, let's have more layers + (bool success, bytes memory _tmp) = this.longReturnData{gas: 79500000}(); + require(success == false); // they should fail by design + assembly { + return(0, 0xffffffffffffffff) + } + } +} diff --git a/core/tests/test_account/contracts/precompiles/precompiles.sol b/core/tests/test_account/contracts/precompiles/precompiles.sol new file mode 100644 index 00000000000..7ba10166275 --- /dev/null +++ b/core/tests/test_account/contracts/precompiles/precompiles.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: UNLICENSED + +pragma solidity ^0.8.0; + +address constant CODE_ORACLE_ADDR = 0x0000000000000000000000000000000000008012; + +contract Precompiles { + function doKeccak(uint256 iters) public pure returns (uint256) { + uint256 sum = 0; + for (uint256 i = 0; i < iters; i += 1) { + sum += uint(keccak256(abi.encode(i))) % 256; + } + return sum; + } + + function doSha256(uint256 iters) public pure returns (uint256) { + uint256 sum = 0; + for (uint256 i = 0; i < iters; i += 1) { + sum += uint(sha256(abi.encode(i))) % 256; + } + return sum; + } + + uint256 lastCodeOracleCost; + function callCodeOracle(bytes32 _versionedHash, bytes32 _expectedBytecodeHash) public { + uint256 gasBefore = gasleft(); + + // Call the code oracle + (bool success, bytes memory returnedBytecode) = CODE_ORACLE_ADDR.staticcall(abi.encodePacked(_versionedHash)); + + lastCodeOracleCost = gasBefore - gasleft(); + + // Check the result + require(success, "CodeOracle call failed"); + + // Check the returned bytecode + require(keccak256(returnedBytecode) == _expectedBytecodeHash, "Returned bytecode does not match the expected hash"); + } +} diff --git a/core/tests/test_account/contracts/simple-transfer/simple-transfer.sol b/core/tests/test_account/contracts/simple-transfer/simple-transfer.sol new file mode 100644 index 00000000000..591e97cc1ae --- /dev/null +++ b/core/tests/test_account/contracts/simple-transfer/simple-transfer.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract SimpleTransfer { + address public owner; + + constructor() { + owner = msg.sender; // Set the contract creator as the owner + } + + // This function allows the contract to receive Ether with msg.data being empty + receive() external payable {} + + modifier onlyOwner() { + require(msg.sender == owner, "Only the owner can execute this."); + _; + } + + // Function to withdraw Ether to the owner's address + function withdraw(uint _amount) public onlyOwner { + require(address(this).balance >= _amount, "Insufficient balance in contract"); + payable(owner).transfer(_amount); + } + + // Function to transfer Ether from this contract to any address + function transfer(address _to, uint _amount) public onlyOwner { + require(address(this).balance >= _amount, "Insufficient balance in contract"); + payable(_to).transfer(_amount); + } + + // Function to check the contract's balance + function getBalance() public view returns (uint) { + return address(this).balance; + } +} diff --git a/core/tests/test_account/contracts/storage/storage.sol b/core/tests/test_account/contracts/storage/storage.sol new file mode 100644 index 00000000000..2f386f5c732 --- /dev/null +++ b/core/tests/test_account/contracts/storage/storage.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: UNLICENSED + +pragma solidity ^0.8.0; + +contract StorageTester { + uint256 public value; + + // Will cause 65-byte pubdata to be published + uint256 constant BIG_VALUE = 0x0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; + + // Will cause 34-byte pubdata to be published + uint256 constant SMALL_VALUE = 1; + + function simpleWrite() external { + value = BIG_VALUE; + } + + function resettingWrite() external { + value = BIG_VALUE; + value = SMALL_VALUE; + } + + // We have to use a variable since otherwise the function will be optimized + // to never do the write in the first place + function writeAndRevert(bool shouldRevert) external { + value = BIG_VALUE; + + if(shouldRevert) { + revert("This method always reverts"); + } + } + + function resettingWriteViaRevert() external { + value = SMALL_VALUE; + (bool success ,) = (address(this)).call(abi.encodeWithSignature("writeAndRevert(bool)", (true))); + value = SMALL_VALUE; + } + + // This test aims to check that the tstore/sstore are writing into separate spaces. + function testTrasientAndNonTransientStore() external { + value = 100; + + uint256 x; + + uint256 storedVal; + uint256 tStoredVal; + assembly { + tstore(0, 1) + + storedVal := sload(0) + tStoredVal := tload(0) + } + + require(storedVal == 100, "Stored value should be 100"); + require(tStoredVal == 1, "Transient stored value should be 1"); + } + + + uint256 constant TSTORE_TEST_KEY = 0xff; + + // We have to use a variable since otherwise the function will be optimized + // to never do the write in the first place + function tStoreAndRevert(uint256 value, bool shouldRevert) external { + uint256 key = TSTORE_TEST_KEY; + assembly { + tstore(key, value) + } + + if(shouldRevert) { + revert("This method always reverts"); + } + } + + // We have to use a variable since otherwise the function will be optimized + // to never do the write in the first place + function assertTValue(uint256 expectedValue) external { + uint256 key = TSTORE_TEST_KEY; + uint256 realValue; + assembly { + realValue := tload(key) + } + + require(realValue == expectedValue, "The value in transient storage is not what was expected"); + } + + function testTstoreRollback() external { + // Firstly, write the 1000 to the transient storage + this.tStoreAndRevert(1000, false); + + // Now call and ignore the error + (bool success, ) = (address(this)).call(abi.encodeWithSignature("tStoreAndRevert(uint256,bool)", uint256(500), true)); + require(!success, "The call should have failed"); + + this.assertTValue(1000); + } + + function testTransientStore() external { + this.testTrasientAndNonTransientStore(); + this.testTstoreRollback(); + } + + fallback() external {} +} diff --git a/core/tests/test_account/contracts/transfer/transfer.sol b/core/tests/test_account/contracts/transfer/transfer.sol new file mode 100644 index 00000000000..4c63a2e9c7d --- /dev/null +++ b/core/tests/test_account/contracts/transfer/transfer.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: UNLICENSED + +pragma solidity ^0.8.0; + +contract TransferTest { + function transfer(address payable to, uint256 amount) public payable { + to.transfer(amount); + } + + function send(address payable to, uint256 amount) public payable { + bool success = to.send(amount); + + require(success, "Transaction failed"); + } + + receive() external payable { + + } +} + +contract Recipient { + event Received(address indexed sender, uint256 amount); + + receive() external payable { + require(gasleft() >= 2100, "Not enough gas"); + require(gasleft() <= 2300, "Too much gas"); + emit Received(msg.sender, msg.value); + } +} + +contract ReentrantRecipient { + uint256 x; + + event Received(uint256 tmp, uint256 amount); + + function setX() external payable { + x = 1; + } + + receive() external payable { + require(gasleft() >= 15000); + x = 1; + } +} diff --git a/core/tests/test_account/hardhat.config.ts b/core/tests/test_account/hardhat.config.ts new file mode 100644 index 00000000000..584b804026c --- /dev/null +++ b/core/tests/test_account/hardhat.config.ts @@ -0,0 +1,36 @@ +import '@matterlabs/hardhat-zksync-solc'; + +const COMPILER_VERSION = '1.5.0'; +const PRE_RELEASE_VERSION = 'prerelease-a167aa3-code4rena'; + +function getZksolcUrl(): string { + // @ts-ignore + const platform = { darwin: 'macosx', linux: 'linux', win32: 'windows' }[process.platform]; + // @ts-ignore + const toolchain = { linux: '-musl', win32: '-gnu', darwin: '' }[process.platform]; + const arch = process.arch === 'x64' ? 'amd64' : process.arch; + const ext = process.platform === 'win32' ? '.exe' : ''; + + return `https://github.com/matter-labs/era-compiler-solidity/releases/download/${PRE_RELEASE_VERSION}/zksolc-${platform}-${arch}${toolchain}-v${COMPILER_VERSION}${ext}`; +} + +export default { + zksolc: { + compilerSource: 'binary', + settings: { + compilerPath: getZksolcUrl(), + isSystem: true + } + }, + networks: { + hardhat: { + zksync: true + } + }, + solidity: { + version: '0.8.24', + settings: { + evmVersion: 'cancun' + } + }, +}; diff --git a/core/tests/test_account/package.json b/core/tests/test_account/package.json new file mode 100644 index 00000000000..543a982e4b7 --- /dev/null +++ b/core/tests/test_account/package.json @@ -0,0 +1,16 @@ +{ + "name": "contracts-test-data", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@openzeppelin/contracts": "^4.8.0", + "hardhat": "=2.22.2" + }, + "devDependencies": { + "@matterlabs/hardhat-zksync-solc": "^0.3.15" + }, + "scripts": { + "build": "hardhat compile", + "clean": "hardhat clean" + } +} diff --git a/core/tests/test_account/src/contracts.rs b/core/tests/test_account/src/contracts.rs new file mode 100644 index 00000000000..8176e2c1a8e --- /dev/null +++ b/core/tests/test_account/src/contracts.rs @@ -0,0 +1,186 @@ +//! Test contracts. + +use ethabi::Token; +use once_cell::sync::Lazy; +use serde::{Deserialize, Serialize}; +use zksync_types::U256; + +macro_rules! include_contract { + ($file_name:tt :: $contract_name:tt) => { + include_str!(concat!( + env!("OUT_DIR"), + "/artifacts-zk/contracts/", + $file_name, + ".sol/", + stringify!($contract_name), + ".json" + )) + }; +} + +const CONTEXT_CONTRACT: &str = include_contract!("context/context"::Context); +const COUNTER_CONTRACT: &str = include_contract!("counter/counter"::Counter); +const EXPENSIVE_CONTRACT: &str = include_contract!("expensive/expensive"::Expensive); +const FAILED_CALL_CONTRACT: &str = include_contract!("failed-call/failed_call"::FailedCall); +const INFINITE_LOOP_CONTRACT: &str = include_contract!("infinite/infinite"::InfiniteLoop); +const LOAD_TEST_CONTRACT: &str = include_contract!("loadnext/loadnext_contract"::LoadnextContract); +const LOAD_TEST_DEPLOYED_CONTRACT: &str = include_contract!("loadnext/loadnext_contract"::Foo); +const PRECOMPILES_CONTRACT: &str = include_contract!("precompiles/precompiles"::Precompiles); +const STORAGE_TEST_CONTRACT: &str = include_contract!("storage/storage"::StorageTester); + +#[derive(Debug, Clone)] +pub struct TestContract { + pub abi: ethabi::Contract, + pub bytecode: Vec, + pub deployed: Vec, +} + +impl TestContract { + fn new(full_abi: &str) -> Self { + let mut raw: serde_json::Value = + serde_json::from_str(full_abi).expect("failed reading contract ABI"); + let raw = raw.as_object_mut().expect("contract is not an object"); + let abi = raw.remove("abi").expect("contract doesn't contain ABI"); + let abi = serde_json::from_value(abi).expect("failed parsing contract ABI"); + let bytecode = raw + .get("bytecode") + .expect("contract doesn't contain bytecode") + .as_str() + .expect("bytecode is not a string"); + let bytecode = bytecode.strip_prefix("0x").unwrap_or(bytecode); + let bytecode = hex::decode(bytecode).expect("invalid bytecode"); + Self { + abi, + bytecode, + deployed: vec![], + } + } + + pub fn context() -> &'static Self { + static CONTRACT: Lazy = Lazy::new(|| TestContract::new(CONTEXT_CONTRACT)); + &CONTRACT + } + + pub fn counter() -> &'static Self { + static CONTRACT: Lazy = Lazy::new(|| TestContract::new(COUNTER_CONTRACT)); + &CONTRACT + } + + pub fn load_test() -> &'static Self { + static CONTRACT: Lazy = Lazy::new(|| { + let mut contract = TestContract::new(LOAD_TEST_CONTRACT); + contract.deployed = vec![TestContract::new(LOAD_TEST_DEPLOYED_CONTRACT)]; + contract + }); + &CONTRACT + } + + pub fn expensive() -> &'static Self { + static CONTRACT: Lazy = Lazy::new(|| TestContract::new(EXPENSIVE_CONTRACT)); + &CONTRACT + } + + pub fn failed_call() -> &'static Self { + static CONTRACT: Lazy = Lazy::new(|| TestContract::new(FAILED_CALL_CONTRACT)); + &CONTRACT + } + + pub fn infinite_loop() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(INFINITE_LOOP_CONTRACT)); + &CONTRACT + } + + pub fn precompiles() -> &'static Self { + static CONTRACT: Lazy = Lazy::new(|| TestContract::new(PRECOMPILES_CONTRACT)); + &CONTRACT + } + + pub fn storage_test() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(STORAGE_TEST_CONTRACT)); + &CONTRACT + } + + pub fn factory_deps(&self) -> Vec> { + let mut deps = vec![]; + self.insert_factory_deps(&mut deps); + deps + } + + fn insert_factory_deps(&self, dest: &mut Vec>) { + for deployed in &self.deployed { + dest.push(deployed.bytecode.clone()); + deployed.insert_factory_deps(dest); + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct LoadnextContractExecutionParams { + pub reads: usize, + pub writes: usize, + pub events: usize, + pub hashes: usize, + pub recursive_calls: usize, + pub deploys: usize, +} + +impl LoadnextContractExecutionParams { + pub fn empty() -> Self { + Self { + reads: 0, + writes: 0, + events: 0, + hashes: 0, + recursive_calls: 0, + deploys: 0, + } + } +} + +impl Default for LoadnextContractExecutionParams { + fn default() -> Self { + Self { + reads: 10, + writes: 10, + events: 10, + hashes: 10, + recursive_calls: 1, + deploys: 1, + } + } +} + +impl LoadnextContractExecutionParams { + pub fn to_bytes(&self) -> Vec { + let contract_function = TestContract::load_test().abi.function("execute").unwrap(); + + let params = vec![ + Token::Uint(U256::from(self.reads)), + Token::Uint(U256::from(self.writes)), + Token::Uint(U256::from(self.hashes)), + Token::Uint(U256::from(self.events)), + Token::Uint(U256::from(self.recursive_calls)), + Token::Uint(U256::from(self.deploys)), + ]; + + contract_function + .encode_input(¶ms) + .expect("failed to encode parameters") + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn contracts_are_initialized_correctly() { + TestContract::counter().abi.function("get").unwrap(); + TestContract::context() + .abi + .function("getBlockNumber") + .unwrap(); + } +} diff --git a/core/tests/test_account/src/lib.rs b/core/tests/test_account/src/lib.rs index 999ea6eb6e0..4c5392302c8 100644 --- a/core/tests/test_account/src/lib.rs +++ b/core/tests/test_account/src/lib.rs @@ -1,7 +1,4 @@ use ethabi::Token; -use zksync_contracts::{ - deployer_contract, load_contract, test_contracts::LoadnextContractExecutionParams, -}; use zksync_eth_signer::{PrivateKeySigner, TransactionParameters}; use zksync_system_constants::{ CONTRACT_DEPLOYER_ADDRESS, DEFAULT_L2_TX_GAS_PER_PUBDATA_BYTE, @@ -13,6 +10,10 @@ use zksync_types::{ }; use zksync_utils::{address_to_u256, bytecode::hash_bytecode, h256_to_u256}; +pub use self::contracts::{LoadnextContractExecutionParams, TestContract}; + +mod contracts; + pub const L1_TEST_GAS_PER_PUBDATA_BYTE: u32 = 800; const BASE_FEE: u64 = 2_000_000_000; @@ -112,10 +113,6 @@ impl Account { mut factory_deps: Vec>, tx_type: TxType, ) -> DeployContractsTx { - let deployer = deployer_contract(); - - let contract_function = deployer.function("create").unwrap(); - let calldata = calldata.map(ethabi::encode); let code_hash = hash_bytecode(code); let params = [ @@ -124,9 +121,7 @@ impl Account { Token::Bytes(calldata.unwrap_or_default().to_vec()), ]; factory_deps.push(code.to_vec()); - let calldata = contract_function - .encode_input(¶ms) - .expect("failed to encode parameters"); + let calldata = ethabi::encode(¶ms); let execute = Execute { contract_address: Some(CONTRACT_DEPLOYER_ADDRESS), @@ -199,16 +194,15 @@ impl Account { payable: bool, tx_type: TxType, ) -> Transaction { - let test_contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/counter/counter.sol/Counter.json", - ); + let test_contract = TestContract::counter(); let function = if payable { test_contract + .abi .function("incrementWithRevertPayable") .unwrap() } else { - test_contract.function("incrementWithRevert").unwrap() + test_contract.abi.function("incrementWithRevert").unwrap() }; let calldata = function diff --git a/core/tests/test_account/yarn.lock b/core/tests/test_account/yarn.lock new file mode 100644 index 00000000000..e1febd26aa6 --- /dev/null +++ b/core/tests/test_account/yarn.lock @@ -0,0 +1,2310 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@balena/dockerignore@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@balena/dockerignore/-/dockerignore-1.0.2.tgz#9ffe4726915251e8eb69f44ef3547e0da2c03e0d" + integrity sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q== + +"@ethersproject/abi@^5.1.2": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@fastify/busboy@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.0.0.tgz#f22824caff3ae506b18207bad4126dbc6ccdb6b8" + integrity sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ== + +"@matterlabs/hardhat-zksync-solc@^0.3.15": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.3.17.tgz#72f199544dc89b268d7bfc06d022a311042752fd" + integrity sha512-aZgQ0yfXW5xPkfuEH1d44ncWV4T2LzKZd0VVPo4PL5cUrYs2/II1FaEDp5zsf3FxOR1xT3mBsjuSrtJkk4AL8Q== + dependencies: + "@nomiclabs/hardhat-docker" "^2.0.0" + chalk "4.1.2" + dockerode "^3.3.4" + +"@metamask/eth-sig-util@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" + integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== + dependencies: + ethereumjs-abi "^0.6.8" + ethereumjs-util "^6.2.1" + ethjs-util "^0.1.6" + tweetnacl "^1.0.3" + tweetnacl-util "^0.15.1" + +"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== + +"@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + +"@nomicfoundation/edr-darwin-arm64@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.8.tgz#09de1f03c0336670fce959f376f0fe9137545836" + integrity sha512-eB0leCexS8sQEmfyD72cdvLj9djkBzQGP4wSQw6SNf2I4Sw4Cnzb3d45caG2FqFFjbvfqL0t+badUUIceqQuMw== + +"@nomicfoundation/edr-darwin-x64@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.8.tgz#c3ca237c74ed3b6fb800fd7f1de7174f4ad24f72" + integrity sha512-JksVCS1N5ClwVF14EvO25HCQ+Laljh/KRfHERMVAC9ZwPbTuAd/9BtKvToCBi29uCHWqsXMI4lxCApYQv2nznw== + +"@nomicfoundation/edr-linux-arm64-gnu@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.8.tgz#08bd367789e745f4e78a8a87368fc470eea8a7de" + integrity sha512-raCE+fOeNXhVBLUo87cgsHSGvYYRB6arih4eG6B9KGACWK5Veebtm9xtKeiD8YCsdUlUfat6F7ibpeNm91fpsA== + +"@nomicfoundation/edr-linux-arm64-musl@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.8.tgz#9cab5cbec0052cb5812c6c66c463d28a756cd916" + integrity sha512-PwiDp4wBZWMCIy29eKkv8moTKRrpiSDlrc+GQMSZLhOAm8T33JKKXPwD/2EbplbhCygJDGXZdtEKl9x9PaH66A== + +"@nomicfoundation/edr-linux-x64-gnu@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.8.tgz#d4a11b6ebcd1b29d7431d185c6df3e65a2cd4bde" + integrity sha512-6AcvA/XKoipGap5jJmQ9Y6yT7Uf39D9lu2hBcDCXnXbMcXaDGw4mn1/L4R63D+9VGZyu1PqlcJixCUZlGGIWlg== + +"@nomicfoundation/edr-linux-x64-musl@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.8.tgz#b8eef960d06380a365866ddd1e97ecb7fbf6bd70" + integrity sha512-cxb0sEmZjlwhYWO28sPsV64VDx31ekskhC1IsDXU1p9ntjHSJRmW4KEIqJ2O3QwJap/kLKfMS6TckvY10gjc6w== + +"@nomicfoundation/edr-win32-x64-msvc@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.8.tgz#ac7061aeb07cc847c429513080b76bb05297a869" + integrity sha512-yVuVPqRRNLZk7TbBMkKw7lzCvI8XO8fNTPTYxymGadjr9rEGRuNTU1yBXjfJ59I1jJU/X2TSkRk1OFX0P5tpZQ== + +"@nomicfoundation/edr@^0.3.1": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.8.tgz#28fe7ae4f462ae74a16cd1a714ff7b1cd9c22b4c" + integrity sha512-u2UJ5QpznSHVkZRh6ePWoeVb6kmPrrqh08gCnZ9FHlJV9CITqlrTQHJkacd+INH31jx88pTAJnxePE4XAiH5qg== + dependencies: + "@nomicfoundation/edr-darwin-arm64" "0.3.8" + "@nomicfoundation/edr-darwin-x64" "0.3.8" + "@nomicfoundation/edr-linux-arm64-gnu" "0.3.8" + "@nomicfoundation/edr-linux-arm64-musl" "0.3.8" + "@nomicfoundation/edr-linux-x64-gnu" "0.3.8" + "@nomicfoundation/edr-linux-x64-musl" "0.3.8" + "@nomicfoundation/edr-win32-x64-msvc" "0.3.8" + +"@nomicfoundation/ethereumjs-common@4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz#9901f513af2d4802da87c66d6f255b510bef5acb" + integrity sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg== + dependencies: + "@nomicfoundation/ethereumjs-util" "9.0.4" + +"@nomicfoundation/ethereumjs-rlp@5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz#66c95256fc3c909f6fb18f6a586475fc9762fa30" + integrity sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw== + +"@nomicfoundation/ethereumjs-tx@5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz#b0ceb58c98cc34367d40a30d255d6315b2f456da" + integrity sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-rlp" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-util@9.0.4": + version "9.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz#84c5274e82018b154244c877b76bc049a4ed7b38" + integrity sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "5.0.4" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" + integrity sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w== + +"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz#6e25ccdf6e2d22389c35553b64fe6f3fdaec432c" + integrity sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA== + +"@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz#0a224ea50317139caeebcdedd435c28a039d169c" + integrity sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA== + +"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz#dfa085d9ffab9efb2e7b383aed3f557f7687ac2b" + integrity sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg== + +"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz#c9e06b5d513dd3ab02a7ac069c160051675889a4" + integrity sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w== + +"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz#8d328d16839e52571f72f2998c81e46bf320f893" + integrity sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA== + +"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz#9b49d0634b5976bb5ed1604a1e1b736f390959bb" + integrity sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w== + +"@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz#e2867af7264ebbcc3131ef837878955dd6a3676f" + integrity sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg== + +"@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz#0685f78608dd516c8cdfb4896ed451317e559585" + integrity sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ== + +"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz#c9a44f7108646f083b82e851486e0f6aeb785836" + integrity sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw== + +"@nomicfoundation/solidity-analyzer@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz#f5f4d36d3f66752f59a57e7208cd856f3ddf6f2d" + integrity sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg== + optionalDependencies: + "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.1" + "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-freebsd-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" + +"@nomiclabs/hardhat-docker@^2.0.0": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-docker/-/hardhat-docker-2.0.2.tgz#ae964be17951275a55859ff7358e9e7c77448846" + integrity sha512-XgGEpRT3wlA1VslyB57zyAHV+oll8KnV1TjwnxxC1tpAL04/lbdwpdO5KxInVN8irMSepqFpsiSkqlcnvbE7Ng== + dependencies: + dockerode "^2.5.8" + fs-extra "^7.0.1" + node-fetch "^2.6.0" + +"@openzeppelin/contracts@^4.8.0": + version "4.9.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" + integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== + +"@scure/base@~1.1.0": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + +"@scure/bip32@1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" + integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== + dependencies: + "@noble/hashes" "~1.2.0" + "@noble/secp256k1" "~1.7.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" + integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== + dependencies: + "@noble/hashes" "~1.2.0" + "@scure/base" "~1.1.0" + +"@sentry/core@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" + integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/hub@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" + integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== + dependencies: + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/minimal@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" + integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sentry/node@^5.18.1": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" + integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== + dependencies: + "@sentry/core" "5.30.0" + "@sentry/hub" "5.30.0" + "@sentry/tracing" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" + integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/types@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" + integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== + +"@sentry/utils@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" + integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== + dependencies: + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@types/bn.js@^4.11.3": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/bn.js@^5.1.0": + version "5.1.5" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" + integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== + dependencies: + "@types/node" "*" + +"@types/lru-cache@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" + integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== + +"@types/node@*": + version "20.9.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298" + integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw== + dependencies: + undici-types "~5.26.4" + +"@types/pbkdf2@^3.0.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.2.tgz#2dc43808e9985a2c69ff02e2d2027bd4fe33e8dc" + integrity sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew== + dependencies: + "@types/node" "*" + +"@types/secp256k1@^4.0.1": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.6.tgz#d60ba2349a51c2cbc5e816dcd831a42029d376bf" + integrity sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ== + dependencies: + "@types/node" "*" + +JSONStream@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" + integrity sha512-mn0KSip7N4e0UDPZHnqDsHECo5uGQrixQKnAskOM1BIB8hd7QKbd6il8IPRPudPHOeHiECoCFqhyMaRO9+nWyA== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +adm-zip@^0.4.16: + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ansi-align@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== + dependencies: + string-width "^4.1.0" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-colors@^4.1.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +ansi-escapes@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +asn1@^0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bcrypt-pbkdf@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bl@^1.0.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" + integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + +bl@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + +bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +boxen@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.2" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ== + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== + +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +buildcheck@~0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/buildcheck/-/buildcheck-0.0.6.tgz#89aa6e417cfd1e2196e3f8fe915eb709d2fe4238" + integrity sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A== + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +camelcase@^6.0.0, camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +chalk@4.1.2, chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chokidar@3.5.3, chokidar@^3.4.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chownr@^1.0.1, chownr@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +command-exists@^1.2.8: + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== + +commander@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" + integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +concat-stream@~1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +cookie@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + +cpu-features@~0.0.8: + version "0.0.9" + resolved "https://registry.yarnpkg.com/cpu-features/-/cpu-features-0.0.9.tgz#5226b92f0f1c63122b0a3eb84cb8335a4de499fc" + integrity sha512-AKjgn2rP2yJyfbepsmLfiYcmtNn/2eUvocUyM/09yB0YDiz39HteK/5/T4Onf0pmdYDMgkBoGvRLvEguzyL7wQ== + dependencies: + buildcheck "~0.0.6" + nan "^2.17.0" + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +debug@4, debug@4.3.4, debug@^4.1.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +debug@^3.2.6: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +docker-modem@^1.0.8: + version "1.0.9" + resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-1.0.9.tgz#a1f13e50e6afb6cf3431b2d5e7aac589db6aaba8" + integrity sha512-lVjqCSCIAUDZPAZIeyM125HXfNvOmYYInciphNrLrylUtKyW66meAjSPXWchKVzoIYZx69TPnAepVSSkeawoIw== + dependencies: + JSONStream "1.3.2" + debug "^3.2.6" + readable-stream "~1.0.26-4" + split-ca "^1.0.0" + +docker-modem@^3.0.0: + version "3.0.8" + resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-3.0.8.tgz#ef62c8bdff6e8a7d12f0160988c295ea8705e77a" + integrity sha512-f0ReSURdM3pcKPNS30mxOHSbaFLcknGmQjwSfmbcdOw1XWKXVhukM3NJHhr7NpY9BIyyWQb0EBo3KQvvuU5egQ== + dependencies: + debug "^4.1.1" + readable-stream "^3.5.0" + split-ca "^1.0.1" + ssh2 "^1.11.0" + +dockerode@^2.5.8: + version "2.5.8" + resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-2.5.8.tgz#1b661e36e1e4f860e25f56e0deabe9f87f1d0acc" + integrity sha512-+7iOUYBeDTScmOmQqpUYQaE7F4vvIt6+gIZNHWhqAQEI887tiPFB9OvXI/HzQYqfUNvukMK+9myLW63oTJPZpw== + dependencies: + concat-stream "~1.6.2" + docker-modem "^1.0.8" + tar-fs "~1.16.3" + +dockerode@^3.3.4: + version "3.3.5" + resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.5.tgz#7ae3f40f2bec53ae5e9a741ce655fff459745629" + integrity sha512-/0YNa3ZDNeLr/tSckmD69+Gq+qVNhvKfAHNeZJBnp7EOP6RGKV8ORrJHkUn20So5wU+xxT7+1n5u8PjHbfjbSA== + dependencies: + "@balena/dockerignore" "^1.0.2" + docker-modem "^3.0.0" + tar-fs "~2.0.1" + +elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +enquirer@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" + integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== + dependencies: + ansi-colors "^4.1.1" + strip-ansi "^6.0.1" + +env-paths@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereum-cryptography@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" + integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== + dependencies: + "@noble/hashes" "1.2.0" + "@noble/secp256k1" "1.7.1" + "@scure/bip32" "1.1.5" + "@scure/bip39" "1.1.1" + +ethereumjs-abi@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.3" + +ethjs-util@0.1.6, ethjs-util@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== + dependencies: + locate-path "^2.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +follow-redirects@^1.12.1: + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== + +fp-ts@1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== + +fp-ts@^1.0.0: + version "1.19.5" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" + integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== + +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +hardhat@=2.22.2: + version "2.22.2" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.2.tgz#0cadd7ec93bf39bab09f81603e75bc5e92acea3d" + integrity sha512-0xZ7MdCZ5sJem4MrvpQWLR3R3zGDoHw5lsR+pBFimqwagimIOn3bWuZv69KA+veXClwI1s/zpqgwPwiFrd4Dxw== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/edr" "^0.3.1" + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-tx" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + "@nomicfoundation/solidity-analyzer" "^0.1.0" + "@sentry/node" "^5.18.1" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + adm-zip "^0.4.16" + aggregate-error "^3.0.0" + ansi-escapes "^4.3.0" + boxen "^5.1.2" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + ethereum-cryptography "^1.0.3" + ethereumjs-abi "^0.6.8" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "7.2.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + keccak "^3.0.2" + lodash "^4.17.11" + mnemonist "^0.38.0" + mocha "^10.0.0" + p-map "^4.0.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + tsort "0.0.1" + undici "^5.14.0" + uuid "^8.3.2" + ws "^7.4.6" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +immutable@^4.0.0-rc.12: + version "4.3.4" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f" + integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA== + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +io-ts@1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== + dependencies: + fp-ts "^1.0.0" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +js-sha3@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== + +keccak@^3.0.0, keccak@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== + optionalDependencies: + graceful-fs "^4.1.9" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.11: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mkdirp-classic@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + +mkdirp@^0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mnemonist@^0.38.0: + version "0.38.5" + resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" + integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== + dependencies: + obliterator "^2.0.0" + +mocha@^10.0.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" + integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== + dependencies: + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + nanoid "3.3.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nan@^2.17.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" + integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== + +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-fetch@^2.6.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +node-gyp-build@^4.2.0: + version "4.6.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" + integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +obliterator@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" + integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== + dependencies: + p-limit "^1.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +pbkdf2@^3.0.17: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +pump@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" + integrity sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +raw-body@^2.4.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5: + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@~1.0.26-4: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-from-string@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve@1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +rimraf@^2.2.8: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.2.3: + version "2.2.7" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== + dependencies: + bn.js "^5.2.0" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scrypt-js@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +secp256k1@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +semver@^5.5.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@^6.3.0: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +solc@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" + integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + follow-redirects "^1.12.1" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +source-map-support@^0.5.13: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +split-ca@^1.0.0, split-ca@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/split-ca/-/split-ca-1.0.1.tgz#6c83aff3692fa61256e0cd197e05e9de157691a6" + integrity sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ== + +ssh2@^1.11.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/ssh2/-/ssh2-1.14.0.tgz#8f68440e1b768b66942c9e4e4620b2725b3555bb" + integrity sha512-AqzD1UCqit8tbOKoj6ztDDi1ffJZ2rV2SwlgrVVrHPkV5vWqGJOVp5pmtj18PunkPJAuKQsnInyKV+/Nb2bUnA== + dependencies: + asn1 "^0.2.6" + bcrypt-pbkdf "^1.0.2" + optionalDependencies: + cpu-features "~0.0.8" + nan "^2.17.0" + +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== + dependencies: + is-hex-prefixed "1.0.0" + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +tar-fs@~1.16.3: + version "1.16.3" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" + integrity sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw== + dependencies: + chownr "^1.0.1" + mkdirp "^0.5.1" + pump "^1.0.0" + tar-stream "^1.1.2" + +tar-fs@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.1.tgz#e44086c1c60d31a4f0cf893b1c4e155dabfae9e2" + integrity sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA== + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.0.0" + +tar-stream@^1.1.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" + integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== + dependencies: + bl "^1.0.0" + buffer-alloc "^1.2.0" + end-of-stream "^1.0.0" + fs-constants "^1.0.0" + readable-stream "^2.3.0" + to-buffer "^1.1.1" + xtend "^4.0.0" + +tar-stream@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" + integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== + dependencies: + bl "^4.0.3" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + +tmp@0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +to-buffer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" + integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsort@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== + +tweetnacl-util@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== + +tweetnacl@^0.14.3: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + +tweetnacl@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +undici@^5.14.0: + version "5.27.2" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.27.2.tgz#a270c563aea5b46cc0df2550523638c95c5d4411" + integrity sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ== + dependencies: + "@fastify/busboy" "^2.0.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +unpipe@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@^7.4.6: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +xtend@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From e96861ee54050e0847e43b269d04bcf777c01ea9 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 3 Oct 2024 14:43:40 +0300 Subject: [PATCH 02/32] Sketch test contracts usage --- Cargo.lock | 8 ++- core/lib/contracts/src/lib.rs | 33 ---------- core/lib/contracts/src/test_contracts.rs | 64 ------------------- core/lib/multivm/src/versions/tests.rs | 17 ++--- .../src/versions/vm_fast/tests/rollbacks.rs | 6 +- .../src/versions/vm_latest/tests/rollbacks.rs | 9 ++- core/node/api_server/Cargo.toml | 1 + core/node/api_server/src/testonly.rs | 44 ++++++------- .../api_server/src/tx_sender/tests/mod.rs | 2 +- .../state_keeper/src/executor/tests/tester.rs | 25 ++------ core/tests/loadnext/Cargo.toml | 2 +- core/tests/loadnext/src/account/mod.rs | 2 +- core/tests/loadnext/src/config.rs | 7 +- core/tests/vm-benchmark/Cargo.toml | 3 +- core/tests/vm-benchmark/src/transaction.rs | 23 ++++--- 15 files changed, 68 insertions(+), 178 deletions(-) delete mode 100644 core/lib/contracts/src/test_contracts.rs diff --git a/Cargo.lock b/Cargo.lock index 5073188d632..eba48b7bd58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4232,10 +4232,10 @@ dependencies = [ "tracing", "vise", "zksync_config", - "zksync_contracts", "zksync_eth_client", "zksync_eth_signer", "zksync_system_constants", + "zksync_test_account", "zksync_types", "zksync_utils", "zksync_vlog", @@ -8725,6 +8725,7 @@ dependencies = [ "vise", "zksync_contracts", "zksync_multivm", + "zksync_test_account", "zksync_types", "zksync_utils", "zksync_vlog", @@ -10537,6 +10538,7 @@ dependencies = [ "zksync_state", "zksync_state_keeper", "zksync_system_constants", + "zksync_test_account", "zksync_types", "zksync_utils", "zksync_vm_executor", @@ -11194,8 +11196,10 @@ version = "0.1.0" dependencies = [ "ethabi", "hex", + "once_cell", "rand 0.8.5", - "zksync_contracts", + "serde", + "serde_json", "zksync_eth_signer", "zksync_system_constants", "zksync_types", diff --git a/core/lib/contracts/src/lib.rs b/core/lib/contracts/src/lib.rs index a72b5c95d1b..da145492c2b 100644 --- a/core/lib/contracts/src/lib.rs +++ b/core/lib/contracts/src/lib.rs @@ -18,8 +18,6 @@ use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, env::Workspace}; -pub mod test_contracts; - #[derive(Debug, Clone)] pub enum ContractLanguage { Sol, @@ -60,10 +58,6 @@ const _IERC20_CONTRACT_FILE: &str = "contracts/l1-contracts/artifacts/contracts/common/interfaces/IERC20.sol/IERC20.json"; const _FAIL_ON_RECEIVE_CONTRACT_FILE: &str = "contracts/l1-contracts/artifacts/contracts/zksync/dev-contracts/FailOnReceive.sol/FailOnReceive.json"; -const LOADNEXT_CONTRACT_FILE: &str = - "etc/contracts-test-data/artifacts-zk/contracts/loadnext/loadnext_contract.sol/LoadnextContract.json"; -const LOADNEXT_SIMPLE_CONTRACT_FILE: &str = - "etc/contracts-test-data/artifacts-zk/contracts/loadnext/loadnext_contract.sol/Foo.json"; fn home_path() -> PathBuf { Workspace::locate().core() @@ -163,33 +157,6 @@ pub fn verifier_contract() -> Contract { load_contract_for_both_compilers(VERIFIER_CONTRACT_FILE) } -#[derive(Debug, Clone)] -pub struct TestContract { - /// Contract bytecode to be used for sending deploy transaction. - pub bytecode: Vec, - /// Contract ABI. - pub contract: Contract, - - pub factory_deps: Vec>, -} - -/// Reads test contract bytecode and its ABI. -pub fn get_loadnext_contract() -> TestContract { - let bytecode = read_bytecode(LOADNEXT_CONTRACT_FILE); - let dep = read_bytecode(LOADNEXT_SIMPLE_CONTRACT_FILE); - - TestContract { - bytecode, - contract: loadnext_contract(), - factory_deps: vec![dep], - } -} - -// Returns loadnext contract and its factory dependencies -fn loadnext_contract() -> Contract { - load_contract("etc/contracts-test-data/artifacts-zk/contracts/loadnext/loadnext_contract.sol/LoadnextContract.json") -} - pub fn deployer_contract() -> Contract { load_sys_contract("ContractDeployer") } diff --git a/core/lib/contracts/src/test_contracts.rs b/core/lib/contracts/src/test_contracts.rs deleted file mode 100644 index eab1587f833..00000000000 --- a/core/lib/contracts/src/test_contracts.rs +++ /dev/null @@ -1,64 +0,0 @@ -use ethabi::{ethereum_types::U256, Bytes, Token}; -use serde::Deserialize; - -use crate::get_loadnext_contract; - -#[derive(Debug, Clone, Deserialize)] -pub struct LoadnextContractExecutionParams { - pub reads: usize, - pub writes: usize, - pub events: usize, - pub hashes: usize, - pub recursive_calls: usize, - pub deploys: usize, -} - -impl LoadnextContractExecutionParams { - pub fn from_env() -> Option { - envy::prefixed("CONTRACT_EXECUTION_PARAMS_").from_env().ok() - } - - pub fn empty() -> Self { - Self { - reads: 0, - writes: 0, - events: 0, - hashes: 0, - recursive_calls: 0, - deploys: 0, - } - } -} - -impl Default for LoadnextContractExecutionParams { - fn default() -> Self { - Self { - reads: 10, - writes: 10, - events: 10, - hashes: 10, - recursive_calls: 1, - deploys: 1, - } - } -} - -impl LoadnextContractExecutionParams { - pub fn to_bytes(&self) -> Bytes { - let loadnext_contract = get_loadnext_contract(); - let contract_function = loadnext_contract.contract.function("execute").unwrap(); - - let params = vec![ - Token::Uint(U256::from(self.reads)), - Token::Uint(U256::from(self.writes)), - Token::Uint(U256::from(self.hashes)), - Token::Uint(U256::from(self.events)), - Token::Uint(U256::from(self.recursive_calls)), - Token::Uint(U256::from(self.deploys)), - ]; - - contract_function - .encode_input(¶ms) - .expect("failed to encode parameters") - } -} diff --git a/core/lib/multivm/src/versions/tests.rs b/core/lib/multivm/src/versions/tests.rs index c2a04c155fe..d1984ee3159 100644 --- a/core/lib/multivm/src/versions/tests.rs +++ b/core/lib/multivm/src/versions/tests.rs @@ -2,12 +2,7 @@ //! these tests are placed here. use assert_matches::assert_matches; -use ethabi::Contract; -use zksync_contracts::{ - get_loadnext_contract, load_contract, read_bytecode, - test_contracts::LoadnextContractExecutionParams, -}; -use zksync_test_account::{Account, TxType}; +use zksync_test_account::{Account, LoadnextContractExecutionParams, TestContract, TxType}; use zksync_types::{ block::L2BlockHasher, fee::Fee, AccountTreeId, Address, Execute, L1BatchNumber, L2BlockNumber, ProtocolVersionId, StorageKey, H256, U256, @@ -59,13 +54,11 @@ struct Harness { alice: Account, bob: Account, storage_contract: ContractToDeploy, - storage_contract_abi: Contract, + storage_contract_abi: &'static ethabi::Contract, current_block: L2BlockEnv, } impl Harness { - const STORAGE_CONTRACT_PATH: &'static str = - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json"; const STORAGE_CONTRACT_ADDRESS: Address = Address::repeat_byte(23); fn new(l1_batch_env: &L1BatchEnv) -> Self { @@ -73,10 +66,10 @@ impl Harness { alice: Account::random(), bob: Account::random(), storage_contract: ContractToDeploy::new( - read_bytecode(Self::STORAGE_CONTRACT_PATH), + TestContract::storage_test().bytecode.clone(), Self::STORAGE_CONTRACT_ADDRESS, ), - storage_contract_abi: load_contract(Self::STORAGE_CONTRACT_PATH), + storage_contract_abi: &TestContract::storage_test().abi, current_block: l1_batch_env.first_l2_block, } } @@ -176,7 +169,7 @@ impl Harness { self.new_block(vm, &[out_of_gas_transfer.hash(), simple_write_tx.hash()]); let deploy_tx = self.alice.get_deploy_tx( - &get_loadnext_contract().bytecode, + &TestContract::load_test().bytecode, Some(&[ethabi::Token::Uint(100.into())]), TxType::L2, ); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs index cff72d8ec5a..ee6aa529e1b 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs @@ -1,6 +1,6 @@ use assert_matches::assert_matches; use ethabi::Token; -use zksync_contracts::{get_loadnext_contract, test_contracts::LoadnextContractExecutionParams}; +use zksync_test_account::{LoadnextContractExecutionParams, TestContract}; use zksync_types::{Address, Execute, U256}; use zksync_vm_interface::VmInterfaceExt; @@ -71,7 +71,7 @@ fn test_vm_loadnext_rollbacks() { .build(); let mut account = vm.rich_accounts[0].clone(); - let loadnext_contract = get_loadnext_contract(); + let loadnext_contract = TestContract::load_test(); let loadnext_constructor_data = &[Token::Uint(U256::from(100))]; let DeployContractsTx { tx: loadnext_deploy_tx, @@ -80,7 +80,7 @@ fn test_vm_loadnext_rollbacks() { } = account.get_deploy_tx_with_factory_deps( &loadnext_contract.bytecode, Some(loadnext_constructor_data), - loadnext_contract.factory_deps.clone(), + loadnext_contract.factory_deps(), TxType::L2, ); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs index 00a5d6494fe..4b854f306cf 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs @@ -1,6 +1,6 @@ use assert_matches::assert_matches; use ethabi::Token; -use zksync_contracts::{get_loadnext_contract, test_contracts::LoadnextContractExecutionParams}; +use zksync_test_account::{LoadnextContractExecutionParams, TestContract}; use zksync_types::{get_nonce_key, Address, Execute, U256}; use crate::{ @@ -79,7 +79,7 @@ fn test_vm_loadnext_rollbacks() { .build(); let mut account = vm.rich_accounts[0].clone(); - let loadnext_contract = get_loadnext_contract(); + let loadnext_contract = TestContract::load_test(); let loadnext_constructor_data = &[Token::Uint(U256::from(100))]; let DeployContractsTx { tx: loadnext_deploy_tx, @@ -88,7 +88,7 @@ fn test_vm_loadnext_rollbacks() { } = account.get_deploy_tx_with_factory_deps( &loadnext_contract.bytecode, Some(loadnext_constructor_data), - loadnext_contract.factory_deps.clone(), + loadnext_contract.factory_deps(), TxType::L2, ); @@ -191,14 +191,13 @@ fn test_layered_rollback() { .build(); let account = &mut vm.rich_accounts[0]; - let loadnext_contract = get_loadnext_contract().bytecode; let DeployContractsTx { tx: deploy_tx, address, .. } = account.get_deploy_tx( - &loadnext_contract, + &TestContract::load_test().bytecode, Some(&[Token::Uint(0.into())]), TxType::L2, ); diff --git a/core/node/api_server/Cargo.toml b/core/node/api_server/Cargo.toml index d0723a9d23e..e26147703ad 100644 --- a/core/node/api_server/Cargo.toml +++ b/core/node/api_server/Cargo.toml @@ -59,6 +59,7 @@ lru.workspace = true zk_evm_1_5_0.workspace = true zksync_node_genesis.workspace = true zksync_node_test_utils.workspace = true +zksync_test_account.workspace = true assert_matches.workspace = true test-casing.workspace = true diff --git a/core/node/api_server/src/testonly.rs b/core/node/api_server/src/testonly.rs index 8dc7915385a..709c17570b3 100644 --- a/core/node/api_server/src/testonly.rs +++ b/core/node/api_server/src/testonly.rs @@ -3,14 +3,12 @@ use std::{collections::HashMap, iter}; use zk_evm_1_5_0::zkevm_opcode_defs::decoding::{EncodingModeProduction, VmEncodingMode}; -use zksync_contracts::{ - eth_contract, get_loadnext_contract, load_contract, read_bytecode, - test_contracts::LoadnextContractExecutionParams, -}; +use zksync_contracts::{eth_contract, load_contract, read_bytecode}; use zksync_dal::{Connection, Core, CoreDal}; use zksync_multivm::utils::derive_base_fee_and_gas_per_pubdata; use zksync_node_fee_model::BatchFeeModelInputProvider; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; +use zksync_test_account::{LoadnextContractExecutionParams, TestContract}; use zksync_types::{ api::state_override::{Bytecode, OverrideAccount, OverrideState, StateOverride}, ethabi, @@ -26,14 +24,6 @@ use zksync_types::{ }; use zksync_utils::{address_to_u256, u256_to_h256}; -const EXPENSIVE_CONTRACT_PATH: &str = - "etc/contracts-test-data/artifacts-zk/contracts/expensive/expensive.sol/Expensive.json"; -const PRECOMPILES_CONTRACT_PATH: &str = - "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json"; -const COUNTER_CONTRACT_PATH: &str = - "etc/contracts-test-data/artifacts-zk/contracts/counter/counter.sol/Counter.json"; -const INFINITE_LOOP_CONTRACT_PATH: &str = - "etc/contracts-test-data/artifacts-zk/contracts/infinite/infinite.sol/InfiniteLoop.json"; const MULTICALL3_CONTRACT_PATH: &str = "contracts/l2-contracts/artifacts-zk/contracts/dev-contracts/Multicall3.sol/Multicall3.json"; @@ -101,7 +91,7 @@ impl StateBuilder { self.inner.insert( Self::LOAD_TEST_ADDRESS, OverrideAccount { - code: Some(Bytecode::new(get_loadnext_contract().bytecode).unwrap()), + code: Some(Bytecode::new(TestContract::load_test().bytecode.clone()).unwrap()), state: Some(OverrideState::State(state)), ..OverrideAccount::default() }, @@ -117,21 +107,21 @@ impl StateBuilder { pub fn with_expensive_contract(self) -> Self { self.with_contract( Self::EXPENSIVE_CONTRACT_ADDRESS, - read_bytecode(EXPENSIVE_CONTRACT_PATH), + TestContract::expensive().bytecode.clone(), ) } pub fn with_precompiles_contract(self) -> Self { self.with_contract( Self::PRECOMPILES_CONTRACT_ADDRESS, - read_bytecode(PRECOMPILES_CONTRACT_PATH), + TestContract::precompiles().bytecode.clone(), ) } pub fn with_counter_contract(self, initial_value: u64) -> Self { let mut this = self.with_contract( Self::COUNTER_CONTRACT_ADDRESS, - read_bytecode(COUNTER_CONTRACT_PATH), + TestContract::counter().bytecode.clone(), ); if initial_value != 0 { let state = HashMap::from([(H256::zero(), H256::from_low_u64_be(initial_value))]); @@ -146,7 +136,7 @@ impl StateBuilder { pub fn with_infinite_loop_contract(self) -> Self { self.with_contract( Self::INFINITE_LOOP_CONTRACT_ADDRESS, - read_bytecode(INFINITE_LOOP_CONTRACT_PATH), + TestContract::infinite_loop().bytecode.clone(), ) } @@ -370,7 +360,7 @@ impl TestAccount for K256PrivateKey { L2ChainId::default(), self, if params.deploys > 0 { - get_loadnext_contract().factory_deps + TestContract::load_test().factory_deps() } else { vec![] }, @@ -380,7 +370,8 @@ impl TestAccount for K256PrivateKey { } fn create_expensive_tx(&self, write_count: usize) -> L2Tx { - let calldata = load_contract(EXPENSIVE_CONTRACT_PATH) + let calldata = TestContract::expensive() + .abi .function("expensive") .expect("no `expensive` function in contract") .encode_input(&[Token::Uint(write_count.into())]) @@ -400,7 +391,8 @@ impl TestAccount for K256PrivateKey { } fn create_expensive_cleanup_tx(&self) -> L2Tx { - let calldata = load_contract(EXPENSIVE_CONTRACT_PATH) + let calldata = TestContract::expensive() + .abi .function("cleanUp") .expect("no `cleanUp` function in contract") .encode_input(&[]) @@ -420,7 +412,8 @@ impl TestAccount for K256PrivateKey { } fn create_code_oracle_tx(&self, bytecode_hash: H256, expected_keccak_hash: H256) -> L2Tx { - let calldata = load_contract(PRECOMPILES_CONTRACT_PATH) + let calldata = TestContract::precompiles() + .abi .function("callCodeOracle") .expect("no `callCodeOracle` function") .encode_input(&[ @@ -443,7 +436,8 @@ impl TestAccount for K256PrivateKey { } fn create_counter_tx(&self, increment: U256, revert: bool) -> L2Tx { - let calldata = load_contract(COUNTER_CONTRACT_PATH) + let calldata = TestContract::counter() + .abi .function("incrementWithRevert") .expect("no `incrementWithRevert` function") .encode_input(&[Token::Uint(increment), Token::Bool(revert)]) @@ -463,7 +457,8 @@ impl TestAccount for K256PrivateKey { } fn query_counter_value(&self) -> CallRequest { - let calldata = load_contract(COUNTER_CONTRACT_PATH) + let calldata = TestContract::counter() + .abi .function("get") .expect("no `get` function") .encode_input(&[]) @@ -477,7 +472,8 @@ impl TestAccount for K256PrivateKey { } fn create_infinite_loop_tx(&self) -> L2Tx { - let calldata = load_contract(INFINITE_LOOP_CONTRACT_PATH) + let calldata = TestContract::infinite_loop() + .abi .function("infiniteLoop") .expect("no `infiniteLoop` function") .encode_input(&[]) diff --git a/core/node/api_server/src/tx_sender/tests/mod.rs b/core/node/api_server/src/tx_sender/tests/mod.rs index 3d48e320abc..dab10061448 100644 --- a/core/node/api_server/src/tx_sender/tests/mod.rs +++ b/core/node/api_server/src/tx_sender/tests/mod.rs @@ -1,9 +1,9 @@ //! Tests for the transaction sender. use test_casing::TestCases; -use zksync_contracts::test_contracts::LoadnextContractExecutionParams; use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; use zksync_node_test_utils::{create_l2_block, prepare_recovery_snapshot}; +use zksync_test_account::LoadnextContractExecutionParams; use zksync_types::{get_nonce_key, L1BatchNumber, L2BlockNumber, StorageLog}; use zksync_vm_executor::oneshot::MockOneshotExecutor; diff --git a/core/node/state_keeper/src/executor/tests/tester.rs b/core/node/state_keeper/src/executor/tests/tester.rs index 7a1871dbfea..0e71a0e84d6 100644 --- a/core/node/state_keeper/src/executor/tests/tester.rs +++ b/core/node/state_keeper/src/executor/tests/tester.rs @@ -6,10 +6,6 @@ use std::{collections::HashMap, fmt::Debug, sync::Arc}; use tempfile::TempDir; use tokio::{sync::watch, task::JoinHandle}; use zksync_config::configs::chain::StateKeeperConfig; -use zksync_contracts::{ - get_loadnext_contract, load_contract, read_bytecode, - test_contracts::LoadnextContractExecutionParams, TestContract, -}; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_multivm::{ interface::{ @@ -22,7 +18,9 @@ use zksync_multivm::{ use zksync_node_genesis::{create_genesis_l1_batch, GenesisParams}; use zksync_node_test_utils::{recover, Snapshot}; use zksync_state::{OwnedStorage, ReadStorageFactory, RocksdbStorageOptions}; -use zksync_test_account::{Account, DeployContractsTx, TxType}; +use zksync_test_account::{ + Account, DeployContractsTx, LoadnextContractExecutionParams, TestContract, TxType, +}; use zksync_types::{ block::L2BlockHasher, ethabi::Token, @@ -352,26 +350,18 @@ pub trait AccountFailedCall { impl AccountFailedCall for Account { fn deploy_failedcall_tx(&mut self) -> DeployContractsTx { - let bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/failed-call/failed_call.sol/FailedCall.json"); - let failedcall_contract = TestContract { - bytecode, - contract: load_contract("etc/contracts-test-data/artifacts-zk/contracts/failed-call/failed_call.sol/FailedCall.json"), - factory_deps: vec![], - }; - - self.get_deploy_tx(&failedcall_contract.bytecode, None, TxType::L2) + self.get_deploy_tx(&TestContract::failed_call().bytecode, None, TxType::L2) } } impl AccountLoadNextExecutable for Account { fn deploy_loadnext_tx(&mut self) -> DeployContractsTx { - let loadnext_contract = get_loadnext_contract(); + let loadnext_contract = TestContract::load_test(); let loadnext_constructor_data = &[Token::Uint(U256::from(100))]; self.get_deploy_tx_with_factory_deps( &loadnext_contract.bytecode, Some(loadnext_constructor_data), - loadnext_contract.factory_deps.clone(), + loadnext_contract.factory_deps(), TxType::L2, ) } @@ -463,8 +453,7 @@ impl AccountLoadNextExecutable for Account { } pub fn mock_loadnext_gas_burn_calldata(gas: u32) -> Vec { - let loadnext_contract = get_loadnext_contract(); - let contract_function = loadnext_contract.contract.function("burnGas").unwrap(); + let contract_function = TestContract::load_test().abi.function("burnGas").unwrap(); let params = vec![Token::Uint(U256::from(gas))]; contract_function .encode_input(¶ms) diff --git a/core/tests/loadnext/Cargo.toml b/core/tests/loadnext/Cargo.toml index adb5c9eca42..7d4cb2b8c19 100644 --- a/core/tests/loadnext/Cargo.toml +++ b/core/tests/loadnext/Cargo.toml @@ -17,7 +17,7 @@ zksync_eth_signer.workspace = true zksync_web3_decl.workspace = true zksync_eth_client.workspace = true zksync_config.workspace = true -zksync_contracts.workspace = true +zksync_test_account.workspace = true zksync_system_constants.workspace = true zksync_vlog.workspace = true diff --git a/core/tests/loadnext/src/account/mod.rs b/core/tests/loadnext/src/account/mod.rs index 0f418bf1267..dc6c205d282 100644 --- a/core/tests/loadnext/src/account/mod.rs +++ b/core/tests/loadnext/src/account/mod.rs @@ -7,7 +7,7 @@ use std::{ use futures::{channel::mpsc, SinkExt}; use rand::Rng; use tokio::sync::RwLock; -use zksync_contracts::test_contracts::LoadnextContractExecutionParams; +use zksync_test_account::LoadnextContractExecutionParams; use zksync_types::{api::TransactionReceipt, Address, Nonce, H256, U256, U64}; use zksync_web3_decl::{ client::{Client, L2}, diff --git a/core/tests/loadnext/src/config.rs b/core/tests/loadnext/src/config.rs index ab578ecfdc6..93816e5f583 100644 --- a/core/tests/loadnext/src/config.rs +++ b/core/tests/loadnext/src/config.rs @@ -2,7 +2,7 @@ use std::{path::PathBuf, time::Duration}; use serde::Deserialize; use tokio::sync::Semaphore; -use zksync_contracts::test_contracts::LoadnextContractExecutionParams; +use zksync_test_account::LoadnextContractExecutionParams; use zksync_types::{network::Network, Address, L2ChainId, H160}; use zksync_utils::env::Workspace; @@ -281,8 +281,9 @@ impl ExecutionConfig { pub fn from_env() -> Self { let transaction_weights = TransactionWeights::from_env().unwrap_or_else(default_transaction_weights); - let contract_execution_params = LoadnextContractExecutionParams::from_env() - .unwrap_or_else(default_contract_execution_params); + let contract_execution_params = envy::prefixed("CONTRACT_EXECUTION_PARAMS_") + .from_env() + .unwrap_or_else(|_| default_contract_execution_params()); Self { transaction_weights, contract_execution_params, diff --git a/core/tests/vm-benchmark/Cargo.toml b/core/tests/vm-benchmark/Cargo.toml index 4586c637e12..f265c466b7a 100644 --- a/core/tests/vm-benchmark/Cargo.toml +++ b/core/tests/vm-benchmark/Cargo.toml @@ -6,7 +6,8 @@ license.workspace = true publish = false [dependencies] -zksync_contracts.workspace = true +zksync_contracts.workspace = true # FIXME: remove? +zksync_test_account.workspace = true zksync_multivm.workspace = true zksync_types.workspace = true zksync_utils.workspace = true diff --git a/core/tests/vm-benchmark/src/transaction.rs b/core/tests/vm-benchmark/src/transaction.rs index d5fedfa4df9..3df85410cd6 100644 --- a/core/tests/vm-benchmark/src/transaction.rs +++ b/core/tests/vm-benchmark/src/transaction.rs @@ -1,7 +1,8 @@ use once_cell::sync::Lazy; -pub use zksync_contracts::test_contracts::LoadnextContractExecutionParams as LoadTestParams; -use zksync_contracts::{deployer_contract, TestContract}; +use zksync_contracts::deployer_contract; use zksync_multivm::utils::get_max_gas_per_pubdata_byte; +pub use zksync_test_account::LoadnextContractExecutionParams as LoadTestParams; +use zksync_test_account::TestContract; use zksync_types::{ ethabi::{encode, Token}, fee::Fee, @@ -19,8 +20,6 @@ pub(crate) static PRIVATE_KEY: Lazy = static LOAD_TEST_CONTRACT_ADDRESS: Lazy
= Lazy::new(|| deployed_address_create(PRIVATE_KEY.address(), 0.into())); -static LOAD_TEST_CONTRACT: Lazy = Lazy::new(zksync_contracts::get_loadnext_contract); - static CREATE_FUNCTION_SIGNATURE: Lazy<[u8; 4]> = Lazy::new(|| { deployer_contract() .function("create") @@ -96,7 +95,11 @@ pub fn get_load_test_deploy_tx() -> Transaction { let calldata = [Token::Uint(LOAD_TEST_MAX_READS.into())]; let params = [ Token::FixedBytes(vec![0_u8; 32]), - Token::FixedBytes(hash_bytecode(&LOAD_TEST_CONTRACT.bytecode).0.to_vec()), + Token::FixedBytes( + hash_bytecode(&TestContract::load_test().bytecode) + .0 + .to_vec(), + ), Token::Bytes(encode(&calldata)), ]; let create_calldata = CREATE_FUNCTION_SIGNATURE @@ -105,8 +108,8 @@ pub fn get_load_test_deploy_tx() -> Transaction { .chain(encode(¶ms)) .collect(); - let mut factory_deps = LOAD_TEST_CONTRACT.factory_deps.clone(); - factory_deps.push(LOAD_TEST_CONTRACT.bytecode.clone()); + let mut factory_deps: Vec<_> = TestContract::load_test().factory_deps(); + factory_deps.push(TestContract::load_test().bytecode.clone()); let mut signed = L2Tx::new_signed( Some(CONTRACT_DEPLOYER_ADDRESS), @@ -131,8 +134,8 @@ pub fn get_load_test_tx(nonce: u32, gas_limit: u32, params: LoadTestParams) -> T "Too many reads: {params:?}, should be <={LOAD_TEST_MAX_READS}" ); - let execute_function = LOAD_TEST_CONTRACT - .contract + let execute_function = TestContract::load_test() + .abi .function("execute") .expect("no `execute` function in load test contract"); let calldata = execute_function @@ -154,7 +157,7 @@ pub fn get_load_test_tx(nonce: u32, gas_limit: u32, params: LoadTestParams) -> T U256::zero(), L2ChainId::from(270), &PRIVATE_KEY, - LOAD_TEST_CONTRACT.factory_deps.clone(), + TestContract::load_test().factory_deps(), Default::default(), ) .expect("should create a signed execute transaction"); From 578e2e5a43874b4e07f644ba73699e9f43aca226 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 3 Oct 2024 15:28:07 +0300 Subject: [PATCH 03/32] Sketch more adequate deployment --- core/lib/types/src/tx/execute.rs | 26 ++++++- core/tests/test_account/src/contracts.rs | 12 ++- core/tests/vm-benchmark/Cargo.toml | 2 +- core/tests/vm-benchmark/src/transaction.rs | 86 +++------------------- core/tests/vm-benchmark/src/vm.rs | 8 +- 5 files changed, 47 insertions(+), 87 deletions(-) diff --git a/core/lib/types/src/tx/execute.rs b/core/lib/types/src/tx/execute.rs index c133261bc23..1cbbe5abf71 100644 --- a/core/lib/types/src/tx/execute.rs +++ b/core/lib/types/src/tx/execute.rs @@ -1,6 +1,7 @@ use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; -use zksync_utils::ZeroPrefixHexSerde; +use zksync_system_constants::CONTRACT_DEPLOYER_ADDRESS; +use zksync_utils::{bytecode::hash_bytecode, ZeroPrefixHexSerde}; use crate::{ethabi, Address, EIP712TypedStructure, StructBuilder, H256, U256}; @@ -89,8 +90,7 @@ impl Execute { &self.calldata } - /// Prepares calldata to invoke deployer contract. - /// This method encodes parameters for the `create` method. + /// Prepares calldata to invoke deployer contract. This method encodes parameters for the `create` method. pub fn encode_deploy_params_create( salt: H256, contract_hash: H256, @@ -116,4 +116,24 @@ impl Execute { FUNCTION_SIGNATURE.iter().copied().chain(params).collect() } + + /// Creates an instance for deploying the specified bytecode without additional dependencies. (If necessary, + /// additional deps can be added after this call.) + pub fn for_deploy( + salt: H256, + contract_bytecode: Vec, + constructor_input: &[ethabi::Token], + ) -> Self { + let bytecode_hash = hash_bytecode(&contract_bytecode); + Self { + contract_address: Some(CONTRACT_DEPLOYER_ADDRESS), + calldata: Self::encode_deploy_params_create( + salt, + bytecode_hash, + ethabi::encode(constructor_input), + ), + value: 0.into(), + factory_deps: vec![contract_bytecode], + } + } } diff --git a/core/tests/test_account/src/contracts.rs b/core/tests/test_account/src/contracts.rs index 8176e2c1a8e..10584504e1e 100644 --- a/core/tests/test_account/src/contracts.rs +++ b/core/tests/test_account/src/contracts.rs @@ -3,7 +3,7 @@ use ethabi::Token; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; -use zksync_types::U256; +use zksync_types::{Execute, H256, U256}; macro_rules! include_contract { ($file_name:tt :: $contract_name:tt) => { @@ -114,6 +114,16 @@ impl TestContract { deployed.insert_factory_deps(dest); } } + + pub fn deploy_payload(&self, args: &[Token]) -> Execute { + self.deploy_payload_with_salt(H256::zero(), args) + } + + pub fn deploy_payload_with_salt(&self, salt: H256, args: &[Token]) -> Execute { + let mut execute = Execute::for_deploy(salt, self.bytecode.clone(), args); + execute.factory_deps.extend(self.factory_deps()); + execute + } } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/core/tests/vm-benchmark/Cargo.toml b/core/tests/vm-benchmark/Cargo.toml index f265c466b7a..326311b1280 100644 --- a/core/tests/vm-benchmark/Cargo.toml +++ b/core/tests/vm-benchmark/Cargo.toml @@ -6,7 +6,7 @@ license.workspace = true publish = false [dependencies] -zksync_contracts.workspace = true # FIXME: remove? +zksync_contracts.workspace = true zksync_test_account.workspace = true zksync_multivm.workspace = true zksync_types.workspace = true diff --git a/core/tests/vm-benchmark/src/transaction.rs b/core/tests/vm-benchmark/src/transaction.rs index 3df85410cd6..d3053bc69ab 100644 --- a/core/tests/vm-benchmark/src/transaction.rs +++ b/core/tests/vm-benchmark/src/transaction.rs @@ -1,17 +1,11 @@ use once_cell::sync::Lazy; -use zksync_contracts::deployer_contract; use zksync_multivm::utils::get_max_gas_per_pubdata_byte; pub use zksync_test_account::LoadnextContractExecutionParams as LoadTestParams; -use zksync_test_account::TestContract; +use zksync_test_account::{Account, TestContract}; use zksync_types::{ - ethabi::{encode, Token}, - fee::Fee, - l2::L2Tx, - utils::deployed_address_create, - Address, K256PrivateKey, L2ChainId, Nonce, ProtocolVersionId, Transaction, - CONTRACT_DEPLOYER_ADDRESS, H256, U256, + ethabi::Token, fee::Fee, l2::L2Tx, utils::deployed_address_create, Address, Execute, + K256PrivateKey, L2ChainId, Nonce, ProtocolVersionId, Transaction, H256, U256, }; -use zksync_utils::bytecode::hash_bytecode; const LOAD_TEST_MAX_READS: usize = 100; @@ -20,46 +14,15 @@ pub(crate) static PRIVATE_KEY: Lazy = static LOAD_TEST_CONTRACT_ADDRESS: Lazy
= Lazy::new(|| deployed_address_create(PRIVATE_KEY.address(), 0.into())); -static CREATE_FUNCTION_SIGNATURE: Lazy<[u8; 4]> = Lazy::new(|| { - deployer_contract() - .function("create") - .unwrap() - .short_signature() -}); - pub fn get_deploy_tx(code: &[u8]) -> Transaction { get_deploy_tx_with_gas_limit(code, 30_000_000, 0) } pub fn get_deploy_tx_with_gas_limit(code: &[u8], gas_limit: u32, nonce: u32) -> Transaction { - let mut salt = vec![0_u8; 32]; - salt[28..32].copy_from_slice(&nonce.to_be_bytes()); - let params = [ - Token::FixedBytes(salt), - Token::FixedBytes(hash_bytecode(code).0.to_vec()), - Token::Bytes([].to_vec()), - ]; - let calldata = CREATE_FUNCTION_SIGNATURE - .iter() - .cloned() - .chain(encode(¶ms)) - .collect(); - - let mut signed = L2Tx::new_signed( - Some(CONTRACT_DEPLOYER_ADDRESS), - calldata, - Nonce(nonce), - tx_fee(gas_limit), - U256::zero(), - L2ChainId::from(270), - &PRIVATE_KEY, - vec![code.to_vec()], // maybe not needed? - Default::default(), - ) - .expect("should create a signed execute transaction"); - - signed.set_input(H256::random().as_bytes().to_vec(), H256::random()); - signed.into() + let mut salt = H256::zero(); + salt.0[28..32].copy_from_slice(&nonce.to_be_bytes()); + let execute = Execute::for_deploy(salt, code.to_vec(), &[]); + Account::new(PRIVATE_KEY.clone()).get_l2_tx_for_execute(execute, Some(tx_fee(gas_limit))) } fn tx_fee(gas_limit: u32) -> Fee { @@ -93,39 +56,8 @@ pub fn get_transfer_tx(nonce: u32) -> Transaction { pub fn get_load_test_deploy_tx() -> Transaction { let calldata = [Token::Uint(LOAD_TEST_MAX_READS.into())]; - let params = [ - Token::FixedBytes(vec![0_u8; 32]), - Token::FixedBytes( - hash_bytecode(&TestContract::load_test().bytecode) - .0 - .to_vec(), - ), - Token::Bytes(encode(&calldata)), - ]; - let create_calldata = CREATE_FUNCTION_SIGNATURE - .iter() - .cloned() - .chain(encode(¶ms)) - .collect(); - - let mut factory_deps: Vec<_> = TestContract::load_test().factory_deps(); - factory_deps.push(TestContract::load_test().bytecode.clone()); - - let mut signed = L2Tx::new_signed( - Some(CONTRACT_DEPLOYER_ADDRESS), - create_calldata, - Nonce(0), - tx_fee(100_000_000), - U256::zero(), - L2ChainId::from(270), - &PRIVATE_KEY, - factory_deps, - Default::default(), - ) - .expect("should create a signed execute transaction"); - - signed.set_input(H256::random().as_bytes().to_vec(), H256::random()); - signed.into() + let execute = TestContract::load_test().deploy_payload(&calldata); + Account::new(PRIVATE_KEY.clone()).get_l2_tx_for_execute(execute, Some(tx_fee(100_000_000))) } pub fn get_load_test_tx(nonce: u32, gas_limit: u32, params: LoadTestParams) -> Transaction { diff --git a/core/tests/vm-benchmark/src/vm.rs b/core/tests/vm-benchmark/src/vm.rs index f4a0010f29e..d3f37014438 100644 --- a/core/tests/vm-benchmark/src/vm.rs +++ b/core/tests/vm-benchmark/src/vm.rs @@ -193,8 +193,8 @@ impl BenchmarkingVm { #[cfg(test)] mod tests { use assert_matches::assert_matches; - use zksync_contracts::read_bytecode; use zksync_multivm::interface::ExecutionResult; + use zksync_test_account::TestContract; use super::*; use crate::{ @@ -204,11 +204,9 @@ mod tests { #[test] fn can_deploy_contract() { - let test_contract = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/counter/counter.sol/Counter.json", - ); + let test_contract = &TestContract::counter().bytecode; let mut vm = BenchmarkingVm::new(); - let res = vm.run_transaction(&get_deploy_tx(&test_contract)); + let res = vm.run_transaction(&get_deploy_tx(test_contract)); assert_matches!(res.result, ExecutionResult::Success { .. }); } From a400cce3eb76022a0900c286c1df0be9adcb9cb4 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 3 Oct 2024 16:17:54 +0300 Subject: [PATCH 04/32] Use test contracts in `multivm` tests --- .../src/versions/vm_latest/tests/block_tip.rs | 6 +- .../vm_latest/tests/bytecode_publishing.rs | 11 ++- .../versions/vm_latest/tests/call_tracer.rs | 10 +-- .../versions/vm_latest/tests/code_oracle.rs | 35 ++++----- .../versions/vm_latest/tests/default_aa.rs | 7 +- .../vm_latest/tests/get_used_contracts.rs | 18 +++-- .../vm_latest/tests/is_write_initial.rs | 12 ++- .../vm_latest/tests/l1_tx_execution.rs | 11 ++- .../src/versions/vm_latest/tests/migration.rs | 10 +-- .../versions/vm_latest/tests/nonce_holder.rs | 8 +- .../versions/vm_latest/tests/precompiles.rs | 9 +-- .../vm_latest/tests/prestate_tracer.rs | 13 ++-- .../src/versions/vm_latest/tests/refunds.rs | 13 ++-- .../vm_latest/tests/require_eip712.rs | 13 ++-- .../src/versions/vm_latest/tests/rollbacks.rs | 13 ++-- .../src/versions/vm_latest/tests/storage.rs | 20 ++--- .../vm_latest/tests/tester/vm_tester.rs | 11 +-- .../tests/tracing_execution_error.rs | 13 +++- .../src/versions/vm_latest/tests/transfer.rs | 47 +++++------- .../src/versions/vm_latest/tests/upgrade.rs | 29 ++++--- .../src/versions/vm_latest/tests/utils.rs | 75 +------------------ core/tests/test_account/src/contracts.rs | 66 ++++++++++++++++ core/tests/test_account/src/lib.rs | 23 ++---- 23 files changed, 213 insertions(+), 260 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs index 9909ca24937..c6bdb3fb080 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs @@ -7,13 +7,13 @@ use zksync_contracts::load_sys_contract; use zksync_system_constants::{ CONTRACT_FORCE_DEPLOYER_ADDRESS, KNOWN_CODES_STORAGE_ADDRESS, L1_MESSENGER_ADDRESS, }; +use zksync_test_account::TestContract; use zksync_types::{ commitment::SerializeCommitment, fee_model::BatchFeeInput, get_code_key, l2_to_l1_log::L2ToL1Log, writes::StateDiffRecord, Address, Execute, H256, U256, }; use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256, u256_to_h256}; -use super::utils::{get_complex_upgrade_abi, read_complex_upgrade}; use crate::{ interface::{L1BatchEnv, TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, vm_latest::{ @@ -46,7 +46,7 @@ struct MimicCallInfo { const CALLS_PER_TX: usize = 1_000; fn populate_mimic_calls(data: L1MessengerTestData) -> Vec> { - let complex_upgrade = get_complex_upgrade_abi(); + let complex_upgrade = &TestContract::complex_upgrade().abi; let l1_messenger = load_sys_contract("L1Messenger"); let logs_mimic_calls = (0..data.l2_to_l1_logs).map(|_| MimicCallInfo { @@ -118,7 +118,7 @@ struct StatisticsTagged { fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { let mut storage = get_empty_storage(); - let complex_upgrade_code = read_complex_upgrade(); + let complex_upgrade_code = TestContract::complex_upgrade().bytecode.clone(); // For this test we'll just put the bytecode onto the force deployer address storage.borrow_mut().set_value( diff --git a/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs b/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs index 2ed9948af81..72fab95243e 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs @@ -1,11 +1,10 @@ +use zksync_test_account::TestContract; + use crate::{ interface::{TxExecutionMode, VmEvent, VmExecutionMode, VmInterface, VmInterfaceExt}, utils::bytecode, vm_latest::{ - tests::{ - tester::{DeployContractsTx, TxType, VmTesterBuilder}, - utils::read_test_contract, - }, + tests::tester::{DeployContractsTx, TxType, VmTesterBuilder}, HistoryEnabled, }, }; @@ -20,12 +19,12 @@ fn test_bytecode_publishing() { .with_random_rich_accounts(1) .build(); - let counter = read_test_contract(); + let counter = &TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; let compressed_bytecode = bytecode::compress(counter.clone()).unwrap().compressed; - let DeployContractsTx { tx, .. } = account.get_deploy_tx(&counter, None, TxType::L2); + let DeployContractsTx { tx, .. } = account.get_deploy_tx(counter, None, TxType::L2); vm.vm.push_transaction(tx); let result = vm.vm.execute(VmExecutionMode::OneTx); assert!(!result.result.is_failed(), "Transaction wasn't successful"); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs index e7f26b7faf8..8455336dc64 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use once_cell::sync::OnceCell; +use zksync_test_account::TestContract; use zksync_types::{Address, Execute}; use crate::{ @@ -8,10 +9,7 @@ use crate::{ tracers::CallTracer, vm_latest::{ constants::BATCH_COMPUTATIONAL_GAS_LIMIT, - tests::{ - tester::VmTesterBuilder, - utils::{read_max_depth_contract, read_test_contract}, - }, + tests::{tester::VmTesterBuilder, utils::read_max_depth_contract}, HistoryEnabled, ToTracerPointer, }, }; @@ -54,7 +52,7 @@ fn test_max_depth() { #[test] fn test_basic_behavior() { - let contarct = read_test_contract(); + let contract = TestContract::counter().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() @@ -62,7 +60,7 @@ fn test_basic_behavior() { .with_deployer() .with_bootloader_gas_limit(BATCH_COMPUTATIONAL_GAS_LIMIT) .with_execution_mode(TxExecutionMode::VerifyExecute) - .with_custom_contracts(vec![(contarct, address, true)]) + .with_custom_contracts(vec![(contract, address, true)]) .build(); let increment_by_6_calldata = diff --git a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs index b15ef7fde2b..e838eb5fdd6 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs @@ -3,6 +3,7 @@ use zk_evm_1_5_0::{ aux_structures::{MemoryPage, Timestamp}, zkevm_opcode_defs::{ContractCodeSha256Format, VersionedHashLen32}, }; +use zksync_test_account::TestContract; use zksync_types::{ get_known_code_key, web3::keccak256, Address, Execute, StorageLogWithPreviousValue, U256, }; @@ -11,10 +12,7 @@ use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256, u25 use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, vm_latest::{ - tests::{ - tester::{get_empty_storage, VmTesterBuilder}, - utils::{load_precompiles_contract, read_precompiles_contract, read_test_contract}, - }, + tests::tester::{get_empty_storage, VmTesterBuilder}, HistoryEnabled, }, }; @@ -27,12 +25,12 @@ fn generate_large_bytecode() -> Vec { #[test] fn test_code_oracle() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = read_precompiles_contract(); + let precompile_contract_bytecode = TestContract::precompiles().bytecode.clone(); // Filling the zkevm bytecode - let normal_zkevm_bytecode = read_test_contract(); - let normal_zkevm_bytecode_hash = hash_bytecode(&normal_zkevm_bytecode); - let normal_zkevm_bytecode_keccak_hash = keccak256(&normal_zkevm_bytecode); + let normal_zkevm_bytecode = &TestContract::counter().bytecode; + let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); + let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); let mut storage = get_empty_storage(); storage.set_value( get_known_code_key(&normal_zkevm_bytecode_hash), @@ -53,13 +51,13 @@ fn test_code_oracle() { .with_storage(storage) .build(); - let precompile_contract = load_precompiles_contract(); + let precompile_contract = &TestContract::precompiles().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); vm.vm.state.decommittment_processor.populate( vec![( h256_to_u256(normal_zkevm_bytecode_hash), - bytes_to_be_words(normal_zkevm_bytecode), + bytes_to_be_words(normal_zkevm_bytecode.clone()), )], Timestamp(0), ); @@ -127,7 +125,7 @@ fn find_code_oracle_cost_log( #[test] fn test_code_oracle_big_bytecode() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = read_precompiles_contract(); + let precompile_contract_bytecode = TestContract::precompiles().bytecode.clone(); let big_zkevm_bytecode = generate_large_bytecode(); let big_zkevm_bytecode_hash = hash_bytecode(&big_zkevm_bytecode); @@ -153,7 +151,7 @@ fn test_code_oracle_big_bytecode() { .with_storage(storage) .build(); - let precompile_contract = load_precompiles_contract(); + let precompile_contract = &TestContract::precompiles().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); vm.vm.state.decommittment_processor.populate( @@ -190,19 +188,18 @@ fn test_code_oracle_big_bytecode() { #[test] fn refunds_in_code_oracle() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = read_precompiles_contract(); - let normal_zkevm_bytecode = read_test_contract(); - let normal_zkevm_bytecode_hash = hash_bytecode(&normal_zkevm_bytecode); - let normal_zkevm_bytecode_keccak_hash = keccak256(&normal_zkevm_bytecode); - let normal_zkevm_bytecode_words = bytes_to_be_words(normal_zkevm_bytecode); + let normal_zkevm_bytecode = &TestContract::counter().bytecode; + let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); + let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); + let normal_zkevm_bytecode_words = bytes_to_be_words(normal_zkevm_bytecode.clone()); let mut storage = get_empty_storage(); storage.set_value( get_known_code_key(&normal_zkevm_bytecode_hash), u256_to_h256(U256::one()), ); - let precompile_contract = load_precompiles_contract(); + let precompile_contract = &TestContract::precompiles().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); // Execute code oracle twice with identical VM state that only differs in that the queried bytecode @@ -214,7 +211,7 @@ fn refunds_in_code_oracle() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![( - precompile_contract_bytecode.clone(), + TestContract::precompiles().bytecode.clone(), precompiles_contract_address, false, )]) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/default_aa.rs b/core/lib/multivm/src/versions/vm_latest/tests/default_aa.rs index aa3eb5e752c..edc2b5c3d9c 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/default_aa.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/default_aa.rs @@ -1,4 +1,5 @@ use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; +use zksync_test_account::TestContract; use zksync_types::{ get_code_key, get_known_code_key, get_nonce_key, system_contracts::{DEPLOYMENT_NONCE_INCREMENT, TX_NONCE_INCREMENT}, @@ -11,7 +12,7 @@ use crate::{ vm_latest::{ tests::{ tester::{DeployContractsTx, TxType, VmTesterBuilder}, - utils::{get_balance, read_test_contract, verify_required_storage}, + utils::{get_balance, verify_required_storage}, }, utils::fee::get_batch_base_fee, HistoryEnabled, @@ -28,13 +29,13 @@ fn test_default_aa_interaction() { .with_random_rich_accounts(1) .build(); - let counter = read_test_contract(); + let counter = &TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; let DeployContractsTx { tx, bytecode_hash, address, - } = account.get_deploy_tx(&counter, None, TxType::L2); + } = account.get_deploy_tx(counter, None, TxType::L2); let maximal_fee = tx.gas_limit() * get_batch_base_fee(&vm.vm.batch_env); vm.vm.push_transaction(tx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs index ef19717a627..bc4863c9276 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs @@ -14,7 +14,7 @@ use zk_evm_1_5_0::{ zkevm_opcode_defs::{VersionedHashHeader, VersionedHashNormalizedPreimage}, }; use zksync_system_constants::CONTRACT_DEPLOYER_ADDRESS; -use zksync_test_account::Account; +use zksync_test_account::{Account, TestContract}; use zksync_types::{Address, Execute, U256}; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; use zksync_vm_interface::VmExecutionResultAndLogs; @@ -27,7 +27,7 @@ use crate::{ vm_latest::{ tests::{ tester::{TxType, VmTester, VmTesterBuilder}, - utils::{read_proxy_counter_contract, read_test_contract, BASE_SYSTEM_CONTRACTS}, + utils::BASE_SYSTEM_CONTRACTS, }, HistoryDisabled, Vm, }, @@ -45,9 +45,9 @@ fn test_get_used_contracts() { // create and push and execute some not-empty factory deps transaction with success status // to check that `get_used_contracts()` updates - let contract_code = read_test_contract(); + let contract_code = &TestContract::counter().bytecode; let mut account = Account::random(); - let tx = account.get_deploy_tx(&contract_code, None, TxType::L1 { serial_id: 0 }); + let tx = account.get_deploy_tx(contract_code, None, TxType::L1 { serial_id: 0 }); vm.vm.push_transaction(tx.tx.clone()); let result = vm.vm.execute(VmExecutionMode::OneTx); assert!(!result.result.is_failed()); @@ -165,7 +165,7 @@ fn known_bytecodes_without_aa_code( /// Counter test contract bytecode inflated by appending lots of `NOP` opcodes at the end. This leads to non-trivial /// decommitment cost (>10,000 gas). fn inflated_counter_bytecode() -> Vec { - let mut counter_bytecode = read_test_contract(); + let mut counter_bytecode = TestContract::counter().bytecode.clone(); counter_bytecode.extend( iter::repeat(EncodingModeProduction::nop_encoding().to_be_bytes()) .take(10_000) @@ -186,10 +186,9 @@ fn execute_proxy_counter(gas: u32) -> (VmTester, U256, VmExecut .with_random_rich_accounts(1) .build(); - let (proxy_counter_bytecode, proxy_counter_abi) = read_proxy_counter_contract(); let account = &mut vm.rich_accounts[0]; let deploy_tx = account.get_deploy_tx( - &proxy_counter_bytecode, + &TestContract::proxy_counter().bytecode, Some(&[Token::Address(counter_address)]), TxType::L2, ); @@ -205,7 +204,10 @@ fn execute_proxy_counter(gas: u32) -> (VmTester, U256, VmExecut "{decommitted_hashes:?}" ); - let increment = proxy_counter_abi.function("increment").unwrap(); + let increment = TestContract::proxy_counter() + .abi + .function("increment") + .unwrap(); let increment_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(deploy_tx.address), diff --git a/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs b/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs index 8206cfa9be6..9f3f0309ff2 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs @@ -1,3 +1,4 @@ +use zksync_test_account::TestContract; use zksync_types::get_nonce_key; use crate::{ @@ -5,10 +6,7 @@ use crate::{ storage::ReadStorage, TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt, }, vm_latest::{ - tests::{ - tester::{Account, TxType, VmTesterBuilder}, - utils::read_test_contract, - }, + tests::tester::{Account, TxType, VmTesterBuilder}, HistoryDisabled, }, }; @@ -34,9 +32,9 @@ fn test_is_write_initial_behaviour() { .borrow_mut() .is_write_initial(&nonce_key)); - let contract_code = read_test_contract(); - let tx = account.get_deploy_tx(&contract_code, None, TxType::L2).tx; - + let tx = account + .get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2) + .tx; vm.vm.push_transaction(tx); vm.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs b/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs index 0fc12848227..509acfe7ef1 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs @@ -1,7 +1,7 @@ use ethabi::Token; use zksync_contracts::l1_messenger_contract; use zksync_system_constants::{BOOTLOADER_ADDRESS, L1_MESSENGER_ADDRESS}; -use zksync_test_account::Account; +use zksync_test_account::{Account, TestContract}; use zksync_types::{ get_code_key, get_known_code_key, l2_to_l1_log::{L2ToL1Log, UserL2ToL1Log}, @@ -15,7 +15,7 @@ use crate::{ vm_latest::{ tests::{ tester::{TxType, VmTesterBuilder}, - utils::{read_test_contract, verify_required_storage, BASE_SYSTEM_CONTRACTS}, + utils::{verify_required_storage, BASE_SYSTEM_CONTRACTS}, }, types::internals::TransactionData, HistoryEnabled, @@ -49,9 +49,12 @@ fn test_l1_tx_execution() { .with_random_rich_accounts(1) .build(); - let contract_code = read_test_contract(); let account = &mut vm.rich_accounts[0]; - let deploy_tx = account.get_deploy_tx(&contract_code, None, TxType::L1 { serial_id: 1 }); + let deploy_tx = account.get_deploy_tx( + &TestContract::counter().bytecode, + None, + TxType::L1 { serial_id: 1 }, + ); let tx_data: TransactionData = deploy_tx.tx.clone().into(); let required_l2_to_l1_logs: Vec<_> = vec![L2ToL1Log { diff --git a/core/lib/multivm/src/versions/vm_latest/tests/migration.rs b/core/lib/multivm/src/versions/vm_latest/tests/migration.rs index 5b8da255180..691c91e31df 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/migration.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/migration.rs @@ -1,12 +1,10 @@ +use zksync_test_account::TestContract; use zksync_types::{get_code_key, H256, SYSTEM_CONTEXT_ADDRESS}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, vm_latest::{ - tests::{ - tester::{get_empty_storage, DeployContractsTx, TxType, VmTesterBuilder}, - utils::read_test_contract, - }, + tests::tester::{get_empty_storage, DeployContractsTx, TxType, VmTesterBuilder}, HistoryEnabled, }, }; @@ -31,8 +29,8 @@ fn test_migration_for_system_context_aa_interaction() { // The bootloader should be able to update system context regardless of whether // the upgrade transaction is there or not. let account = &mut vm.rich_accounts[0]; - let counter = read_test_contract(); - let DeployContractsTx { tx, .. } = account.get_deploy_tx(&counter, None, TxType::L2); + let DeployContractsTx { tx, .. } = + account.get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2); vm.vm.push_transaction(tx); let result = vm.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs b/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs index 91d78c69a93..2f998aca51a 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs @@ -1,3 +1,4 @@ +use zksync_test_account::TestContract; use zksync_types::{Execute, Nonce}; use crate::{ @@ -6,10 +7,7 @@ use crate::{ VmRevertReason, }, vm_latest::{ - tests::{ - tester::{Account, VmTesterBuilder}, - utils::read_nonce_holder_tester, - }, + tests::tester::{Account, VmTesterBuilder}, types::internals::TransactionData, HistoryEnabled, }, @@ -46,7 +44,7 @@ fn test_nonce_holder() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_deployer() .with_custom_contracts(vec![( - read_nonce_holder_tester().to_vec(), + TestContract::nonce_holder().bytecode.clone(), account.address, true, )]) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs index 110b14146c7..be03fb5bbc6 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs @@ -1,19 +1,18 @@ use zk_evm_1_5_0::zk_evm_abstractions::precompiles::PrecompileAddress; +use zksync_test_account::TestContract; use zksync_types::{Address, Execute}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface}, vm_latest::{ - constants::BATCH_COMPUTATIONAL_GAS_LIMIT, - tests::{tester::VmTesterBuilder, utils::read_precompiles_contract}, - HistoryEnabled, + constants::BATCH_COMPUTATIONAL_GAS_LIMIT, tests::tester::VmTesterBuilder, HistoryEnabled, }, }; #[test] fn test_keccak() { // Execute special transaction and check that at least 1000 keccak calls were made. - let contract = read_precompiles_contract(); + let contract = TestContract::precompiles().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() @@ -59,7 +58,7 @@ fn test_keccak() { #[test] fn test_sha256() { // Execute special transaction and check that at least 1000 `sha256` calls were made. - let contract = read_precompiles_contract(); + let contract = TestContract::precompiles().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs index 230b1d0ad87..7f1d7f0c616 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs @@ -1,16 +1,15 @@ use std::sync::Arc; use once_cell::sync::OnceCell; -use zksync_test_account::TxType; +use zksync_test_account::{TestContract, TxType}; use zksync_types::{utils::deployed_address_create, Execute, U256}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, tracers::PrestateTracer, vm_latest::{ - constants::BATCH_COMPUTATIONAL_GAS_LIMIT, - tests::{tester::VmTesterBuilder, utils::read_simple_transfer_contract}, - HistoryEnabled, ToTracerPointer, + constants::BATCH_COMPUTATIONAL_GAS_LIMIT, tests::tester::VmTesterBuilder, HistoryEnabled, + ToTracerPointer, }, }; @@ -60,12 +59,12 @@ fn test_prestate_tracer_diff_mode() { .with_bootloader_gas_limit(BATCH_COMPUTATIONAL_GAS_LIMIT) .with_execution_mode(TxExecutionMode::VerifyExecute) .build(); - let contract = read_simple_transfer_contract(); + let contract = &TestContract::simple_transfer().bytecode; let tx = vm .deployer .as_mut() .expect("You have to initialize builder with deployer") - .get_deploy_tx(&contract, None, TxType::L2) + .get_deploy_tx(contract, None, TxType::L2) .tx; let nonce = tx.nonce().unwrap().0.into(); vm.vm.push_transaction(tx); @@ -78,7 +77,7 @@ fn test_prestate_tracer_diff_mode() { .deployer .as_mut() .expect("You have to initialize builder with deployer") - .get_deploy_tx(&contract, None, TxType::L2) + .get_deploy_tx(contract, None, TxType::L2) .tx; let nonce2 = tx2.nonce().unwrap().0.into(); vm.vm.push_transaction(tx2); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs b/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs index cc0085f2025..223d64a388d 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs @@ -1,13 +1,11 @@ use ethabi::Token; +use zksync_test_account::TestContract; use zksync_types::{Address, Execute, U256}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, vm_latest::{ - tests::{ - tester::{DeployContractsTx, TxType, VmTesterBuilder}, - utils::{read_expensive_contract, read_test_contract}, - }, + tests::tester::{DeployContractsTx, TxType, VmTesterBuilder}, types::internals::TransactionData, HistoryEnabled, }, @@ -25,14 +23,13 @@ fn test_predetermined_refunded_gas() { .build(); let l1_batch = vm.vm.batch_env.clone(); - let counter = read_test_contract(); let account = &mut vm.rich_accounts[0]; let DeployContractsTx { tx, bytecode_hash: _, address: _, - } = account.get_deploy_tx(&counter, None, TxType::L2); + } = account.get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2); vm.vm.push_transaction(tx.clone()); let result = vm.vm.execute(VmExecutionMode::OneTx); @@ -171,7 +168,7 @@ fn test_predetermined_refunded_gas() { #[test] fn negative_pubdata_for_transaction() { let expensive_contract_address = Address::random(); - let (expensive_contract_bytecode, expensive_contract) = read_expensive_contract(); + let expensive_contract = &TestContract::expensive().abi; let expensive_function = expensive_contract.function("expensive").unwrap(); let cleanup_function = expensive_contract.function("cleanUp").unwrap(); @@ -180,7 +177,7 @@ fn negative_pubdata_for_transaction() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![( - expensive_contract_bytecode, + TestContract::expensive().bytecode.clone(), expensive_contract_address, false, )]) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs index a6dc7118005..8d1eea40079 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs @@ -1,6 +1,7 @@ use ethabi::Token; use zksync_eth_signer::TransactionParameters; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; +use zksync_test_account::TestContract; use zksync_types::{ fee::Fee, l2::L2Tx, transaction_request::TransactionRequest, utils::storage_key_for_standard_token_balance, AccountTreeId, Address, Eip712Domain, Execute, @@ -10,10 +11,7 @@ use zksync_types::{ use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, vm_latest::{ - tests::{ - tester::{Account, VmTester, VmTesterBuilder}, - utils::read_many_owners_custom_account_contract, - }, + tests::tester::{Account, VmTester, VmTesterBuilder}, HistoryDisabled, }, }; @@ -42,7 +40,7 @@ fn test_require_eip712() { let mut private_account = Account::random(); let beneficiary = Account::random(); - let (bytecode, contract) = read_many_owners_custom_account_contract(); + let bytecode = TestContract::many_owners().bytecode.clone(); let mut vm = VmTesterBuilder::new(HistoryDisabled) .with_empty_in_memory_storage() .with_custom_contracts(vec![(bytecode, account_abstraction.address, true)]) @@ -56,7 +54,10 @@ fn test_require_eip712() { // First, let's set the owners of the AA account to the `private_address`. // (so that messages signed by `private_address`, are authorized to act on behalf of the AA account). - let set_owners_function = contract.function("setOwners").unwrap(); + let set_owners_function = TestContract::many_owners() + .abi + .function("setOwners") + .unwrap(); let encoded_input = set_owners_function .encode_input(&[Token::Array(vec![Token::Address(private_account.address)])]) .unwrap(); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs index 4b854f306cf..552cb853cb5 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs @@ -12,9 +12,8 @@ use crate::{ }, tracers::dynamic::vm_1_5_0::DynTracer, vm_latest::{ - tests::{ - tester::{DeployContractsTx, TransactionTestInfo, TxModifier, TxType, VmTesterBuilder}, - utils::read_test_contract, + tests::tester::{ + DeployContractsTx, TransactionTestInfo, TxModifier, TxType, VmTesterBuilder, }, types::internals::ZkSyncVmState, BootloaderState, HistoryEnabled, HistoryMode, SimpleMemory, ToTracerPointer, VmTracer, @@ -30,10 +29,10 @@ fn test_vm_rollbacks() { .build(); let mut account = vm.rich_accounts[0].clone(); - let counter = read_test_contract(); - let tx_0 = account.get_deploy_tx(&counter, None, TxType::L2).tx; - let tx_1 = account.get_deploy_tx(&counter, None, TxType::L2).tx; - let tx_2 = account.get_deploy_tx(&counter, None, TxType::L2).tx; + let counter = &TestContract::counter().bytecode; + let tx_0 = account.get_deploy_tx(counter, None, TxType::L2).tx; + let tx_1 = account.get_deploy_tx(counter, None, TxType::L2).tx; + let tx_2 = account.get_deploy_tx(counter, None, TxType::L2).tx; let result_without_rollbacks = vm.execute_and_verify_txs(&vec![ TransactionTestInfo::new_processed(tx_0.clone(), false), diff --git a/core/lib/multivm/src/versions/vm_latest/tests/storage.rs b/core/lib/multivm/src/versions/vm_latest/tests/storage.rs index 126d174a646..d03c06ea85b 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/storage.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/storage.rs @@ -1,6 +1,5 @@ use ethabi::Token; -use zksync_contracts::{load_contract, read_bytecode}; -use zksync_test_account::Account; +use zksync_test_account::{Account, TestContract}; use zksync_types::{fee::Fee, Address, Execute, U256}; use crate::{ @@ -19,10 +18,7 @@ struct TestTxInfo { } fn test_storage(txs: Vec) -> u32 { - let bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); - + let bytecode = TestContract::storage_test().bytecode.clone(); let test_contract_address = Address::random(); // In this test, we aim to test whether a simple account interaction (without any fee logic) @@ -87,9 +83,7 @@ fn test_storage_one_tx(second_tx_calldata: Vec) -> u32 { #[test] fn test_storage_behavior() { - let contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); + let contract = &TestContract::storage_test().abi; // In all of the tests below we provide the first tx to ensure that the tracers will not include // the statistics from the start of the bootloader and will only include those for the transaction itself. @@ -124,9 +118,7 @@ fn test_storage_behavior() { #[test] fn test_transient_storage_behavior() { - let contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); + let contract = &TestContract::storage_test().abi; let first_tstore_test = contract .function("testTransientStore") @@ -154,9 +146,7 @@ fn test_transient_storage_behavior() { #[test] fn test_transient_storage_behavior_panic() { - let contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); + let contract = &TestContract::storage_test().abi; let basic_tstore_test = contract .function("tStoreAndRevert") diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs b/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs index 1fe4232c778..b91f9f9eaf7 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs @@ -1,6 +1,7 @@ use std::marker::PhantomData; use zksync_contracts::BaseSystemContracts; +use zksync_test_account::TestContract; use zksync_types::{ block::L2BlockHasher, fee_model::BatchFeeInput, @@ -19,10 +20,7 @@ use crate::{ }, vm_latest::{ constants::BATCH_COMPUTATIONAL_GAS_LIMIT, - tests::{ - tester::{Account, TxType}, - utils::read_test_contract, - }, + tests::tester::{Account, TxType}, utils::l2_blocks::load_last_l2_block, Vm, }, @@ -39,17 +37,16 @@ pub(crate) struct VmTester { pub(crate) test_contract: Option
, pub(crate) rich_accounts: Vec, pub(crate) custom_contracts: Vec, - _phantom: std::marker::PhantomData, + _phantom: PhantomData, } impl VmTester { pub(crate) fn deploy_test_contract(&mut self) { - let contract = read_test_contract(); let tx = self .deployer .as_mut() .expect("You have to initialize builder with deployer") - .get_deploy_tx(&contract, None, TxType::L2) + .get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2) .tx; let nonce = tx.nonce().unwrap().0.into(); self.vm.push_transaction(tx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs index 2db37881352..689273caab3 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs @@ -1,3 +1,4 @@ +use zksync_test_account::TestContract; use zksync_types::{Execute, H160}; use crate::{ @@ -5,7 +6,7 @@ use crate::{ vm_latest::{ tests::{ tester::{ExpectedError, TransactionTestInfo, VmTesterBuilder}, - utils::{get_execute_error_calldata, read_error_contract, BASE_SYSTEM_CONTRACTS}, + utils::BASE_SYSTEM_CONTRACTS, }, HistoryEnabled, }, @@ -14,21 +15,25 @@ use crate::{ #[test] fn test_tracing_of_execution_errors() { let contract_address = H160::random(); + let bytecode = TestContract::require().bytecode.clone(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() .with_base_system_smart_contracts(BASE_SYSTEM_CONTRACTS.clone()) - .with_custom_contracts(vec![(read_error_contract(), contract_address, false)]) + .with_custom_contracts(vec![(bytecode, contract_address, false)]) .with_execution_mode(TxExecutionMode::VerifyExecute) .with_deployer() .with_random_rich_accounts(1) .build(); let account = &mut vm.rich_accounts[0]; - + let require_fn = TestContract::require() + .abi + .function("require_short") + .unwrap(); let tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(contract_address), - calldata: get_execute_error_calldata(), + calldata: require_fn.encode_input(&[]).unwrap(), value: Default::default(), factory_deps: vec![], }, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs index 2c380623636..151039f8fb3 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs @@ -1,6 +1,6 @@ use ethabi::Token; -use zksync_contracts::{load_contract, read_bytecode}; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; +use zksync_test_account::TestContract; use zksync_types::{utils::storage_key_for_eth_balance, AccountTreeId, Address, Execute, U256}; use zksync_utils::u256_to_h256; @@ -21,16 +21,7 @@ enum TestOptions { } fn test_send_or_transfer(test_option: TestOptions) { - let test_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let recipeint_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/Recipient.json", - ); - let test_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - + let test_abi = &TestContract::transfer_test().abi; let test_contract_address = Address::random(); let recipient_address = Address::random(); @@ -65,8 +56,16 @@ fn test_send_or_transfer(test_option: TestOptions) { .with_deployer() .with_random_rich_accounts(1) .with_custom_contracts(vec![ - (test_bytecode, test_contract_address, false), - (recipeint_bytecode, recipient_address, false), + ( + TestContract::transfer_test().bytecode.clone(), + test_contract_address, + false, + ), + ( + TestContract::transfer_recipient().bytecode.clone(), + recipient_address, + false, + ), ]) .build(); @@ -109,18 +108,8 @@ fn test_send_and_transfer() { } fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { - let test_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let reentrant_recipeint_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/ReentrantRecipient.json", - ); - let test_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let reentrant_recipient_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/ReentrantRecipient.json", - ); + let test_abi = &TestContract::transfer_test().abi; + let reentrant_recipient_abi = &TestContract::reentrant_recipient().abi; let test_contract_address = Address::random(); let reentrant_recipeint_address = Address::random(); @@ -156,9 +145,13 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { .with_deployer() .with_random_rich_accounts(1) .with_custom_contracts(vec![ - (test_bytecode, test_contract_address, false), ( - reentrant_recipeint_bytecode, + TestContract::transfer_test().bytecode.clone(), + test_contract_address, + false, + ), + ( + TestContract::reentrant_recipient().bytecode.clone(), reentrant_recipeint_address, false, ), diff --git a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs index d85a504de40..2a5f3dc3cb0 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs @@ -1,6 +1,6 @@ use zk_evm_1_5_0::aux_structures::Timestamp; use zksync_contracts::{deployer_contract, load_sys_contract, read_bytecode}; -use zksync_test_account::TxType; +use zksync_test_account::{TestContract, TxType}; use zksync_types::{ ethabi::{Contract, Token}, get_code_key, get_known_code_key, @@ -11,17 +11,13 @@ use zksync_types::{ }; use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256, u256_to_h256}; -use super::utils::{get_complex_upgrade_abi, read_test_contract}; use crate::{ interface::{ storage::WriteStorage, ExecutionResult, Halt, TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt, VmInterfaceHistoryEnabled, }, vm_latest::{ - tests::{ - tester::VmTesterBuilder, - utils::{read_complex_upgrade, verify_required_storage}, - }, + tests::{tester::VmTesterBuilder, utils::verify_required_storage}, HistoryEnabled, }, }; @@ -37,7 +33,7 @@ fn test_protocol_upgrade_is_first() { .with_random_rich_accounts(1) .build(); - let bytecode_hash = hash_bytecode(&read_test_contract()); + let bytecode_hash = hash_bytecode(&TestContract::counter().bytecode); vm.vm .storage .borrow_mut() @@ -72,7 +68,11 @@ fn test_protocol_upgrade_is_first() { }]); let normal_l1_transaction = vm.rich_accounts[0] - .get_deploy_tx(&read_test_contract(), None, TxType::L1 { serial_id: 0 }) + .get_deploy_tx( + &TestContract::counter().bytecode, + None, + TxType::L1 { serial_id: 0 }, + ) .tx; let expected_error = @@ -129,7 +129,7 @@ fn test_force_deploy_upgrade() { .build(); let storage_view = vm.storage.clone(); - let bytecode_hash = hash_bytecode(&read_test_contract()); + let bytecode_hash = hash_bytecode(&TestContract::counter().bytecode); let known_code_key = get_known_code_key(&bytecode_hash); // It is generally expected that all the keys will be set as known prior to the protocol upgrade. @@ -177,8 +177,8 @@ fn test_complex_upgrader() { .build(); let storage_view = vm.storage.clone(); - - let bytecode_hash = hash_bytecode(&read_complex_upgrade()); + let upgrade_bytecode = TestContract::complex_upgrade().bytecode.clone(); + let bytecode_hash = hash_bytecode(&upgrade_bytecode); let msg_sender_test_hash = hash_bytecode(&read_msg_sender_test()); // Let's assume that the bytecode for the implementation of the complex upgrade @@ -202,7 +202,7 @@ fn test_complex_upgrader() { vec![ ( h256_to_u256(bytecode_hash), - bytes_to_be_words(read_complex_upgrade()), + bytes_to_be_words(upgrade_bytecode), ), ( h256_to_u256(msg_sender_test_hash), @@ -298,15 +298,14 @@ fn get_forced_deploy_tx(deployment: &[ForceDeployment]) -> Transaction { // Returns the transaction that performs a complex protocol upgrade. // The first param is the address of the implementation of the complex upgrade // in user-space, while the next 3 params are params of the implementation itself -// For the explanation for the parameters, please refer to: -// etc/contracts-test-data/complex-upgrade/complex-upgrade.sol +// For the explanation for the parameters, please refer to the contract source code. fn get_complex_upgrade_tx( implementation_address: Address, address1: Address, address2: Address, bytecode_hash: H256, ) -> Transaction { - let impl_contract = get_complex_upgrade_abi(); + let impl_contract = &TestContract::complex_upgrade().abi; let impl_function = impl_contract.function("someComplexUpgrade").unwrap(); let impl_calldata = impl_function .encode_input(&[ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/utils.rs b/core/lib/multivm/src/versions/vm_latest/tests/utils.rs index c5487379ce3..cab274e6cb8 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/utils.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/utils.rs @@ -1,8 +1,5 @@ -use ethabi::Contract; use once_cell::sync::Lazy; -use zksync_contracts::{ - load_contract, read_bytecode, read_zbin_bytecode, BaseSystemContracts, SystemContractCode, -}; +use zksync_contracts::{read_zbin_bytecode, BaseSystemContracts, SystemContractCode}; use zksync_types::{ utils::storage_key_for_standard_token_balance, AccountTreeId, Address, StorageKey, H256, U256, }; @@ -54,10 +51,6 @@ pub(crate) fn get_balance( h256_to_u256(main_storage.borrow_mut().read_value(&key)) } -pub(crate) fn read_test_contract() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/counter/counter.sol/Counter.json") -} - pub(crate) fn get_bootloader(test: &str) -> SystemContractCode { let bootloader_code = read_zbin_bytecode(format!( "contracts/system-contracts/bootloader/tests/artifacts/{}.yul.zbin", @@ -71,74 +64,8 @@ pub(crate) fn get_bootloader(test: &str) -> SystemContractCode { } } -pub(crate) fn read_nonce_holder_tester() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/custom-account/nonce-holder-test.sol/NonceHolderTest.json") -} - -pub(crate) fn read_error_contract() -> Vec { - read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/error/error.sol/SimpleRequire.json", - ) -} - -pub(crate) fn read_simple_transfer_contract() -> Vec { - read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/simple-transfer/simple-transfer.sol/SimpleTransfer.json", - ) -} - -pub(crate) fn get_execute_error_calldata() -> Vec { - let test_contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/error/error.sol/SimpleRequire.json", - ); - - let function = test_contract.function("require_short").unwrap(); - - function - .encode_input(&[]) - .expect("failed to encode parameters") -} - -pub(crate) fn read_many_owners_custom_account_contract() -> (Vec, Contract) { - let path = "etc/contracts-test-data/artifacts-zk/contracts/custom-account/many-owners-custom-account.sol/ManyOwnersCustomAccount.json"; - (read_bytecode(path), load_contract(path)) -} - pub(crate) fn read_max_depth_contract() -> Vec { read_zbin_bytecode( "core/tests/ts-integration/contracts/zkasm/artifacts/deep_stak.zkasm/deep_stak.zkasm.zbin", ) } - -pub(crate) fn read_precompiles_contract() -> Vec { - read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json", - ) -} - -pub(crate) fn load_precompiles_contract() -> Contract { - load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json", - ) -} - -pub(crate) fn read_complex_upgrade() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/complex-upgrade.sol/ComplexUpgrade.json") -} - -pub(crate) fn get_complex_upgrade_abi() -> Contract { - load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/complex-upgrade.sol/ComplexUpgrade.json" - ) -} - -pub(crate) fn read_expensive_contract() -> (Vec, Contract) { - const PATH: &str = - "etc/contracts-test-data/artifacts-zk/contracts/expensive/expensive.sol/Expensive.json"; - (read_bytecode(PATH), load_contract(PATH)) -} - -pub(crate) fn read_proxy_counter_contract() -> (Vec, Contract) { - const PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/counter/proxy_counter.sol/ProxyCounter.json"; - (read_bytecode(PATH), load_contract(PATH)) -} diff --git a/core/tests/test_account/src/contracts.rs b/core/tests/test_account/src/contracts.rs index 10584504e1e..b5f1283353e 100644 --- a/core/tests/test_account/src/contracts.rs +++ b/core/tests/test_account/src/contracts.rs @@ -18,6 +18,8 @@ macro_rules! include_contract { }; } +const COMPLEX_UPGRADE_CONTRACT: &str = + include_contract!("complex-upgrade/complex-upgrade"::ComplexUpgrade); const CONTEXT_CONTRACT: &str = include_contract!("context/context"::Context); const COUNTER_CONTRACT: &str = include_contract!("counter/counter"::Counter); const EXPENSIVE_CONTRACT: &str = include_contract!("expensive/expensive"::Expensive); @@ -25,8 +27,20 @@ const FAILED_CALL_CONTRACT: &str = include_contract!("failed-call/failed_call":: const INFINITE_LOOP_CONTRACT: &str = include_contract!("infinite/infinite"::InfiniteLoop); const LOAD_TEST_CONTRACT: &str = include_contract!("loadnext/loadnext_contract"::LoadnextContract); const LOAD_TEST_DEPLOYED_CONTRACT: &str = include_contract!("loadnext/loadnext_contract"::Foo); +const MANY_OWNERS_CONTRACT: &str = + include_contract!("custom-account/many-owners-custom-account"::ManyOwnersCustomAccount); +const NONCE_HOLDER_CONTRACT: &str = + include_contract!("custom-account/nonce-holder-test"::NonceHolderTest); const PRECOMPILES_CONTRACT: &str = include_contract!("precompiles/precompiles"::Precompiles); +const PROXY_COUNTER_CONTRACT: &str = include_contract!("counter/proxy_counter"::ProxyCounter); +const SIMPLE_TRANSFER_CONTRACT: &str = + include_contract!("simple-transfer/simple-transfer"::SimpleTransfer); +const REENTRANT_RECIPIENT_CONTRACT: &str = + include_contract!("transfer/transfer"::ReentrantRecipient); +const REQUIRE_CONTRACT: &str = include_contract!("error/error"::SimpleRequire); const STORAGE_TEST_CONTRACT: &str = include_contract!("storage/storage"::StorageTester); +const TRANSFER_RECIPIENT_CONTRACT: &str = include_contract!("transfer/transfer"::Recipient); +const TRANSFER_TEST_CONTRACT: &str = include_contract!("transfer/transfer"::TransferTest); #[derive(Debug, Clone)] pub struct TestContract { @@ -56,6 +70,12 @@ impl TestContract { } } + pub fn complex_upgrade() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(COMPLEX_UPGRADE_CONTRACT)); + &CONTRACT + } + pub fn context() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(CONTEXT_CONTRACT)); &CONTRACT @@ -91,17 +111,63 @@ impl TestContract { &CONTRACT } + pub fn many_owners() -> &'static Self { + static CONTRACT: Lazy = Lazy::new(|| TestContract::new(MANY_OWNERS_CONTRACT)); + &CONTRACT + } + + pub fn nonce_holder() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(NONCE_HOLDER_CONTRACT)); + &CONTRACT + } + pub fn precompiles() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(PRECOMPILES_CONTRACT)); &CONTRACT } + pub fn proxy_counter() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(PROXY_COUNTER_CONTRACT)); + &CONTRACT + } + + pub fn reentrant_recipient() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(REENTRANT_RECIPIENT_CONTRACT)); + &CONTRACT + } + + pub fn require() -> &'static Self { + static CONTRACT: Lazy = Lazy::new(|| TestContract::new(REQUIRE_CONTRACT)); + &CONTRACT + } + + pub fn simple_transfer() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(SIMPLE_TRANSFER_CONTRACT)); + &CONTRACT + } + pub fn storage_test() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(STORAGE_TEST_CONTRACT)); &CONTRACT } + pub fn transfer_test() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(TRANSFER_TEST_CONTRACT)); + &CONTRACT + } + + pub fn transfer_recipient() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(TRANSFER_RECIPIENT_CONTRACT)); + &CONTRACT + } + pub fn factory_deps(&self) -> Vec> { let mut deps = vec![]; self.insert_factory_deps(&mut deps); diff --git a/core/tests/test_account/src/lib.rs b/core/tests/test_account/src/lib.rs index 4c5392302c8..447628cb2f8 100644 --- a/core/tests/test_account/src/lib.rs +++ b/core/tests/test_account/src/lib.rs @@ -1,8 +1,7 @@ use ethabi::Token; use zksync_eth_signer::{PrivateKeySigner, TransactionParameters}; use zksync_system_constants::{ - CONTRACT_DEPLOYER_ADDRESS, DEFAULT_L2_TX_GAS_PER_PUBDATA_BYTE, - REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_BYTE, + DEFAULT_L2_TX_GAS_PER_PUBDATA_BYTE, REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_BYTE, }; use zksync_types::{ abi, fee::Fee, l2::L2Tx, utils::deployed_address_create, Address, Execute, K256PrivateKey, @@ -110,25 +109,13 @@ impl Account { &mut self, code: &[u8], calldata: Option<&[Token]>, - mut factory_deps: Vec>, + factory_deps: Vec>, tx_type: TxType, ) -> DeployContractsTx { - let calldata = calldata.map(ethabi::encode); + let calldata = calldata.unwrap_or_default(); let code_hash = hash_bytecode(code); - let params = [ - Token::FixedBytes(vec![0u8; 32]), - Token::FixedBytes(code_hash.0.to_vec()), - Token::Bytes(calldata.unwrap_or_default().to_vec()), - ]; - factory_deps.push(code.to_vec()); - let calldata = ethabi::encode(¶ms); - - let execute = Execute { - contract_address: Some(CONTRACT_DEPLOYER_ADDRESS), - calldata, - factory_deps, - value: U256::zero(), - }; + let mut execute = Execute::for_deploy(H256::zero(), code.to_vec(), calldata); + execute.factory_deps.extend(factory_deps); let tx = match tx_type { TxType::L2 => self.get_l2_tx_for_execute(execute, None), From 86749b24047562ca808b083063fbd877c11e4100 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 11:40:51 +0300 Subject: [PATCH 05/32] Use test contracts in remaining `multivm` tests --- .../src/versions/vm_fast/tests/block_tip.rs | 10 ++- .../src/versions/vm_fast/tests/bootloader.rs | 10 ++- .../vm_fast/tests/bytecode_publishing.rs | 11 ++- .../src/versions/vm_fast/tests/code_oracle.rs | 31 ++++----- .../src/versions/vm_fast/tests/default_aa.rs | 8 +-- .../vm_fast/tests/get_used_contracts.rs | 24 ++++--- .../vm_fast/tests/is_write_initial.rs | 12 ++-- .../versions/vm_fast/tests/l1_tx_execution.rs | 10 ++- .../versions/vm_fast/tests/nonce_holder.rs | 8 +-- .../src/versions/vm_fast/tests/precompiles.rs | 7 +- .../src/versions/vm_fast/tests/refunds.rs | 13 ++-- .../versions/vm_fast/tests/require_eip712.rs | 13 ++-- .../src/versions/vm_fast/tests/rollbacks.rs | 15 ++-- .../src/versions/vm_fast/tests/storage.rs | 14 ++-- .../vm_fast/tests/tester/vm_tester.rs | 8 +-- .../vm_fast/tests/tracing_execution_error.rs | 16 +++-- .../src/versions/vm_fast/tests/transfer.rs | 47 ++++++------- .../src/versions/vm_fast/tests/upgrade.rs | 43 ++++++------ .../src/versions/vm_fast/tests/utils.rs | 69 +------------------ .../vm_latest/tests/require_eip712.rs | 5 +- .../src/versions/vm_latest/tests/rollbacks.rs | 2 +- .../src/versions/vm_latest/tests/transfer.rs | 1 - .../src/versions/vm_latest/tests/upgrade.rs | 10 +-- core/tests/test_account/src/contracts.rs | 8 +++ 24 files changed, 155 insertions(+), 240 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs index dd407c61668..0ad17e02c3f 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs @@ -6,16 +6,14 @@ use zksync_contracts::load_sys_contract; use zksync_system_constants::{ CONTRACT_FORCE_DEPLOYER_ADDRESS, KNOWN_CODES_STORAGE_ADDRESS, L1_MESSENGER_ADDRESS, }; +use zksync_test_account::TestContract; use zksync_types::{ commitment::SerializeCommitment, fee_model::BatchFeeInput, get_code_key, l2_to_l1_log::L2ToL1Log, writes::StateDiffRecord, Address, Execute, H256, U256, }; use zksync_utils::{bytecode::hash_bytecode, u256_to_h256}; -use super::{ - tester::{get_empty_storage, VmTesterBuilder}, - utils::{get_complex_upgrade_abi, read_complex_upgrade}, -}; +use super::tester::{get_empty_storage, VmTesterBuilder}; use crate::{ interface::{L1BatchEnv, TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, versions::testonly::default_l1_batch, @@ -42,7 +40,7 @@ struct MimicCallInfo { const CALLS_PER_TX: usize = 1_000; fn populate_mimic_calls(data: L1MessengerTestData) -> Vec> { - let complex_upgrade = get_complex_upgrade_abi(); + let complex_upgrade = &TestContract::complex_upgrade().abi; let l1_messenger = load_sys_contract("L1Messenger"); let logs_mimic_calls = (0..data.l2_to_l1_logs).map(|_| MimicCallInfo { @@ -114,7 +112,7 @@ struct StatisticsTagged { fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { let mut storage = get_empty_storage(); - let complex_upgrade_code = read_complex_upgrade(); + let complex_upgrade_code = TestContract::complex_upgrade().bytecode.clone(); // For this test we'll just put the bytecode onto the force deployer address storage.borrow_mut().set_value( diff --git a/core/lib/multivm/src/versions/vm_fast/tests/bootloader.rs b/core/lib/multivm/src/versions/vm_fast/tests/bootloader.rs index 48e1b10de44..e19c14f7785 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/bootloader.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/bootloader.rs @@ -2,13 +2,11 @@ use assert_matches::assert_matches; use zksync_types::U256; use zksync_vm2::interface::HeapId; -use crate::{ - interface::{ExecutionResult, Halt, TxExecutionMode, VmExecutionMode, VmInterfaceExt}, - versions::vm_fast::tests::{ - tester::VmTesterBuilder, - utils::{get_bootloader, verify_required_memory, BASE_SYSTEM_CONTRACTS}, - }, +use super::{ + tester::VmTesterBuilder, + utils::{get_bootloader, verify_required_memory, BASE_SYSTEM_CONTRACTS}, }; +use crate::interface::{ExecutionResult, Halt, TxExecutionMode, VmExecutionMode, VmInterfaceExt}; #[test] fn test_dummy_bootloader() { diff --git a/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs b/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs index 3070140c00b..31fba8be449 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs @@ -1,10 +1,9 @@ +use zksync_test_account::TestContract; + +use super::tester::{DeployContractsTx, TxType, VmTesterBuilder}; use crate::{ interface::{TxExecutionMode, VmEvent, VmExecutionMode, VmInterface, VmInterfaceExt}, utils::bytecode, - vm_fast::tests::{ - tester::{DeployContractsTx, TxType, VmTesterBuilder}, - utils::read_test_contract, - }, }; #[test] @@ -17,12 +16,12 @@ fn test_bytecode_publishing() { .with_random_rich_accounts(1) .build(); - let counter = read_test_contract(); + let counter = &TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; let compressed_bytecode = bytecode::compress(counter.clone()).unwrap().compressed; - let DeployContractsTx { tx, .. } = account.get_deploy_tx(&counter, None, TxType::L2); + let DeployContractsTx { tx, .. } = account.get_deploy_tx(counter, None, TxType::L2); vm.vm.push_transaction(tx); let result = vm.vm.execute(VmExecutionMode::OneTx); assert!(!result.result.is_failed(), "Transaction wasn't successful"); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs index 34342d7f3b8..d24c1dfd3d1 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs @@ -1,4 +1,5 @@ use ethabi::Token; +use zksync_test_account::TestContract; use zksync_types::{ get_known_code_key, web3::keccak256, Address, Execute, StorageLogWithPreviousValue, U256, }; @@ -8,10 +9,7 @@ use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, versions::testonly::ContractToDeploy, vm_fast::{ - tests::{ - tester::{get_empty_storage, VmTesterBuilder}, - utils::{load_precompiles_contract, read_precompiles_contract, read_test_contract}, - }, + tests::tester::{get_empty_storage, VmTesterBuilder}, CircuitsTracer, }, }; @@ -24,12 +22,12 @@ fn generate_large_bytecode() -> Vec { #[test] fn test_code_oracle() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = read_precompiles_contract(); + let precompile_contract_bytecode = TestContract::precompiles().bytecode.clone(); // Filling the zkevm bytecode - let normal_zkevm_bytecode = read_test_contract(); - let normal_zkevm_bytecode_hash = hash_bytecode(&normal_zkevm_bytecode); - let normal_zkevm_bytecode_keccak_hash = keccak256(&normal_zkevm_bytecode); + let normal_zkevm_bytecode = &TestContract::counter().bytecode; + let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); + let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); let mut storage = get_empty_storage(); storage.set_value( get_known_code_key(&normal_zkevm_bytecode_hash), @@ -49,7 +47,7 @@ fn test_code_oracle() { .with_storage(storage) .build(); - let precompile_contract = load_precompiles_contract(); + let precompile_contract = &TestContract::precompiles().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); vm.vm.insert_bytecodes([normal_zkevm_bytecode.as_slice()]); @@ -116,7 +114,7 @@ fn find_code_oracle_cost_log( #[test] fn test_code_oracle_big_bytecode() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = read_precompiles_contract(); + let precompile_contract_bytecode = TestContract::precompiles().bytecode.clone(); let big_zkevm_bytecode = generate_large_bytecode(); let big_zkevm_bytecode_hash = hash_bytecode(&big_zkevm_bytecode); @@ -141,7 +139,7 @@ fn test_code_oracle_big_bytecode() { .with_storage(storage) .build(); - let precompile_contract = load_precompiles_contract(); + let precompile_contract = &TestContract::precompiles().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); vm.vm.insert_bytecodes([big_zkevm_bytecode.as_slice()]); @@ -175,18 +173,17 @@ fn test_code_oracle_big_bytecode() { #[test] fn refunds_in_code_oracle() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = read_precompiles_contract(); - let normal_zkevm_bytecode = read_test_contract(); - let normal_zkevm_bytecode_hash = hash_bytecode(&normal_zkevm_bytecode); - let normal_zkevm_bytecode_keccak_hash = keccak256(&normal_zkevm_bytecode); + let normal_zkevm_bytecode = &TestContract::counter().bytecode; + let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); + let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); let mut storage = get_empty_storage(); storage.set_value( get_known_code_key(&normal_zkevm_bytecode_hash), u256_to_h256(U256::one()), ); - let precompile_contract = load_precompiles_contract(); + let precompile_contract = &TestContract::precompiles().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); // Execute code oracle twice with identical VM state that only differs in that the queried bytecode @@ -198,7 +195,7 @@ fn refunds_in_code_oracle() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![ContractToDeploy::new( - precompile_contract_bytecode.clone(), + TestContract::precompiles().bytecode.clone(), precompiles_contract_address, )]) .with_storage(storage.clone()) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/default_aa.rs b/core/lib/multivm/src/versions/vm_fast/tests/default_aa.rs index c2ce02d39fe..04259c68732 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/default_aa.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/default_aa.rs @@ -1,4 +1,5 @@ use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; +use zksync_test_account::TestContract; use zksync_types::{ get_code_key, get_known_code_key, get_nonce_key, system_contracts::{DEPLOYMENT_NONCE_INCREMENT, TX_NONCE_INCREMENT}, @@ -10,7 +11,7 @@ use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, vm_fast::tests::{ tester::{DeployContractsTx, TxType, VmTesterBuilder}, - utils::{get_balance, read_test_contract, verify_required_storage}, + utils::{get_balance, verify_required_storage}, }, vm_latest::utils::fee::get_batch_base_fee, }; @@ -25,13 +26,13 @@ fn test_default_aa_interaction() { .with_random_rich_accounts(1) .build(); - let counter = read_test_contract(); + let counter = &TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; let DeployContractsTx { tx, bytecode_hash, address, - } = account.get_deploy_tx(&counter, None, TxType::L2); + } = account.get_deploy_tx(counter, None, TxType::L2); let maximal_fee = tx.gas_limit() * get_batch_base_fee(&vm.vm.batch_env); vm.vm.push_transaction(tx); @@ -39,7 +40,6 @@ fn test_default_aa_interaction() { assert!(!result.result.is_failed(), "Transaction wasn't successful"); vm.vm.execute(VmExecutionMode::Batch); - vm.vm.get_current_execution_state(); // Both deployment and ordinary nonce should be incremented by one. diff --git a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs index 62fa82f52f2..9192f57f461 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs @@ -5,7 +5,7 @@ use ethabi::Token; use itertools::Itertools; use zk_evm_1_3_1::zkevm_opcode_defs::decoding::{EncodingModeProduction, VmEncodingMode}; use zksync_system_constants::CONTRACT_DEPLOYER_ADDRESS; -use zksync_test_account::Account; +use zksync_test_account::{Account, TestContract}; use zksync_types::{AccountTreeId, Address, Execute, StorageKey, H256, U256}; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; @@ -18,7 +18,7 @@ use crate::{ vm_fast::{ tests::{ tester::{TxType, VmTester, VmTesterBuilder}, - utils::{read_proxy_counter_contract, read_test_contract, BASE_SYSTEM_CONTRACTS}, + utils::BASE_SYSTEM_CONTRACTS, }, vm::Vm, }, @@ -35,9 +35,9 @@ fn test_get_used_contracts() { // create and push and execute some not-empty factory deps transaction with success status // to check that `get_decommitted_hashes()` updates - let contract_code = read_test_contract(); + let contract_code = &TestContract::counter().bytecode; let mut account = Account::random(); - let tx = account.get_deploy_tx(&contract_code, None, TxType::L1 { serial_id: 0 }); + let tx = account.get_deploy_tx(contract_code, None, TxType::L1 { serial_id: 0 }); vm.vm.push_transaction(tx.tx.clone()); let result = vm.vm.execute(VmExecutionMode::OneTx); assert!(!result.result.is_failed()); @@ -102,7 +102,7 @@ fn known_bytecodes_without_aa_code(vm: &Vm) -> HashSet /// Counter test contract bytecode inflated by appending lots of `NOP` opcodes at the end. This leads to non-trivial /// decommitment cost (>10,000 gas). fn inflated_counter_bytecode() -> Vec { - let mut counter_bytecode = read_test_contract(); + let mut counter_bytecode = TestContract::counter().bytecode.clone(); counter_bytecode.extend( iter::repeat(EncodingModeProduction::nop_encoding().to_be_bytes()) .take(10_000) @@ -132,10 +132,9 @@ fn execute_proxy_counter(gas: u32) -> (VmTester<()>, ProxyCounterData, VmExecuti .with_random_rich_accounts(1) .build(); - let (proxy_counter_bytecode, proxy_counter_abi) = read_proxy_counter_contract(); let account = &mut vm.rich_accounts[0]; let deploy_tx = account.get_deploy_tx( - &proxy_counter_bytecode, + &TestContract::proxy_counter().bytecode, Some(&[Token::Address(counter_address)]), TxType::L2, ); @@ -151,7 +150,10 @@ fn execute_proxy_counter(gas: u32) -> (VmTester<()>, ProxyCounterData, VmExecuti "{decommitted_hashes:?}" ); - let increment = proxy_counter_abi.function("increment").unwrap(); + let increment = TestContract::proxy_counter() + .abi + .function("increment") + .unwrap(); let increment_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(deploy_tx.address), @@ -197,8 +199,10 @@ fn get_used_contracts_with_out_of_gas_far_call() { // Execute another transaction with a successful far call and check that it's still charged for decommitment. let account = &mut vm.rich_accounts[0]; - let (_, proxy_counter_abi) = read_proxy_counter_contract(); - let increment = proxy_counter_abi.function("increment").unwrap(); + let increment = TestContract::proxy_counter() + .abi + .function("increment") + .unwrap(); let increment_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(data.proxy_counter_address), diff --git a/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs b/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs index df8d992f02f..e83cebe2445 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs @@ -1,13 +1,11 @@ +use zksync_test_account::TestContract; use zksync_types::get_nonce_key; use crate::{ interface::{ storage::ReadStorage, TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt, }, - vm_fast::tests::{ - tester::{Account, TxType, VmTesterBuilder}, - utils::read_test_contract, - }, + vm_fast::tests::tester::{Account, TxType, VmTesterBuilder}, }; #[test] @@ -31,9 +29,9 @@ fn test_is_write_initial_behaviour() { .borrow_mut() .is_write_initial(&nonce_key)); - let contract_code = read_test_contract(); - let tx = account.get_deploy_tx(&contract_code, None, TxType::L2).tx; - + let tx = account + .get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2) + .tx; vm.vm.push_transaction(tx); vm.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs b/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs index 1abb1e39e19..6aa4ad439bd 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs @@ -1,6 +1,7 @@ use ethabi::Token; use zksync_contracts::l1_messenger_contract; use zksync_system_constants::{BOOTLOADER_ADDRESS, L1_MESSENGER_ADDRESS}; +use zksync_test_account::TestContract; use zksync_types::{ get_code_key, get_known_code_key, l2_to_l1_log::{L2ToL1Log, UserL2ToL1Log}, @@ -14,7 +15,7 @@ use crate::{ vm_fast::{ tests::{ tester::{TxType, VmTesterBuilder}, - utils::{read_test_contract, BASE_SYSTEM_CONTRACTS}, + utils::BASE_SYSTEM_CONTRACTS, }, transaction_data::TransactionData, }, @@ -47,9 +48,12 @@ fn test_l1_tx_execution() { .with_random_rich_accounts(1) .build(); - let contract_code = read_test_contract(); let account = &mut vm.rich_accounts[0]; - let deploy_tx = account.get_deploy_tx(&contract_code, None, TxType::L1 { serial_id: 1 }); + let deploy_tx = account.get_deploy_tx( + &TestContract::counter().bytecode, + None, + TxType::L1 { serial_id: 1 }, + ); let tx_data: TransactionData = deploy_tx.tx.clone().into(); let required_l2_to_l1_logs: Vec<_> = vec![L2ToL1Log { diff --git a/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs b/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs index f72e95da9f8..f76b9f8dd17 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs @@ -1,3 +1,4 @@ +use zksync_test_account::TestContract; use zksync_types::{Execute, ExecuteTransactionCommon, Nonce}; use crate::{ @@ -6,10 +7,7 @@ use crate::{ VmRevertReason, }, versions::testonly::ContractToDeploy, - vm_fast::tests::{ - tester::{Account, VmTesterBuilder}, - utils::read_nonce_holder_tester, - }, + vm_fast::tests::tester::{Account, VmTesterBuilder}, }; pub enum NonceHolderTestMode { @@ -43,7 +41,7 @@ fn test_nonce_holder() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_deployer() .with_custom_contracts(vec![ContractToDeploy::account( - read_nonce_holder_tester().to_vec(), + TestContract::nonce_holder().bytecode.clone(), account.address, )]) .with_rich_accounts(vec![account.clone()]) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs index b3ca1596217..8724e96dc5e 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs @@ -1,7 +1,8 @@ use circuit_sequencer_api_1_5_0::geometry_config::get_geometry_config; +use zksync_test_account::TestContract; use zksync_types::{Address, Execute}; -use super::{tester::VmTesterBuilder, utils::read_precompiles_contract}; +use super::tester::VmTesterBuilder; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, versions::testonly::ContractToDeploy, @@ -11,7 +12,7 @@ use crate::{ #[test] fn test_keccak() { // Execute special transaction and check that at least 1000 keccak calls were made. - let contract = read_precompiles_contract(); + let contract = TestContract::precompiles().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() @@ -49,7 +50,7 @@ fn test_keccak() { #[test] fn test_sha256() { // Execute special transaction and check that at least 1000 `sha256` calls were made. - let contract = read_precompiles_contract(); + let contract = TestContract::precompiles().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs b/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs index 1856995149a..56935999469 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs @@ -1,13 +1,11 @@ use ethabi::Token; +use zksync_test_account::TestContract; use zksync_types::{Address, Execute, U256}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, versions::testonly::ContractToDeploy, - vm_fast::tests::{ - tester::{DeployContractsTx, TxType, VmTesterBuilder}, - utils::{read_expensive_contract, read_test_contract}, - }, + vm_fast::tests::tester::{DeployContractsTx, TxType, VmTesterBuilder}, }; #[test] @@ -22,14 +20,13 @@ fn test_predetermined_refunded_gas() { .build(); let l1_batch = vm.vm.batch_env.clone(); - let counter = read_test_contract(); let account = &mut vm.rich_accounts[0]; let DeployContractsTx { tx, bytecode_hash: _, address: _, - } = account.get_deploy_tx(&counter, None, TxType::L2); + } = account.get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2); vm.vm.push_transaction(tx.clone()); let result = vm.vm.execute(VmExecutionMode::OneTx); @@ -165,7 +162,7 @@ fn test_predetermined_refunded_gas() { #[test] fn negative_pubdata_for_transaction() { let expensive_contract_address = Address::random(); - let (expensive_contract_bytecode, expensive_contract) = read_expensive_contract(); + let expensive_contract = &TestContract::expensive().abi; let expensive_function = expensive_contract.function("expensive").unwrap(); let cleanup_function = expensive_contract.function("cleanUp").unwrap(); @@ -174,7 +171,7 @@ fn negative_pubdata_for_transaction() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![ContractToDeploy::new( - expensive_contract_bytecode, + TestContract::expensive().bytecode.clone(), expensive_contract_address, )]) .build(); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs index 88fe2dab5c9..7b1c025110e 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs @@ -1,6 +1,7 @@ use ethabi::Token; use zksync_eth_signer::TransactionParameters; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; +use zksync_test_account::TestContract; use zksync_types::{ fee::Fee, l2::L2Tx, transaction_request::TransactionRequest, utils::storage_key_for_standard_token_balance, AccountTreeId, Address, Eip712Domain, Execute, @@ -13,10 +14,7 @@ use crate::{ storage::ReadStorage, TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt, }, versions::testonly::ContractToDeploy, - vm_fast::tests::{ - tester::{Account, VmTester, VmTesterBuilder}, - utils::read_many_owners_custom_account_contract, - }, + vm_fast::tests::tester::{Account, VmTester, VmTesterBuilder}, }; impl VmTester<()> { @@ -48,7 +46,7 @@ fn test_require_eip712() { let mut private_account = Account::random(); let beneficiary = Account::random(); - let (bytecode, contract) = read_many_owners_custom_account_contract(); + let bytecode = TestContract::many_owners().bytecode.clone(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_custom_contracts(vec![ContractToDeploy::account( @@ -65,7 +63,10 @@ fn test_require_eip712() { // First, let's set the owners of the AA account to the `private_address`. // (so that messages signed by `private_address`, are authorized to act on behalf of the AA account). - let set_owners_function = contract.function("setOwners").unwrap(); + let set_owners_function = TestContract::many_owners() + .abi + .function("setOwners") + .unwrap(); let encoded_input = set_owners_function .encode_input(&[Token::Array(vec![Token::Address(private_account.address)])]) .unwrap(); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs index ee6aa529e1b..39761fae26c 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs @@ -7,9 +7,8 @@ use zksync_vm_interface::VmInterfaceExt; use crate::{ interface::{ExecutionResult, TxExecutionMode}, versions::testonly::ContractToDeploy, - vm_fast::tests::{ - tester::{DeployContractsTx, TransactionTestInfo, TxModifier, TxType, VmTesterBuilder}, - utils::read_test_contract, + vm_fast::tests::tester::{ + DeployContractsTx, TransactionTestInfo, TxModifier, TxType, VmTesterBuilder, }, }; @@ -22,10 +21,10 @@ fn test_vm_rollbacks() { .build(); let mut account = vm.rich_accounts[0].clone(); - let counter = read_test_contract(); - let tx_0 = account.get_deploy_tx(&counter, None, TxType::L2).tx; - let tx_1 = account.get_deploy_tx(&counter, None, TxType::L2).tx; - let tx_2 = account.get_deploy_tx(&counter, None, TxType::L2).tx; + let counter = &TestContract::counter().bytecode; + let tx_0 = account.get_deploy_tx(counter, None, TxType::L2).tx; + let tx_1 = account.get_deploy_tx(counter, None, TxType::L2).tx; + let tx_2 = account.get_deploy_tx(counter, None, TxType::L2).tx; let result_without_rollbacks = vm.execute_and_verify_txs(&vec![ TransactionTestInfo::new_processed(tx_0.clone(), false), @@ -148,7 +147,7 @@ fn test_vm_loadnext_rollbacks() { #[test] fn rollback_in_call_mode() { - let counter_bytecode = read_test_contract(); + let counter_bytecode = TestContract::counter().bytecode.clone(); let counter_address = Address::repeat_byte(1); let mut vm = VmTesterBuilder::new() diff --git a/core/lib/multivm/src/versions/vm_fast/tests/storage.rs b/core/lib/multivm/src/versions/vm_fast/tests/storage.rs index 2cfadb640e7..147778fc476 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/storage.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/storage.rs @@ -1,5 +1,5 @@ use ethabi::Token; -use zksync_contracts::{load_contract, read_bytecode}; +use zksync_test_account::TestContract; use zksync_types::{Address, Execute, U256}; use crate::{ @@ -11,9 +11,7 @@ use crate::{ }; fn test_storage(first_tx_calldata: Vec, second_tx_calldata: Vec) -> u32 { - let bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); + let bytecode = TestContract::storage_test().bytecode.clone(); let test_contract_address = Address::random(); @@ -76,9 +74,7 @@ fn test_storage_one_tx(second_tx_calldata: Vec) -> u32 { #[test] fn test_storage_behavior() { - let contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); + let contract = &TestContract::storage_test().abi; // In all of the tests below we provide the first tx to ensure that the tracers will not include // the statistics from the start of the bootloader and will only include those for the transaction itself. @@ -113,9 +109,7 @@ fn test_storage_behavior() { #[test] fn test_transient_storage_behavior() { - let contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); + let contract = &TestContract::storage_test().abi; let first_tstore_test = contract .function("testTransientStore") diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tester/vm_tester.rs b/core/lib/multivm/src/versions/vm_fast/tests/tester/vm_tester.rs index 9549b32c4f1..7e05f5e3d7d 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tester/vm_tester.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tester/vm_tester.rs @@ -1,7 +1,7 @@ use std::{cell::RefCell, rc::Rc}; use zksync_contracts::BaseSystemContracts; -use zksync_test_account::{Account, TxType}; +use zksync_test_account::{Account, TestContract, TxType}; use zksync_types::{ block::L2BlockHasher, utils::deployed_address_create, AccountTreeId, Address, L1BatchNumber, L2BlockNumber, Nonce, StorageKey, @@ -16,7 +16,7 @@ use crate::{ }, versions::{ testonly::{default_l1_batch, default_system_env, make_account_rich, ContractToDeploy}, - vm_fast::{tests::utils::read_test_contract, vm::Vm}, + vm_fast::vm::Vm, }, vm_latest::utils::l2_blocks::load_last_l2_block, }; @@ -33,12 +33,12 @@ pub(crate) struct VmTester { impl VmTester { pub(crate) fn deploy_test_contract(&mut self) { - let contract = read_test_contract(); + let contract = &TestContract::counter().bytecode; let tx = self .deployer .as_mut() .expect("You have to initialize builder with deployer") - .get_deploy_tx(&contract, None, TxType::L2) + .get_deploy_tx(contract, None, TxType::L2) .tx; let nonce = tx.nonce().unwrap().0.into(); self.vm.push_transaction(tx); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs index 89f0fa23620..df3eb209be2 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs @@ -1,3 +1,4 @@ +use zksync_test_account::TestContract; use zksync_types::{Execute, H160}; use crate::{ @@ -5,31 +6,32 @@ use crate::{ versions::testonly::ContractToDeploy, vm_fast::tests::{ tester::{ExpectedError, TransactionTestInfo, VmTesterBuilder}, - utils::{get_execute_error_calldata, read_error_contract, BASE_SYSTEM_CONTRACTS}, + utils::BASE_SYSTEM_CONTRACTS, }, }; #[test] fn test_tracing_of_execution_errors() { let contract_address = H160::random(); + let bytecode = TestContract::require().bytecode.clone(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_base_system_smart_contracts(BASE_SYSTEM_CONTRACTS.clone()) - .with_custom_contracts(vec![ContractToDeploy::new( - read_error_contract(), - contract_address, - )]) + .with_custom_contracts(vec![ContractToDeploy::new(bytecode, contract_address)]) .with_execution_mode(TxExecutionMode::VerifyExecute) .with_deployer() .with_random_rich_accounts(1) .build(); let account = &mut vm.rich_accounts[0]; - + let require_fn = TestContract::require() + .abi + .function("require_short") + .unwrap(); let tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(contract_address), - calldata: get_execute_error_calldata(), + calldata: require_fn.encode_input(&[]).unwrap(), value: Default::default(), factory_deps: vec![], }, diff --git a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs index ef510546f11..0d2507e0332 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs @@ -1,6 +1,6 @@ use ethabi::Token; -use zksync_contracts::{load_contract, read_bytecode}; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; +use zksync_test_account::TestContract; use zksync_types::{utils::storage_key_for_eth_balance, AccountTreeId, Address, Execute, U256}; use zksync_utils::u256_to_h256; @@ -19,15 +19,7 @@ enum TestOptions { } fn test_send_or_transfer(test_option: TestOptions) { - let test_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let recipient_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/Recipient.json", - ); - let test_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); + let test_abi = &TestContract::transfer_test().abi; let test_contract_address = Address::random(); let recipient_address = Address::random(); @@ -63,8 +55,14 @@ fn test_send_or_transfer(test_option: TestOptions) { .with_deployer() .with_random_rich_accounts(1) .with_custom_contracts(vec![ - ContractToDeploy::new(test_bytecode, test_contract_address), - ContractToDeploy::new(recipient_bytecode, recipient_address), + ContractToDeploy::new( + TestContract::transfer_test().bytecode.clone(), + test_contract_address, + ), + ContractToDeploy::new( + TestContract::transfer_recipient().bytecode.clone(), + recipient_address, + ), ]) .build(); @@ -108,19 +106,8 @@ fn test_send_and_transfer() { } fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { - let test_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let reentrant_recipient_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/ReentrantRecipient.json", - ); - let test_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let reentrant_recipient_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/ReentrantRecipient.json", - ); - + let test_abi = &TestContract::transfer_test().abi; + let reentrant_recipient_abi = &TestContract::reentrant_recipient().abi; let test_contract_address = Address::random(); let reentrant_recipient_address = Address::random(); @@ -155,8 +142,14 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { .with_deployer() .with_random_rich_accounts(1) .with_custom_contracts(vec![ - ContractToDeploy::new(test_bytecode, test_contract_address), - ContractToDeploy::new(reentrant_recipient_bytecode, reentrant_recipient_address), + ContractToDeploy::new( + TestContract::transfer_test().bytecode.clone(), + test_contract_address, + ), + ContractToDeploy::new( + TestContract::reentrant_recipient().bytecode.clone(), + reentrant_recipient_address, + ), ]) .build(); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs index ba4863f7c45..4fc7106a56c 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs @@ -1,5 +1,5 @@ -use zksync_contracts::{deployer_contract, load_sys_contract, read_bytecode}; -use zksync_test_account::TxType; +use zksync_contracts::{deployer_contract, load_sys_contract}; +use zksync_test_account::{TestContract, TxType}; use zksync_types::{ ethabi::{Contract, Token}, get_code_key, get_known_code_key, @@ -15,13 +15,7 @@ use crate::{ ExecutionResult, Halt, TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt, VmInterfaceHistoryEnabled, }, - vm_fast::tests::{ - tester::VmTesterBuilder, - utils::{ - get_complex_upgrade_abi, read_complex_upgrade, read_test_contract, - verify_required_storage, - }, - }, + vm_fast::tests::{tester::VmTesterBuilder, utils::verify_required_storage}, }; /// In this test we ensure that the requirements for protocol upgrade transactions are enforced by the bootloader: @@ -35,7 +29,7 @@ fn test_protocol_upgrade_is_first() { .with_random_rich_accounts(1) .build(); - let bytecode_hash = hash_bytecode(&read_test_contract()); + let bytecode_hash = hash_bytecode(&TestContract::counter().bytecode); vm.storage .borrow_mut() .set_value(get_known_code_key(&bytecode_hash), u256_to_h256(1.into())); @@ -69,7 +63,11 @@ fn test_protocol_upgrade_is_first() { }]); let normal_l1_transaction = vm.rich_accounts[0] - .get_deploy_tx(&read_test_contract(), None, TxType::L1 { serial_id: 0 }) + .get_deploy_tx( + &TestContract::counter().bytecode, + None, + TxType::L1 { serial_id: 0 }, + ) .tx; let expected_error = @@ -126,7 +124,7 @@ fn test_force_deploy_upgrade() { .build(); let storage_view = vm.storage.clone(); - let bytecode_hash = hash_bytecode(&read_test_contract()); + let bytecode_hash = hash_bytecode(&TestContract::counter().bytecode); let known_code_key = get_known_code_key(&bytecode_hash); // It is generally expected that all the keys will be set as known prior to the protocol upgrade. @@ -177,8 +175,9 @@ fn test_complex_upgrader() { .with_random_rich_accounts(1) .build(); - let bytecode_hash = hash_bytecode(&read_complex_upgrade()); - let msg_sender_test_hash = hash_bytecode(&read_msg_sender_test()); + let upgrade_bytecode = TestContract::complex_upgrade().bytecode.clone(); + let bytecode_hash = hash_bytecode(&upgrade_bytecode); + let msg_sender_test_hash = hash_bytecode(&TestContract::msg_sender_test().bytecode); // Let's assume that the bytecode for the implementation of the complex upgrade // is already deployed in some address in user space @@ -193,8 +192,11 @@ fn test_complex_upgrader() { u256_to_h256(1.into()), ); storage.set_value(account_code_key, bytecode_hash); - storage.store_factory_dep(bytecode_hash, read_complex_upgrade()); - storage.store_factory_dep(msg_sender_test_hash, read_msg_sender_test()); + storage.store_factory_dep(bytecode_hash, upgrade_bytecode); + storage.store_factory_dep( + msg_sender_test_hash, + TestContract::msg_sender_test().bytecode.clone(), + ); } let address_to_deploy1 = H160::random(); @@ -287,15 +289,14 @@ fn get_forced_deploy_tx(deployment: &[ForceDeployment]) -> Transaction { // Returns the transaction that performs a complex protocol upgrade. // The first param is the address of the implementation of the complex upgrade // in user-space, while the next 3 params are params of the implementation itself -// For the explanation for the parameters, please refer to: -// etc/contracts-test-data/complex-upgrade/complex-upgrade.sol +// For the explanation for the parameters, please refer to the contract source code. fn get_complex_upgrade_tx( implementation_address: Address, address1: Address, address2: Address, bytecode_hash: H256, ) -> Transaction { - let impl_contract = get_complex_upgrade_abi(); + let impl_contract = &TestContract::complex_upgrade().abi; let impl_function = impl_contract.function("someComplexUpgrade").unwrap(); let impl_calldata = impl_function .encode_input(&[ @@ -334,10 +335,6 @@ fn get_complex_upgrade_tx( } } -fn read_msg_sender_test() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/msg-sender.sol/MsgSenderTest.json") -} - fn get_complex_upgrader_abi() -> Contract { load_sys_contract("ComplexUpgrader") } diff --git a/core/lib/multivm/src/versions/vm_fast/tests/utils.rs b/core/lib/multivm/src/versions/vm_fast/tests/utils.rs index 5ab5aa0dec9..459582b6068 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/utils.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/utils.rs @@ -1,10 +1,7 @@ use std::collections::BTreeMap; -use ethabi::Contract; use once_cell::sync::Lazy; -use zksync_contracts::{ - load_contract, read_bytecode, read_zbin_bytecode, BaseSystemContracts, SystemContractCode, -}; +use zksync_contracts::{read_zbin_bytecode, BaseSystemContracts, SystemContractCode}; use zksync_types::{ utils::storage_key_for_standard_token_balance, AccountTreeId, Address, StorageKey, H160, H256, U256, @@ -59,10 +56,6 @@ pub(crate) fn get_balance( .unwrap_or_else(|| h256_to_u256(main_storage.read_value(&key))) } -pub(crate) fn read_test_contract() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/counter/counter.sol/Counter.json") -} - pub(crate) fn get_bootloader(test: &str) -> SystemContractCode { let bootloader_code = read_zbin_bytecode(format!( "contracts/system-contracts/bootloader/tests/artifacts/{}.yul.zbin", @@ -75,63 +68,3 @@ pub(crate) fn get_bootloader(test: &str) -> SystemContractCode { hash: bootloader_hash, } } - -pub(crate) fn read_error_contract() -> Vec { - read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/error/error.sol/SimpleRequire.json", - ) -} - -pub(crate) fn get_execute_error_calldata() -> Vec { - let test_contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/error/error.sol/SimpleRequire.json", - ); - - let function = test_contract.function("require_short").unwrap(); - - function - .encode_input(&[]) - .expect("failed to encode parameters") -} - -pub(crate) fn read_many_owners_custom_account_contract() -> (Vec, Contract) { - let path = "etc/contracts-test-data/artifacts-zk/contracts/custom-account/many-owners-custom-account.sol/ManyOwnersCustomAccount.json"; - (read_bytecode(path), load_contract(path)) -} - -pub(crate) fn read_precompiles_contract() -> Vec { - read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json", - ) -} - -pub(crate) fn load_precompiles_contract() -> Contract { - load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json", - ) -} - -pub(crate) fn read_nonce_holder_tester() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/custom-account/nonce-holder-test.sol/NonceHolderTest.json") -} - -pub(crate) fn read_complex_upgrade() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/complex-upgrade.sol/ComplexUpgrade.json") -} - -pub(crate) fn get_complex_upgrade_abi() -> Contract { - load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/complex-upgrade.sol/ComplexUpgrade.json" - ) -} - -pub(crate) fn read_expensive_contract() -> (Vec, Contract) { - const PATH: &str = - "etc/contracts-test-data/artifacts-zk/contracts/expensive/expensive.sol/Expensive.json"; - (read_bytecode(PATH), load_contract(PATH)) -} - -pub(crate) fn read_proxy_counter_contract() -> (Vec, Contract) { - const PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/counter/proxy_counter.sol/ProxyCounter.json"; - (read_bytecode(PATH), load_contract(PATH)) -} diff --git a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs index 8d1eea40079..6bf7424b2bc 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs @@ -26,11 +26,10 @@ impl VmTester { } } -// TODO refactor this test it use too much internal details of the VM -#[test] /// This test deploys 'buggy' account abstraction code, and then tries accessing it both with legacy /// and EIP712 transactions. -/// Currently we support both, but in the future, we should allow only EIP712 transactions to access the AA accounts. +/// Currently, we support both, but in the future, we should allow only EIP712 transactions to access the AA accounts. +#[test] fn test_require_eip712() { // Use 3 accounts: // - `private_address` - EOA account, where we have the key diff --git a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs index 552cb853cb5..6d9df24fd30 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs @@ -261,7 +261,7 @@ fn test_layered_rollback() { #[test] fn rollback_in_call_mode() { - let counter_bytecode = read_test_contract(); + let counter_bytecode = TestContract::counter().bytecode.clone(); let counter_address = Address::repeat_byte(1); let mut vm = VmTesterBuilder::new(HistoryEnabled) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs index 151039f8fb3..ad041879349 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs @@ -110,7 +110,6 @@ fn test_send_and_transfer() { fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { let test_abi = &TestContract::transfer_test().abi; let reentrant_recipient_abi = &TestContract::reentrant_recipient().abi; - let test_contract_address = Address::random(); let reentrant_recipeint_address = Address::random(); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs index 2a5f3dc3cb0..40a322abca0 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs @@ -1,5 +1,5 @@ use zk_evm_1_5_0::aux_structures::Timestamp; -use zksync_contracts::{deployer_contract, load_sys_contract, read_bytecode}; +use zksync_contracts::{deployer_contract, load_sys_contract}; use zksync_test_account::{TestContract, TxType}; use zksync_types::{ ethabi::{Contract, Token}, @@ -179,7 +179,7 @@ fn test_complex_upgrader() { let storage_view = vm.storage.clone(); let upgrade_bytecode = TestContract::complex_upgrade().bytecode.clone(); let bytecode_hash = hash_bytecode(&upgrade_bytecode); - let msg_sender_test_hash = hash_bytecode(&read_msg_sender_test()); + let msg_sender_test_hash = hash_bytecode(&TestContract::msg_sender_test().bytecode); // Let's assume that the bytecode for the implementation of the complex upgrade // is already deployed in some address in user space @@ -206,7 +206,7 @@ fn test_complex_upgrader() { ), ( h256_to_u256(msg_sender_test_hash), - bytes_to_be_words(read_msg_sender_test()), + bytes_to_be_words(TestContract::msg_sender_test().bytecode.clone()), ), ], Timestamp(0), @@ -344,10 +344,6 @@ fn get_complex_upgrade_tx( } } -fn read_msg_sender_test() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/msg-sender.sol/MsgSenderTest.json") -} - fn get_complex_upgrader_abi() -> Contract { load_sys_contract("ComplexUpgrader") } diff --git a/core/tests/test_account/src/contracts.rs b/core/tests/test_account/src/contracts.rs index b5f1283353e..4f158a251cd 100644 --- a/core/tests/test_account/src/contracts.rs +++ b/core/tests/test_account/src/contracts.rs @@ -29,6 +29,8 @@ const LOAD_TEST_CONTRACT: &str = include_contract!("loadnext/loadnext_contract": const LOAD_TEST_DEPLOYED_CONTRACT: &str = include_contract!("loadnext/loadnext_contract"::Foo); const MANY_OWNERS_CONTRACT: &str = include_contract!("custom-account/many-owners-custom-account"::ManyOwnersCustomAccount); +const MSG_SENDER_TEST_CONTRACT: &str = + include_contract!("complex-upgrade/msg-sender"::MsgSenderTest); const NONCE_HOLDER_CONTRACT: &str = include_contract!("custom-account/nonce-holder-test"::NonceHolderTest); const PRECOMPILES_CONTRACT: &str = include_contract!("precompiles/precompiles"::Precompiles); @@ -116,6 +118,12 @@ impl TestContract { &CONTRACT } + pub fn msg_sender_test() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(MSG_SENDER_TEST_CONTRACT)); + &CONTRACT + } + pub fn nonce_holder() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(NONCE_HOLDER_CONTRACT)); From 3c56b17b85509173e739cea30939d6557fc09833 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 11:46:37 +0300 Subject: [PATCH 06/32] Remove duplicated `TestContract` in load test --- .../src/account/api_request_executor.rs | 3 +- .../loadnext/src/account/pubsub_executor.rs | 2 +- .../src/account/tx_command_executor.rs | 6 +- core/tests/loadnext/src/account_pool.rs | 8 +-- core/tests/loadnext/src/config.rs | 44 +------------ core/tests/loadnext/src/fs_utils.rs | 65 +------------------ 6 files changed, 12 insertions(+), 116 deletions(-) diff --git a/core/tests/loadnext/src/account/api_request_executor.rs b/core/tests/loadnext/src/account/api_request_executor.rs index 20c4bc2f597..4733b4c0920 100644 --- a/core/tests/loadnext/src/account/api_request_executor.rs +++ b/core/tests/loadnext/src/account/api_request_executor.rs @@ -52,8 +52,7 @@ impl AccountLifespan { err => RpcError::Custom(err.to_string()), }), ApiRequestType::GetLogs => { - let topics = - random_topics(&self.wallet.test_contract.contract, &mut self.wallet.rng); + let topics = random_topics(&self.wallet.test_contract.abi, &mut self.wallet.rng); // `run_api_requests_task` checks whether the cell is initialized // at every loop iteration and skips logs action if it's not. Thus, // it's safe to unwrap it. diff --git a/core/tests/loadnext/src/account/pubsub_executor.rs b/core/tests/loadnext/src/account/pubsub_executor.rs index 07f45b4ae97..1b31207aab8 100644 --- a/core/tests/loadnext/src/account/pubsub_executor.rs +++ b/core/tests/loadnext/src/account/pubsub_executor.rs @@ -67,7 +67,7 @@ impl AccountLifespan { let params = match subscription_type { SubscriptionType::Logs => { let topics = super::api_request_executor::random_topics( - &self.wallet.test_contract.contract, + &self.wallet.test_contract.abi, &mut self.wallet.rng, ); let contract_address = self.wallet.deployed_contract_address.get().unwrap(); diff --git a/core/tests/loadnext/src/account/tx_command_executor.rs b/core/tests/loadnext/src/account/tx_command_executor.rs index 2a916564fd6..da3da867ac8 100644 --- a/core/tests/loadnext/src/account/tx_command_executor.rs +++ b/core/tests/loadnext/src/account/tx_command_executor.rs @@ -329,7 +329,7 @@ impl AccountLifespan { U256::zero(), calldata, L1_TRANSACTION_GAS_LIMIT.into(), - Some(self.wallet.test_contract.factory_deps.clone()), + Some(self.wallet.test_contract.factory_deps()), None, None, Default::default(), @@ -375,7 +375,7 @@ impl AccountLifespan { } fn prepare_calldata_for_loadnext_contract(&self) -> Vec { - let contract = &self.wallet.test_contract.contract; + let contract = &self.wallet.test_contract.abi; let function = contract.function("execute").unwrap(); function .encode_input(&vec![ @@ -401,7 +401,7 @@ impl AccountLifespan { .start_execute_contract() .calldata(calldata) .contract_address(contract_address) - .factory_deps(self.wallet.test_contract.factory_deps.clone()); + .factory_deps(self.wallet.test_contract.factory_deps()); let fee = builder .estimate_fee(Some(get_approval_based_paymaster_input_for_estimation( diff --git a/core/tests/loadnext/src/account_pool.rs b/core/tests/loadnext/src/account_pool.rs index 3fa3141553c..9890fbf38eb 100644 --- a/core/tests/loadnext/src/account_pool.rs +++ b/core/tests/loadnext/src/account_pool.rs @@ -5,13 +5,13 @@ use once_cell::sync::OnceCell; use rand::Rng; use tokio::time::timeout; use zksync_eth_signer::PrivateKeySigner; +use zksync_test_account::TestContract; use zksync_types::{Address, K256PrivateKey, L2ChainId, H256}; use zksync_web3_decl::client::{Client, L2}; use crate::{ config::LoadtestConfig, corrupted_tx::CorruptedSigner, - fs_utils::{loadnext_contract, TestContract}, rng::{LoadtestRng, Random}, sdk::{signer::Signer, Wallet, ZksNamespaceClient}, }; @@ -68,7 +68,7 @@ pub struct TestWallet { /// Wallet with corrupted signer. pub corrupted_wallet: CorruptedSyncWallet, /// Contract bytecode and calldata to be used for sending `Execute` transactions. - pub test_contract: TestContract, + pub test_contract: &'static TestContract, /// Address of the deployed contract to be used for sending /// `Execute` transaction. pub deployed_contract_address: Arc>, @@ -116,7 +116,7 @@ impl AccountPool { anyhow::bail!("ZKsync server does not respond. Please check RPC address and whether server is launched"); } - let test_contract = loadnext_contract(&config.test_contracts_path)?; + let test_contract = TestContract::load_test(); let master_wallet = { let eth_private_key: H256 = config @@ -166,7 +166,7 @@ impl AccountPool { let account = TestWallet { wallet: Arc::new(wallet), corrupted_wallet: Arc::new(corrupted_wallet), - test_contract: test_contract.clone(), + test_contract, deployed_contract_address: deployed_contract_address.clone(), rng: rng.derive(private_key_bytes), }; diff --git a/core/tests/loadnext/src/config.rs b/core/tests/loadnext/src/config.rs index 93816e5f583..836dbe864bb 100644 --- a/core/tests/loadnext/src/config.rs +++ b/core/tests/loadnext/src/config.rs @@ -1,10 +1,9 @@ -use std::{path::PathBuf, time::Duration}; +use std::time::Duration; use serde::Deserialize; use tokio::sync::Semaphore; use zksync_test_account::LoadnextContractExecutionParams; use zksync_types::{network::Network, Address, L2ChainId, H160}; -use zksync_utils::env::Workspace; use crate::fs_utils::read_tokens; @@ -49,28 +48,6 @@ pub struct LoadtestConfig { #[serde(default = "default_main_token")] pub main_token: Address, - /// Path to test contracts bytecode and ABI required for sending - /// deploy and execute L2 transactions. Each folder in the path is expected - /// to have the following structure: - ///```ignore - /// . - /// ├── bytecode - /// └── abi.json - ///``` - /// Contract folder names names are not restricted. - /// - /// An example: - ///```ignore - /// . - /// ├── erc-20 - /// │   ├── bytecode - /// │   └── abi.json - /// └── simple-contract - /// ├── bytecode - /// └── abi.json - ///``` - #[serde(default = "default_test_contracts_path")] - pub test_contracts_path: PathBuf, /// Limits the number of simultaneous API requests being performed at any moment of time. /// /// Setting it to: @@ -189,12 +166,6 @@ fn default_main_token() -> H160 { main_token.address } -fn default_test_contracts_path() -> PathBuf { - let test_contracts_path = Workspace::locate().core().join("etc/contracts-test-data"); - tracing::info!("Test contracts path: {}", test_contracts_path.display()); - test_contracts_path -} - fn default_sync_api_requests_limit() -> usize { let result = 20; tracing::info!("Using default SYNC_API_REQUESTS_LIMIT: {result}"); @@ -342,16 +313,3 @@ impl RequestLimiters { } } } - -#[cfg(test)] -mod tests { - - use super::*; - use crate::fs_utils::loadnext_contract; - - #[test] - fn check_read_test_contract() { - let test_contracts_path = default_test_contracts_path(); - loadnext_contract(&test_contracts_path).unwrap(); - } -} diff --git a/core/tests/loadnext/src/fs_utils.rs b/core/tests/loadnext/src/fs_utils.rs index c4472a00531..0e5107f4086 100644 --- a/core/tests/loadnext/src/fs_utils.rs +++ b/core/tests/loadnext/src/fs_utils.rs @@ -1,10 +1,10 @@ //! Utilities used for reading tokens, contracts bytecode and ABI from the //! filesystem. -use std::{fs::File, io::BufReader, path::Path}; +use std::{fs::File, io::BufReader}; use serde::Deserialize; -use zksync_types::{ethabi::Contract, network::Network, Address}; +use zksync_types::{network::Network, Address}; use zksync_utils::env::Workspace; /// A token stored in `etc/tokens/{network}.json` files. @@ -16,16 +16,6 @@ pub struct Token { pub address: Address, } -#[derive(Debug, Clone)] -pub struct TestContract { - /// Contract bytecode to be used for sending deploy transaction. - pub bytecode: Vec, - /// Contract ABI. - pub contract: Contract, - - pub factory_deps: Vec>, -} - pub fn read_tokens(network: Network) -> anyhow::Result> { let home = Workspace::locate().core(); let path = home.join(format!("etc/tokens/{network}.json")); @@ -34,54 +24,3 @@ pub fn read_tokens(network: Network) -> anyhow::Result> { Ok(serde_json::from_reader(reader)?) } - -fn extract_bytecode(artifact: &serde_json::Value) -> anyhow::Result> { - let bytecode = artifact["bytecode"] - .as_str() - .ok_or_else(|| anyhow::anyhow!("Failed to parse contract bytecode from artifact",))?; - - if let Some(stripped) = bytecode.strip_prefix("0x") { - hex::decode(stripped) - } else { - hex::decode(bytecode) - } - .map_err(|e| e.into()) -} - -/// Reads test contract bytecode and its ABI. -fn read_contract_dir(path: &Path) -> anyhow::Result { - use serde_json::Value; - - let mut artifact: Value = - serde_json::from_reader(File::open(path.join("LoadnextContract.json"))?)?; - - let bytecode = extract_bytecode(&artifact)?; - - let abi = artifact["abi"].take(); - let contract: Contract = serde_json::from_value(abi)?; - - let factory_dep: Value = serde_json::from_reader(File::open(path.join("Foo.json"))?)?; - let factory_dep_bytecode = extract_bytecode(&factory_dep)?; - - anyhow::ensure!( - contract.functions().count() > 0, - "Invalid contract: no methods defined: {:?}", - path - ); - anyhow::ensure!( - contract.events().count() > 0, - "Invalid contract: no events defined: {:?}", - path - ); - - Ok(TestContract { - bytecode, - contract, - factory_deps: vec![factory_dep_bytecode], - }) -} - -pub fn loadnext_contract(path: &Path) -> anyhow::Result { - let path = path.join("artifacts-zk/contracts/loadnext/loadnext_contract.sol"); - read_contract_dir(&path) -} From 8d4c71c0700cd4df1a739593618989aa6ab79974 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 11:51:51 +0300 Subject: [PATCH 07/32] Remove building test contracts from toolbox --- .../zk_supervisor/src/commands/contracts.rs | 18 ++---------------- .../zk_supervisor/src/commands/test/utils.rs | 5 ----- .../crates/zk_supervisor/src/messages.rs | 2 -- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs b/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs index bab4205cd66..6acae3868ab 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs @@ -8,9 +8,8 @@ use xshell::{cmd, Shell}; use crate::messages::{ MSG_BUILDING_CONTRACTS, MSG_BUILDING_CONTRACTS_SUCCESS, MSG_BUILDING_L1_CONTRACTS_SPINNER, MSG_BUILDING_L2_CONTRACTS_SPINNER, MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER, - MSG_BUILDING_TEST_CONTRACTS_SPINNER, MSG_BUILD_L1_CONTRACTS_HELP, MSG_BUILD_L2_CONTRACTS_HELP, - MSG_BUILD_SYSTEM_CONTRACTS_HELP, MSG_BUILD_TEST_CONTRACTS_HELP, MSG_CONTRACTS_DEPS_SPINNER, - MSG_NOTHING_TO_BUILD_MSG, + MSG_BUILD_L1_CONTRACTS_HELP, MSG_BUILD_L2_CONTRACTS_HELP, MSG_BUILD_SYSTEM_CONTRACTS_HELP, + MSG_CONTRACTS_DEPS_SPINNER, MSG_NOTHING_TO_BUILD_MSG, }; #[derive(Debug, Parser)] @@ -21,8 +20,6 @@ pub struct ContractsArgs { pub l2_contracts: Option, #[clap(long, alias = "sc", help = MSG_BUILD_SYSTEM_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] pub system_contracts: Option, - #[clap(long, alias = "test", help = MSG_BUILD_TEST_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] - pub test_contracts: Option, } impl ContractsArgs { @@ -30,13 +27,11 @@ impl ContractsArgs { if self.l1_contracts.is_none() && self.l2_contracts.is_none() && self.system_contracts.is_none() - && self.test_contracts.is_none() { return vec![ ContractType::L1, ContractType::L2, ContractType::SystemContracts, - ContractType::TestContracts, ]; } @@ -51,9 +46,6 @@ impl ContractsArgs { if self.system_contracts.unwrap_or(false) { contracts.push(ContractType::SystemContracts); } - if self.test_contracts.unwrap_or(false) { - contracts.push(ContractType::TestContracts); - } contracts } @@ -64,7 +56,6 @@ pub enum ContractType { L1, L2, SystemContracts, - TestContracts, } #[derive(Debug)] @@ -92,11 +83,6 @@ impl ContractBuilder { cmd: "yarn sc build".to_string(), msg: MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER.to_string(), }, - ContractType::TestContracts => Self { - dir: ecosystem.link_to_code.join("etc/contracts-test-data"), - cmd: "yarn build".to_string(), - msg: MSG_BUILDING_TEST_CONTRACTS_SPINNER.to_string(), - }, } } diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/utils.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/utils.rs index 8656ff44d31..20f221c61b0 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/utils.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/test/utils.rs @@ -16,9 +16,7 @@ use crate::messages::{ pub const TEST_WALLETS_PATH: &str = "etc/test_config/constant/eth.json"; const AMOUNT_FOR_DISTRIBUTION_TO_WALLETS: u128 = 1000000000000000000000; - pub const TS_INTEGRATION_PATH: &str = "core/tests/ts-integration"; -const CONTRACTS_TEST_DATA_PATH: &str = "etc/contracts-test-data"; #[derive(Deserialize)] pub struct TestWallets { @@ -89,9 +87,6 @@ pub fn build_contracts(shell: &Shell, ecosystem_config: &EcosystemConfig) -> any Cmd::new(cmd!(shell, "yarn build")).run()?; Cmd::new(cmd!(shell, "yarn build-yul")).run()?; - let _dir_guard = shell.push_dir(ecosystem_config.link_to_code.join(CONTRACTS_TEST_DATA_PATH)); - Cmd::new(cmd!(shell, "yarn build")).run()?; - spinner.finish(); Ok(()) } diff --git a/zk_toolbox/crates/zk_supervisor/src/messages.rs b/zk_toolbox/crates/zk_supervisor/src/messages.rs index 6f6deb22edb..73b26d4ed17 100644 --- a/zk_toolbox/crates/zk_supervisor/src/messages.rs +++ b/zk_toolbox/crates/zk_supervisor/src/messages.rs @@ -114,12 +114,10 @@ pub(super) const MSG_CONTRACTS_DEPS_SPINNER: &str = "Installing dependencies.."; pub(super) const MSG_BUILDING_L2_CONTRACTS_SPINNER: &str = "Building L2 contracts.."; pub(super) const MSG_BUILDING_L1_CONTRACTS_SPINNER: &str = "Building L1 contracts.."; pub(super) const MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER: &str = "Building system contracts.."; -pub(super) const MSG_BUILDING_TEST_CONTRACTS_SPINNER: &str = "Building test contracts.."; pub(super) const MSG_BUILDING_CONTRACTS_SUCCESS: &str = "Contracts built successfully"; pub(super) const MSG_BUILD_L1_CONTRACTS_HELP: &str = "Build L1 contracts"; pub(super) const MSG_BUILD_L2_CONTRACTS_HELP: &str = "Build L2 contracts"; pub(super) const MSG_BUILD_SYSTEM_CONTRACTS_HELP: &str = "Build system contracts"; -pub(super) const MSG_BUILD_TEST_CONTRACTS_HELP: &str = "Build test contracts"; // Integration tests related messages pub(super) fn msg_integration_tests_run(external_node: bool) -> String { From 5dcff9b3e6f3d057c637c24a2eb000aa93c8b00b Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 11:54:42 +0300 Subject: [PATCH 08/32] Remove remaining test contract mentions --- .../ts-integration/tests/contracts.test.ts | 29 ------------------- infrastructure/zk/src/compiler.ts | 1 - package.json | 1 - 3 files changed, 31 deletions(-) diff --git a/core/tests/ts-integration/tests/contracts.test.ts b/core/tests/ts-integration/tests/contracts.test.ts index cb1bec35b51..5f69656f64e 100644 --- a/core/tests/ts-integration/tests/contracts.test.ts +++ b/core/tests/ts-integration/tests/contracts.test.ts @@ -423,35 +423,6 @@ describe('Smart contract behavior checks', () => { expect(receipt.status).toEqual(1); }); - test('Should check transient storage', async () => { - const artifact = require(`${ - testMaster.environment().pathToHome - }/etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json`); - const contractFactory = new zksync.ContractFactory(artifact.abi, artifact.bytecode, alice); - const storageContract = (await contractFactory.deploy()) as zksync.Contract; - await storageContract.waitForDeployment(); - // Tests transient storage, see contract code for details. - await expect(storageContract.testTransientStore()).toBeAccepted([]); - // Checks that transient storage is cleaned up after each tx. - await expect(storageContract.assertTValue(0)).toBeAccepted([]); - }); - - test('Should check code oracle works', async () => { - // Deploy contract that calls CodeOracle. - const artifact = require(`${ - testMaster.environment().pathToHome - }/etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json`); - const contractFactory = new zksync.ContractFactory(artifact.abi, artifact.bytecode, alice); - const contract = (await contractFactory.deploy()) as zksync.Contract; - await contract.waitForDeployment(); - - // Check that CodeOracle can decommit code of just deployed contract. - const versionedHash = zksync.utils.hashBytecode(artifact.bytecode); - const expectedBytecodeHash = ethers.keccak256(artifact.bytecode); - - await expect(contract.callCodeOracle(versionedHash, expectedBytecodeHash)).toBeAccepted([]); - }); - afterAll(async () => { await testMaster.deinitialize(); }); diff --git a/infrastructure/zk/src/compiler.ts b/infrastructure/zk/src/compiler.ts index 9a90154909b..881908eeace 100644 --- a/infrastructure/zk/src/compiler.ts +++ b/infrastructure/zk/src/compiler.ts @@ -2,7 +2,6 @@ import { Command } from 'commander'; import * as utils from 'utils'; export async function compileTestContracts() { - await utils.spawn('yarn workspace contracts-test-data build'); await utils.spawn('yarn ts-integration build'); await utils.spawn('yarn ts-integration build-yul'); } diff --git a/package.json b/package.json index af745160c30..9e3428e614c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "contracts/l1-contracts", "contracts/l2-contracts", "contracts/system-contracts", - "etc/contracts-test-data", "etc/ERC20", "etc/utils", "infrastructure/zk", From f3a2091bb7622b717f345ec80125471fcf1147a0 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 11:55:17 +0300 Subject: [PATCH 09/32] Remove old test contracts dir --- etc/contracts-test-data/README.md | 4 - .../basic-constructor/basic-constructor.sol | 16 - .../complex-upgrade/complex-upgrade.sol | 112 - .../contracts/complex-upgrade/msg-sender.sol | 11 - .../contracts/context/context.sol | 47 - .../contracts/counter/counter.sol | 27 - .../contracts/counter/proxy_counter.sol | 26 - .../contracts/create/Foo.sol | 8 - .../contracts/create/create.sol | 17 - .../contracts/custom-account/Constants.sol | 37 - .../contracts/custom-account/RLPEncoder.sol | 100 - .../custom-account/SystemContext.sol | 67 - .../custom-account/SystemContractsCaller.sol | 266 -- .../custom-account/TransactionHelper.sol | 467 --- .../contracts/custom-account/Utils.sol | 38 - .../custom-account/custom-account.sol | 106 - .../custom-account/custom-paymaster.sol | 81 - .../custom-account/interfaces/IAccount.sol | 47 - .../interfaces/IContractDeployer.sol | 110 - .../custom-account/interfaces/IERC20.sol | 82 - .../interfaces/INonceHolder.sol | 42 - .../custom-account/interfaces/IPaymaster.sol | 51 - .../interfaces/IPaymasterFlow.sol | 16 - .../many-owners-custom-account.sol | 151 - .../custom-account/nonce-holder-test.sol | 100 - .../contracts/error/error.sol | 22 - .../contracts/estimator/estimator.sol | 30 - .../contracts/events/events.sol | 15 - .../contracts/events/sample-calldata | Bin 96 -> 0 bytes .../contracts/expensive/expensive.sol | 21 - .../contracts/failed-call/failed_call.sol | 24 - .../contracts/infinite/infinite.sol | 19 - .../contracts/loadnext/loadnext_contract.sol | 56 - .../long-return-data/long-return-data.sol | 13 - .../contracts/precompiles/precompiles.sol | 39 - .../simple-transfer/simple-transfer.sol | 35 - .../contracts/storage/storage.sol | 103 - .../contracts/transfer/transfer.sol | 44 - etc/contracts-test-data/counter/counter.sol | 27 - etc/contracts-test-data/hardhat.config.ts | 35 - etc/contracts-test-data/package.json | 16 - etc/contracts-test-data/yarn.lock | 2757 ----------------- 42 files changed, 5285 deletions(-) delete mode 100644 etc/contracts-test-data/README.md delete mode 100644 etc/contracts-test-data/contracts/basic-constructor/basic-constructor.sol delete mode 100644 etc/contracts-test-data/contracts/complex-upgrade/complex-upgrade.sol delete mode 100644 etc/contracts-test-data/contracts/complex-upgrade/msg-sender.sol delete mode 100644 etc/contracts-test-data/contracts/context/context.sol delete mode 100644 etc/contracts-test-data/contracts/counter/counter.sol delete mode 100644 etc/contracts-test-data/contracts/counter/proxy_counter.sol delete mode 100644 etc/contracts-test-data/contracts/create/Foo.sol delete mode 100644 etc/contracts-test-data/contracts/create/create.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/Constants.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/RLPEncoder.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/SystemContext.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/SystemContractsCaller.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/TransactionHelper.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/Utils.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/custom-account.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/custom-paymaster.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/interfaces/IAccount.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/interfaces/IContractDeployer.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/interfaces/IERC20.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/interfaces/INonceHolder.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/interfaces/IPaymaster.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/interfaces/IPaymasterFlow.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/many-owners-custom-account.sol delete mode 100644 etc/contracts-test-data/contracts/custom-account/nonce-holder-test.sol delete mode 100644 etc/contracts-test-data/contracts/error/error.sol delete mode 100644 etc/contracts-test-data/contracts/estimator/estimator.sol delete mode 100644 etc/contracts-test-data/contracts/events/events.sol delete mode 100644 etc/contracts-test-data/contracts/events/sample-calldata delete mode 100644 etc/contracts-test-data/contracts/expensive/expensive.sol delete mode 100644 etc/contracts-test-data/contracts/failed-call/failed_call.sol delete mode 100644 etc/contracts-test-data/contracts/infinite/infinite.sol delete mode 100644 etc/contracts-test-data/contracts/loadnext/loadnext_contract.sol delete mode 100644 etc/contracts-test-data/contracts/long-return-data/long-return-data.sol delete mode 100644 etc/contracts-test-data/contracts/precompiles/precompiles.sol delete mode 100644 etc/contracts-test-data/contracts/simple-transfer/simple-transfer.sol delete mode 100644 etc/contracts-test-data/contracts/storage/storage.sol delete mode 100644 etc/contracts-test-data/contracts/transfer/transfer.sol delete mode 100644 etc/contracts-test-data/counter/counter.sol delete mode 100644 etc/contracts-test-data/hardhat.config.ts delete mode 100644 etc/contracts-test-data/package.json delete mode 100644 etc/contracts-test-data/yarn.lock diff --git a/etc/contracts-test-data/README.md b/etc/contracts-test-data/README.md deleted file mode 100644 index 532703ad210..00000000000 --- a/etc/contracts-test-data/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Contracts test data - -This folder contains data for contracts that are being used for testing to check the correctness of the smart contract -flow in ZKsync. diff --git a/etc/contracts-test-data/contracts/basic-constructor/basic-constructor.sol b/etc/contracts-test-data/contracts/basic-constructor/basic-constructor.sol deleted file mode 100644 index d2fe2d0eefb..00000000000 --- a/etc/contracts-test-data/contracts/basic-constructor/basic-constructor.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -contract SimpleConstructor { - uint256 c; - - constructor(uint256 a, uint256 b, bool shouldRevert) { - c = a * b; - require(!shouldRevert, "reverted deploy"); - } - - function get() public view returns (uint256) { - return c; - } -} diff --git a/etc/contracts-test-data/contracts/complex-upgrade/complex-upgrade.sol b/etc/contracts-test-data/contracts/complex-upgrade/complex-upgrade.sol deleted file mode 100644 index e65f51d5652..00000000000 --- a/etc/contracts-test-data/contracts/complex-upgrade/complex-upgrade.sol +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -import {MIMIC_CALL_CALL_ADDRESS, SystemContractsCaller, CalldataForwardingMode} from "../custom-account/SystemContractsCaller.sol"; -import "../custom-account/interfaces/IContractDeployer.sol"; - -import { DEPLOYER_SYSTEM_CONTRACT, FORCE_DEPLOYER } from "../custom-account/Constants.sol"; -import "./msg-sender.sol"; - -contract ComplexUpgrade { - constructor() {} - - struct MimicCallInfo { - address to; - address whoToMimic; - bytes data; - } - - function _mimicCall(MimicCallInfo memory info) internal { - address callAddr = MIMIC_CALL_CALL_ADDRESS; - - bytes memory data = info.data; - address to = info.to; - address whoToMimic = info.whoToMimic; - - uint32 dataStart; - uint32 dataLength; - assembly { - dataStart := add(data, 0x20) - dataLength := mload(data) - } - - uint256 farCallAbi = SystemContractsCaller.getFarCallABI( - 0, - 0, - dataStart, - dataLength, - uint32(gasleft()), - // Only rollup is supported for now - 0, - CalldataForwardingMode.UseHeap, - false, - true - ); - - assembly { - let success := call(to, callAddr, 0, farCallAbi, whoToMimic, 0, 0) - - if iszero(success) { - returndatacopy(0, 0, returndatasize()) - revert(0, returndatasize()) - } - } - } - - function mimicCalls( - MimicCallInfo[] memory info - ) public { - for (uint256 i = 0; i < info.length; i++) { - _mimicCall(info[i]); - } - } - - // This function is used to imitate some complex upgrade logic - function someComplexUpgrade( - address _address1, - address _address2, - bytes32 _bytecodeHash - ) external { - IContractDeployer.ForceDeployment memory forceDeployment1 = IContractDeployer.ForceDeployment( - _bytecodeHash, - _address1, - false, - 0, - new bytes(0) - ); - - IContractDeployer.ForceDeployment memory forceDeployment2 = IContractDeployer.ForceDeployment( - _bytecodeHash, - _address2, - false, - 0, - new bytes(0) - ); - - IContractDeployer.ForceDeployment[] memory deploymentInput1 = new IContractDeployer.ForceDeployment[](1); - deploymentInput1[0] = forceDeployment1; - - IContractDeployer.ForceDeployment[] memory deploymentInput2 = new IContractDeployer.ForceDeployment[](1); - deploymentInput2[0] = forceDeployment2; - - DEPLOYER_SYSTEM_CONTRACT.forceDeployOnAddresses(deploymentInput1); - DEPLOYER_SYSTEM_CONTRACT.forceDeployOnAddresses(deploymentInput2); - - // Here we also test the fact that complex upgrade implementation can use mimicCall - MsgSenderTest msgSenderTest = new MsgSenderTest(); - address toMimic = address(0x1); - bytes memory _mimicCallCalldata = abi.encodeWithSelector( - MsgSenderTest.testMsgSender.selector, - toMimic - ); - - MimicCallInfo memory info = MimicCallInfo({ - to: address(msgSenderTest), - whoToMimic: toMimic, - data: _mimicCallCalldata - }); - - _mimicCall(info); - } -} diff --git a/etc/contracts-test-data/contracts/complex-upgrade/msg-sender.sol b/etc/contracts-test-data/contracts/complex-upgrade/msg-sender.sol deleted file mode 100644 index 0388f2f5408..00000000000 --- a/etc/contracts-test-data/contracts/complex-upgrade/msg-sender.sol +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -contract MsgSenderTest { - function testMsgSender( - address _expectedSender - ) external view { - require(msg.sender == _expectedSender, "Wrong sender"); - } -} diff --git a/etc/contracts-test-data/contracts/context/context.sol b/etc/contracts-test-data/contracts/context/context.sol deleted file mode 100644 index 94969ac66f9..00000000000 --- a/etc/contracts-test-data/contracts/context/context.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.8.0; - -contract Context { - function getBlockNumber() public view returns (uint256) { - return block.number; - } - - function getBlockTimestamp() public view returns (uint256) { - return block.timestamp; - } - - function getBlockGasLimit() public view returns (uint256) { - return block.gaslimit; - } - - function getTxGasPrice() public view returns (uint256) { - return tx.gasprice; - } - - function checkBlockNumber(uint256 fromBlockNumber, uint256 toBlockNumber) public { - require(fromBlockNumber <= block.number && block.number <= toBlockNumber, "block number is out of range"); - } - - function checkBlockTimestamp(uint256 fromTimestamp, uint256 toTimestamp) public { - require(fromTimestamp <= block.timestamp && block.timestamp <= toTimestamp, "block timestamp is out of range"); - } - - function checkTxOrigin(address expectedOrigin) public { - require(tx.origin == expectedOrigin, "tx.origin is invalid"); - } - - function getBaseFee() public view returns (uint256) { - return block.basefee; - } - - function requireMsgValue(uint256 _requiredValue) external payable { - require(msg.value == _requiredValue); - } - - uint256 public valueOnCreate; - - constructor() payable { - valueOnCreate = msg.value; - } -} diff --git a/etc/contracts-test-data/contracts/counter/counter.sol b/etc/contracts-test-data/contracts/counter/counter.sol deleted file mode 100644 index c0f4bda130d..00000000000 --- a/etc/contracts-test-data/contracts/counter/counter.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.8.0; - -contract Counter { - uint256 value; - - function increment(uint256 x) external { - value += x; - } - - function incrementWithRevertPayable(uint256 x, bool shouldRevert) payable public returns (uint256) { - return incrementWithRevert(x, shouldRevert); - } - - function incrementWithRevert(uint256 x, bool shouldRevert) public returns (uint256) { - value += x; - if(shouldRevert) { - revert("This method always reverts"); - } - return value; - } - - function get() public view returns (uint256) { - return value; - } -} diff --git a/etc/contracts-test-data/contracts/counter/proxy_counter.sol b/etc/contracts-test-data/contracts/counter/proxy_counter.sol deleted file mode 100644 index b3bbf9dda93..00000000000 --- a/etc/contracts-test-data/contracts/counter/proxy_counter.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -interface ICounter { - function increment(uint256 x) external; -} - -contract ProxyCounter { - ICounter counter; - - constructor(ICounter _counter) { - counter = _counter; - } - - uint256 lastFarCallCost; - - function increment(uint256 x, uint gasToPass) public { - while (gasleft() > gasToPass) { - // Burn gas so that there's about `gasToPass` left before the external call. - } - uint256 gasBefore = gasleft(); - counter.increment(x); - lastFarCallCost = gasBefore - gasleft(); - } -} diff --git a/etc/contracts-test-data/contracts/create/Foo.sol b/etc/contracts-test-data/contracts/create/Foo.sol deleted file mode 100644 index 1ae4868e5bf..00000000000 --- a/etc/contracts-test-data/contracts/create/Foo.sol +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.1; -pragma abicoder v2; - -contract Foo { - string public name = "Foo"; -} diff --git a/etc/contracts-test-data/contracts/create/create.sol b/etc/contracts-test-data/contracts/create/create.sol deleted file mode 100644 index ef03e7c457c..00000000000 --- a/etc/contracts-test-data/contracts/create/create.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.1; -pragma abicoder v2; - -// import Foo.sol from current directory -import "./Foo.sol"; - -contract Import { - // Initialize Foo.sol - Foo public foo = new Foo(); - - // Test Foo.sol by getting it's name. - function getFooName() public view returns (string memory) { - return foo.name(); - } -} \ No newline at end of file diff --git a/etc/contracts-test-data/contracts/custom-account/Constants.sol b/etc/contracts-test-data/contracts/custom-account/Constants.sol deleted file mode 100644 index 59399d232ea..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/Constants.sol +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -import "./interfaces/INonceHolder.sol"; -import "./interfaces/IContractDeployer.sol"; -import "./SystemContext.sol"; - -uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15 - -address constant ECRECOVER_SYSTEM_CONTRACT = address(0x01); -address constant SHA256_SYSTEM_CONTRACT = address(0x02); - -address payable constant BOOTLOADER_FORMAL_ADDRESS = payable(address(SYSTEM_CONTRACTS_OFFSET + 0x01)); -INonceHolder constant NONCE_HOLDER_SYSTEM_CONTRACT = INonceHolder(address(SYSTEM_CONTRACTS_OFFSET + 0x03)); - -// A contract that is allowed to deploy any codehash -// on any address. To be used only during an upgrade. -address constant FORCE_DEPLOYER = address(SYSTEM_CONTRACTS_OFFSET + 0x07); -address constant MSG_VALUE_SYSTEM_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x09); -IContractDeployer constant DEPLOYER_SYSTEM_CONTRACT = IContractDeployer(address(SYSTEM_CONTRACTS_OFFSET + 0x06)); - - -address constant KECCAK256_SYSTEM_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x10); - -address constant BASE_TOKEN_SYSTEM_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x0a); -SystemContext constant SYSTEM_CONTEXT_CONTRACT = SystemContext(address(SYSTEM_CONTRACTS_OFFSET + 0x0b)); - -uint256 constant MAX_SYSTEM_CONTRACT_ADDRESS = 0xffff; - -bytes32 constant DEFAULT_ACCOUNT_CODE_HASH = 0x00; - -// The number of bytes that are published during the contract deployment -// in addition to the bytecode itself. -uint256 constant BYTECODE_PUBLISHING_OVERHEAD = 100; - -uint256 constant MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT = 2**128; diff --git a/etc/contracts-test-data/contracts/custom-account/RLPEncoder.sol b/etc/contracts-test-data/contracts/custom-account/RLPEncoder.sol deleted file mode 100644 index 409f3d16b37..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/RLPEncoder.sol +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -library RLPEncoder { - function encodeAddress(address _val) internal pure returns (bytes memory encoded) { - // The size is equal to 14 bytes of the address itself + 1 for encoding bytes length in RLP. - encoded = new bytes(0x15); - - bytes20 shiftedVal = bytes20(_val); - assembly { - // In the first byte we write the encoded length as 0x80 + 0x14 == 0x94. - mstore(add(encoded, 0x20), 0x9400000000000000000000000000000000000000000000000000000000000000) - // Write address data without stripping zeros. - mstore(add(encoded, 0x21), shiftedVal) - } - } - - function encodeUint256(uint256 _val) internal pure returns (bytes memory encoded) { - unchecked { - if (_val < 128) { - encoded = new bytes(1); - // Handle zero as a non-value, since stripping zeroes results in an empty byte array - encoded[0] = (_val == 0) ? bytes1(uint8(128)) : bytes1(uint8(_val)); - } else { - uint256 hbs = _highestByteSet(_val); - - encoded = new bytes(hbs + 2); - encoded[0] = bytes1(uint8(hbs + 0x81)); - - uint256 lbs = 31 - hbs; - uint256 shiftedVal = _val << (lbs * 8); - - assembly { - mstore(add(encoded, 0x21), shiftedVal) - } - } - } - } - - /// @notice Encodes the size of bytes in RLP format. - /// NOTE: panics if the length is 1, since the length encoding is ambiguous in this case. - function encodeNonSingleBytesLen(uint256 _len) internal pure returns (bytes memory) { - assert(_len != 1); - return _encodeLength(_len, 0x80); - } - - /// @notice Encodes the size of list items in RLP format. - function encodeListLen(uint256 _len) internal pure returns (bytes memory) { - return _encodeLength(_len, 0xc0); - } - - function _encodeLength(uint256 _len, uint256 _offset) private pure returns (bytes memory encoded) { - unchecked { - if (_len < 56) { - encoded = new bytes(1); - encoded[0] = bytes1(uint8(_len + _offset)); - } else { - uint256 hbs = _highestByteSet(_len); - - encoded = new bytes(hbs + 2); - encoded[0] = bytes1(uint8(_offset + hbs + 56)); - - uint256 lbs = 31 - hbs; - uint256 shiftedVal = _len << (lbs * 8); - - assembly { - mstore(add(encoded, 0x21), shiftedVal) - } - } - } - } - - /// @notice Computes the index of the highest byte set in number. - /// @notice Uses little endian ordering (The least significant byte has index `0`). - /// NOTE: returns `0` for `0` - function _highestByteSet(uint256 _number) private pure returns (uint256 hbs) { - // TODO: for optimization, the comparison can be replaced with bitwise operations - // should be resolver after evaluating the cost of opcodes. - if (_number >= 2**128) { - _number >>= 128; - hbs += 16; - } - if (_number >= 2**64) { - _number >>= 64; - hbs += 8; - } - if (_number >= 2**32) { - _number >>= 32; - hbs += 4; - } - if (_number >= 2**16) { - _number >>= 16; - hbs += 2; - } - if (_number >= 2**8) { - hbs += 1; - } - } -} diff --git a/etc/contracts-test-data/contracts/custom-account/SystemContext.sol b/etc/contracts-test-data/contracts/custom-account/SystemContext.sol deleted file mode 100644 index dbf81002d51..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/SystemContext.sol +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -import "./Constants.sol"; - -/** - * @author Matter Labs - * @notice Contract that stores some of the context variables, that may be either - * block-scoped, tx-scoped or system-wide. - */ -contract SystemContext { - modifier onlyBootloader { - require(msg.sender == BOOTLOADER_FORMAL_ADDRESS); - _; - } - - uint256 public chainId = 270; - address public origin; - uint256 public gasPrice; - // Some dummy value, maybe will be possible to change it in the future. - uint256 public blockGasLimit = (1 << 30); - // For the support of coinbase, we will the bootloader formal address for now - address public coinbase = BOOTLOADER_FORMAL_ADDRESS; - // For consistency with other L2s - uint256 public difficulty = 2500000000000000; - uint256 public msize = (1 << 24); - uint256 public baseFee; - - uint256 constant BLOCK_INFO_BLOCK_NUMBER_PART = (1<<128); - // 2^128 * block_number + block_timestamp - uint256 public currentBlockInfo; - - mapping(uint256 => bytes32) public blockHash; - - function setTxOrigin(address _newOrigin) external { - origin = _newOrigin; - } - - function setGasPrice(uint256 _gasPrice) external onlyBootloader { - gasPrice = _gasPrice; - } - - function getBlockHashEVM(uint256 _block) external view returns (bytes32 hash) { - if(block.number < _block || block.number - _block > 256) { - hash = bytes32(0); - } else { - hash = blockHash[_block]; - } - } - - function getBlockNumberAndTimestamp() public view returns (uint256 blockNumber, uint256 blockTimestamp) { - uint256 blockInfo = currentBlockInfo; - blockNumber = blockInfo / BLOCK_INFO_BLOCK_NUMBER_PART; - blockTimestamp = blockInfo % BLOCK_INFO_BLOCK_NUMBER_PART; - } - - // Note, that for now, the implementation of the bootloader allows this variables to - // be incremented multiple times inside a block, so it should not relied upon right now. - function getBlockNumber() public view returns (uint256 blockNumber) { - (blockNumber, ) = getBlockNumberAndTimestamp(); - } - - function getBlockTimestamp() public view returns (uint256 timestamp) { - (, timestamp) = getBlockNumberAndTimestamp(); - } -} diff --git a/etc/contracts-test-data/contracts/custom-account/SystemContractsCaller.sol b/etc/contracts-test-data/contracts/custom-account/SystemContractsCaller.sol deleted file mode 100644 index 3ec2b81a107..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/SystemContractsCaller.sol +++ /dev/null @@ -1,266 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8; - -import {MSG_VALUE_SYSTEM_CONTRACT, MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT} from "./Constants.sol"; -import "./Utils.sol"; - -// Addresses used for the compiler to be replaced with the -// ZKsync-specific opcodes during the compilation. -// IMPORTANT: these are just compile-time constants and are used -// only if used in-place by Yul optimizer. -address constant TO_L1_CALL_ADDRESS = address((1 << 16) - 1); -address constant CODE_ADDRESS_CALL_ADDRESS = address((1 << 16) - 2); -address constant PRECOMPILE_CALL_ADDRESS = address((1 << 16) - 3); -address constant META_CALL_ADDRESS = address((1 << 16) - 4); -address constant MIMIC_CALL_CALL_ADDRESS = address((1 << 16) - 5); -address constant SYSTEM_MIMIC_CALL_CALL_ADDRESS = address((1 << 16) - 6); -address constant MIMIC_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 7); -address constant SYSTEM_MIMIC_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 8); -address constant RAW_FAR_CALL_CALL_ADDRESS = address((1 << 16) - 9); -address constant RAW_FAR_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 10); -address constant SYSTEM_CALL_CALL_ADDRESS = address((1 << 16) - 11); -address constant SYSTEM_CALL_BY_REF_CALL_ADDRESS = address((1 << 16) - 12); -address constant SET_CONTEXT_VALUE_CALL_ADDRESS = address((1 << 16) - 13); -address constant SET_PUBDATA_PRICE_CALL_ADDRESS = address((1 << 16) - 14); -address constant INCREMENT_TX_COUNTER_CALL_ADDRESS = address((1 << 16) - 15); -address constant PTR_CALLDATA_CALL_ADDRESS = address((1 << 16) - 16); -address constant CALLFLAGS_CALL_ADDRESS = address((1 << 16) - 17); -address constant PTR_RETURNDATA_CALL_ADDRESS = address((1 << 16) - 18); -address constant EVENT_INITIALIZE_ADDRESS = address((1 << 16) - 19); -address constant EVENT_WRITE_ADDRESS = address((1 << 16) - 20); -address constant LOAD_CALLDATA_INTO_ACTIVE_PTR_CALL_ADDRESS = address((1 << 16) - 21); -address constant LOAD_LATEST_RETURNDATA_INTO_ACTIVE_PTR_CALL_ADDRESS = address((1 << 16) - 22); -address constant PTR_ADD_INTO_ACTIVE_CALL_ADDRESS = address((1 << 16) - 23); -address constant PTR_SHRINK_INTO_ACTIVE_CALL_ADDRESS = address((1 << 16) - 24); -address constant PTR_PACK_INTO_ACTIVE_CALL_ADDRESS = address((1 << 16) - 25); -address constant MULTIPLICATION_HIGH_ADDRESS = address((1 << 16) - 26); -address constant GET_EXTRA_ABI_DATA_ADDRESS = address((1 << 16) - 27); - -// All the offsets are in bits -uint256 constant META_GAS_PER_PUBDATA_BYTE_OFFSET = 0 * 8; -uint256 constant META_HEAP_SIZE_OFFSET = 8 * 8; -uint256 constant META_AUX_HEAP_SIZE_OFFSET = 12 * 8; -uint256 constant META_SHARD_ID_OFFSET = 28 * 8; -uint256 constant META_CALLER_SHARD_ID_OFFSET = 29 * 8; -uint256 constant META_CODE_SHARD_ID_OFFSET = 30 * 8; - -/// @notice The way to forward the calldata: -/// - Use the current heap (i.e. the same as on EVM). -/// - Use the auxiliary heap. -/// - Forward via a pointer -/// @dev Note, that currently, users do not have access to the auxiliary -/// heap and so the only type of forwarding that will be used by the users -/// are UseHeap and ForwardFatPointer for forwarding a slice of the current calldata -/// to the next call. -enum CalldataForwardingMode { - UseHeap, - ForwardFatPointer, - UseAuxHeap -} - -/** - * @author Matter Labs - * @notice A library that allows calling contracts with the `isSystem` flag. - * @dev It is needed to call ContractDeployer and NonceHolder. - */ -library SystemContractsCaller { - /// @notice Makes a call with the `isSystem` flag. - /// @param gasLimit The gas limit for the call. - /// @param to The address to call. - /// @param value The value to pass with the transaction. - /// @param data The calldata. - /// @return success Whether the transaction has been successful. - /// @dev Note, that the `isSystem` flag can only be set when calling system contracts. - function systemCall(uint32 gasLimit, address to, uint256 value, bytes memory data) internal returns (bool success) { - address callAddr = SYSTEM_CALL_CALL_ADDRESS; - - uint32 dataStart; - assembly { - dataStart := add(data, 0x20) - } - uint32 dataLength = uint32(Utils.safeCastToU32(data.length)); - - uint256 farCallAbi = SystemContractsCaller.getFarCallABI( - 0, - 0, - dataStart, - dataLength, - gasLimit, - // Only rollup is supported for now - 0, - CalldataForwardingMode.UseHeap, - false, - true - ); - - if (value == 0) { - // Doing the system call directly - assembly { - success := call(to, callAddr, 0, 0, farCallAbi, 0, 0) - } - } else { - address msgValueSimulator = MSG_VALUE_SYSTEM_CONTRACT; - // We need to supply the mask to the MsgValueSimulator to denote - // that the call should be a system one. - uint256 forwardMask = MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT; - - assembly { - success := call(msgValueSimulator, callAddr, value, to, farCallAbi, forwardMask, 0) - } - } - } - - /// @notice Makes a call with the `isSystem` flag. - /// @param gasLimit The gas limit for the call. - /// @param to The address to call. - /// @param value The value to pass with the transaction. - /// @param data The calldata. - /// @return success Whether the transaction has been successful. - /// @return returnData The returndata of the transaction (revert reason in case the transaction has failed). - /// @dev Note, that the `isSystem` flag can only be set when calling system contracts. - function systemCallWithReturndata( - uint32 gasLimit, - address to, - uint128 value, - bytes memory data - ) internal returns (bool success, bytes memory returnData) { - success = systemCall(gasLimit, to, value, data); - - uint256 size; - assembly { - size := returndatasize() - } - - returnData = new bytes(size); - assembly { - returndatacopy(add(returnData, 0x20), 0, size) - } - } - - /// @notice Makes a call with the `isSystem` flag. - /// @param gasLimit The gas limit for the call. - /// @param to The address to call. - /// @param value The value to pass with the transaction. - /// @param data The calldata. - /// @return returnData The returndata of the transaction. In case the transaction reverts, the error - /// bubbles up to the parent frame. - /// @dev Note, that the `isSystem` flag can only be set when calling system contracts. - function systemCallWithPropagatedRevert( - uint32 gasLimit, - address to, - uint128 value, - bytes memory data - ) internal returns (bytes memory returnData) { - bool success; - (success, returnData) = systemCallWithReturndata(gasLimit, to, value, data); - - if (!success) { - assembly { - let size := mload(returnData) - revert(add(returnData, 0x20), size) - } - } - } - - /// @notice Calculates the packed representation of the FarCallABI. - /// @param dataOffset Calldata offset in memory. Provide 0 unless using custom pointer. - /// @param memoryPage Memory page to use. Provide 0 unless using custom pointer. - /// @param dataStart The start of the calldata slice. Provide the offset in memory - /// if not using custom pointer. - /// @param dataLength The calldata length. Provide the length of the calldata in bytes - /// unless using custom pointer. - /// @param gasPassed The gas to pass with the call. - /// @param shardId Of the account to call. Currently only 0 is supported. - /// @param forwardingMode The forwarding mode to use: - /// - provide CalldataForwardingMode.UseHeap when using your current memory - /// - provide CalldataForwardingMode.ForwardFatPointer when using custom pointer. - /// @param isConstructorCall Whether the call will be a call to the constructor - /// (ignored when the caller is not a system contract). - /// @param isSystemCall Whether the call will have the `isSystem` flag. - /// @return farCallAbi The far call ABI. - /// @dev The `FarCallABI` has the following structure: - /// pub struct FarCallABI { - /// pub memory_quasi_fat_pointer: FatPointer, - /// pub gas_passed: u32, - /// pub shard_id: u8, - /// pub forwarding_mode: FarCallForwardPageType, - /// pub constructor_call: bool, - /// pub to_system: bool, - /// } - /// - /// The FatPointer struct: - /// - /// pub struct FatPointer { - /// pub offset: u32, // offset relative to `start` - /// pub memory_page: u32, // memory page where slice is located - /// pub start: u32, // absolute start of the slice - /// pub length: u32, // length of the slice - /// } - /// - /// @dev Note, that the actual layout is the following: - /// - /// [0..32) bits -- the calldata offset - /// [32..64) bits -- the memory page to use. Can be left blank in most of the cases. - /// [64..96) bits -- the absolute start of the slice - /// [96..128) bits -- the length of the slice. - /// [128..192) bits -- empty bits. - /// [192..224) bits -- gasPassed. - /// [224..232) bits -- forwarding_mode - /// [232..240) bits -- shard id. - /// [240..248) bits -- constructor call flag - /// [248..256] bits -- system call flag - function getFarCallABI( - uint32 dataOffset, - uint32 memoryPage, - uint32 dataStart, - uint32 dataLength, - uint32 gasPassed, - uint8 shardId, - CalldataForwardingMode forwardingMode, - bool isConstructorCall, - bool isSystemCall - ) internal pure returns (uint256 farCallAbi) { - // Fill in the call parameter fields - farCallAbi = getFarCallABIWithEmptyFatPointer( - gasPassed, - shardId, - forwardingMode, - isConstructorCall, - isSystemCall - ); - // Fill in the fat pointer fields - farCallAbi |= dataOffset; - farCallAbi |= (uint256(memoryPage) << 32); - farCallAbi |= (uint256(dataStart) << 64); - farCallAbi |= (uint256(dataLength) << 96); - } - - /// @notice Calculates the packed representation of the FarCallABI with zero fat pointer fields. - /// @param gasPassed The gas to pass with the call. - /// @param shardId Of the account to call. Currently only 0 is supported. - /// @param forwardingMode The forwarding mode to use: - /// - provide CalldataForwardingMode.UseHeap when using your current memory - /// - provide CalldataForwardingMode.ForwardFatPointer when using custom pointer. - /// @param isConstructorCall Whether the call will be a call to the constructor - /// (ignored when the caller is not a system contract). - /// @param isSystemCall Whether the call will have the `isSystem` flag. - /// @return farCallAbiWithEmptyFatPtr The far call ABI with zero fat pointer fields. - function getFarCallABIWithEmptyFatPointer( - uint32 gasPassed, - uint8 shardId, - CalldataForwardingMode forwardingMode, - bool isConstructorCall, - bool isSystemCall - ) internal pure returns (uint256 farCallAbiWithEmptyFatPtr) { - farCallAbiWithEmptyFatPtr |= (uint256(gasPassed) << 192); - farCallAbiWithEmptyFatPtr |= (uint256(forwardingMode) << 224); - farCallAbiWithEmptyFatPtr |= (uint256(shardId) << 232); - if (isConstructorCall) { - farCallAbiWithEmptyFatPtr |= (1 << 240); - } - if (isSystemCall) { - farCallAbiWithEmptyFatPtr |= (1 << 248); - } - } -} diff --git a/etc/contracts-test-data/contracts/custom-account/TransactionHelper.sol b/etc/contracts-test-data/contracts/custom-account/TransactionHelper.sol deleted file mode 100644 index 82747b88d35..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/TransactionHelper.sol +++ /dev/null @@ -1,467 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; - -import "./interfaces/IPaymasterFlow.sol"; -import "./interfaces/IContractDeployer.sol"; -import {BASE_TOKEN_SYSTEM_CONTRACT, BOOTLOADER_FORMAL_ADDRESS} from "./Constants.sol"; -import "./RLPEncoder.sol"; - -/// @dev The type id of ZKsync's EIP-712-signed transaction. -uint8 constant EIP_712_TX_TYPE = 0x71; - -/// @dev The type id of legacy transactions. -uint8 constant LEGACY_TX_TYPE = 0x0; -/// @dev The type id of legacy transactions. -uint8 constant EIP_2930_TX_TYPE = 0x01; -/// @dev The type id of EIP1559 transactions. -uint8 constant EIP_1559_TX_TYPE = 0x02; - -/// @notice Structure used to represent ZKsync transaction. -struct Transaction { - // The type of the transaction. - uint256 txType; - // The caller. - uint256 from; - // The callee. - uint256 to; - // The gasLimit to pass with the transaction. - // It has the same meaning as Ethereum's gasLimit. - uint256 gasLimit; - // The maximum amount of gas the user is willing to pay for a byte of pubdata. - uint256 gasPerPubdataByteLimit; - // The maximum fee per gas that the user is willing to pay. - // It is akin to EIP1559's maxFeePerGas. - uint256 maxFeePerGas; - // The maximum priority fee per gas that the user is willing to pay. - // It is akin to EIP1559's maxPriorityFeePerGas. - uint256 maxPriorityFeePerGas; - // The transaction's paymaster. If there is no paymaster, it is equal to 0. - uint256 paymaster; - // The nonce of the transaction. - uint256 nonce; - // The value to pass with the transaction. - uint256 value; - // In the future, we might want to add some - // new fields to the struct. The `txData` struct - // is to be passed to account and any changes to its structure - // would mean a breaking change to these accounts. In order to prevent this, - // we should keep some fields as "reserved". - // It is also recommended that their length is fixed, since - // it would allow easier proof integration (in case we will need - // some special circuit for preprocessing transactions). - uint256[4] reserved; - // The transaction's calldata. - bytes data; - // The signature of the transaction. - bytes signature; - // The properly formatted hashes of bytecodes that must be published on L1 - // with the inclusion of this transaction. Note, that a bytecode has been published - // before, the user won't pay fees for its republishing. - bytes32[] factoryDeps; - // The input to the paymaster. - bytes paymasterInput; - // Reserved dynamic type for the future use-case. Using it should be avoided, - // But it is still here, just in case we want to enable some additional functionality. - bytes reservedDynamic; -} - -/** - * @author Matter Labs - * @notice Library is used to help custom accounts to work with common methods for the Transaction type. - */ -library TransactionHelper { - using SafeERC20 for IERC20; - - /// @notice The EIP-712 typehash for the contract's domain - bytes32 constant EIP712_DOMAIN_TYPEHASH = - keccak256("EIP712Domain(string name,string version,uint256 chainId)"); - - bytes32 constant EIP712_TRANSACTION_TYPE_HASH = - keccak256( - "Transaction(uint256 txType,uint256 from,uint256 to,uint256 gasLimit,uint256 gasPerPubdataByteLimit,uint256 maxFeePerGas,uint256 maxPriorityFeePerGas,uint256 paymaster,uint256 nonce,uint256 value,bytes data,bytes32[] factoryDeps,bytes paymasterInput)" - ); - - /// @notice Whether the token is Ethereum. - /// @param _addr The address of the token - /// @return `true` or `false` based on whether the token is Ether. - /// @dev This method assumes that address is Ether either if the address is 0 (for convenience) - /// or if the address is the address of the L2BaseToken system contract. - function isEthToken(uint256 _addr) internal pure returns (bool) { - return - _addr == uint256(uint160(address(BASE_TOKEN_SYSTEM_CONTRACT))) || - _addr == 0; - } - - /// @notice Calculate the suggested signed hash of the transaction, - /// i.e. the hash that is signed by EOAs and is recommended to be signed by other accounts. - function encodeHash(Transaction calldata _transaction) - internal - view - returns (bytes32 resultHash) - { - if (_transaction.txType == LEGACY_TX_TYPE) { - resultHash = _encodeHashLegacyTransaction(_transaction); - } else if (_transaction.txType == EIP_712_TX_TYPE) { - resultHash = _encodeHashEIP712Transaction(_transaction); - } else if (_transaction.txType == EIP_1559_TX_TYPE) { - resultHash = _encodeHashEIP1559Transaction(_transaction); - } else if (_transaction.txType == EIP_2930_TX_TYPE) { - resultHash = _encodeHashEIP2930Transaction(_transaction); - } else { - // Currently no other transaction types are supported. - // Any new transaction types will be processed in a similar manner. - revert("Encoding unsupported tx"); - } - } - - /// @notice Encode hash of the ZKsync native transaction type. - /// @return keccak256 hash of the EIP-712 encoded representation of transaction - function _encodeHashEIP712Transaction(Transaction calldata _transaction) - private - view - returns (bytes32) - { - bytes32 structHash = keccak256( - abi.encode( - EIP712_TRANSACTION_TYPE_HASH, - _transaction.txType, - _transaction.from, - _transaction.to, - _transaction.gasLimit, - _transaction.gasPerPubdataByteLimit, - _transaction.maxFeePerGas, - _transaction.maxPriorityFeePerGas, - _transaction.paymaster, - _transaction.nonce, - _transaction.value, - keccak256(_transaction.data), - keccak256(abi.encodePacked(_transaction.factoryDeps)), - keccak256(_transaction.paymasterInput) - ) - ); - - bytes32 domainSeparator = keccak256( - abi.encode( - EIP712_DOMAIN_TYPEHASH, - keccak256("zkSync"), - keccak256("2"), - block.chainid - ) - ); - - return - keccak256( - abi.encodePacked("\x19\x01", domainSeparator, structHash) - ); - } - - /// @notice Encode hash of the legacy transaction type. - /// @return keccak256 of the serialized RLP encoded representation of transaction - function _encodeHashLegacyTransaction(Transaction calldata _transaction) - private - view - returns (bytes32) - { - // Hash of legacy transactions are encoded as one of the: - // - RLP(nonce, gasPrice, gasLimit, to, value, data, chainId, 0, 0) - // - RLP(nonce, gasPrice, gasLimit, to, value, data) - // - // In this RLP encoding, only the first one above list appears, so we encode each element - // inside list and then concatenate the length of all elements with them. - - bytes memory encodedNonce = RLPEncoder.encodeUint256(_transaction.nonce); - // Encode `gasPrice` and `gasLimit` together to prevent "stack too deep error". - bytes memory encodedGasParam; - { - bytes memory encodedGasPrice = RLPEncoder.encodeUint256( - _transaction.maxFeePerGas - ); - bytes memory encodedGasLimit = RLPEncoder.encodeUint256( - _transaction.gasLimit - ); - encodedGasParam = bytes.concat(encodedGasPrice, encodedGasLimit); - } - - bytes memory encodedTo = RLPEncoder.encodeAddress(address(uint160(_transaction.to))); - bytes memory encodedValue = RLPEncoder.encodeUint256(_transaction.value); - // Encode only the length of the transaction data, and not the data itself, - // so as not to copy to memory a potentially huge transaction data twice. - bytes memory encodedDataLength; - { - // Safe cast, because the length of the transaction data can't be so large. - uint64 txDataLen = uint64(_transaction.data.length); - if (txDataLen != 1) { - // If the length is not equal to one, then only using the length can it be encoded definitely. - encodedDataLength = RLPEncoder.encodeNonSingleBytesLen( - txDataLen - ); - } else if (_transaction.data[0] >= 0x80) { - // If input is a byte in [0x80, 0xff] range, RLP encoding will concatenates 0x81 with the byte. - encodedDataLength = hex"81"; - } - // Otherwise the length is not encoded at all. - } - - // Encode `chainId` according to EIP-155, but only if the `chainId` is specified in the transaction. - bytes memory encodedChainId; - if (_transaction.reserved[0] != 0) { - encodedChainId = bytes.concat(RLPEncoder.encodeUint256(block.chainid), hex"80_80"); - } - - bytes memory encodedListLength; - unchecked { - uint256 listLength = encodedNonce.length + - encodedGasParam.length + - encodedTo.length + - encodedValue.length + - encodedDataLength.length + - _transaction.data.length + - encodedChainId.length; - - // Safe cast, because the length of the list can't be so large. - encodedListLength = RLPEncoder.encodeListLen(uint64(listLength)); - } - - return - keccak256( - bytes.concat( - encodedListLength, - encodedNonce, - encodedGasParam, - encodedTo, - encodedValue, - encodedDataLength, - _transaction.data, - encodedChainId - ) - ); - } - - /// @notice Encode hash of the EIP2930 transaction type. - /// @return keccak256 of the serialized RLP encoded representation of transaction - function _encodeHashEIP2930Transaction(Transaction calldata _transaction) - private - view - returns (bytes32) - { - // Hash of EIP2930 transactions is encoded the following way: - // H(0x01 || RLP(chain_id, nonce, gas_price, gas_limit, destination, amount, data, access_list)) - // - // Note, that on ZKsync access lists are not supported and should always be empty. - - // Encode all fixed-length params to avoid "stack too deep error" - bytes memory encodedFixedLengthParams; - { - bytes memory encodedChainId = RLPEncoder.encodeUint256(block.chainid); - bytes memory encodedNonce = RLPEncoder.encodeUint256(_transaction.nonce); - bytes memory encodedGasPrice = RLPEncoder.encodeUint256(_transaction.maxFeePerGas); - bytes memory encodedGasLimit = RLPEncoder.encodeUint256(_transaction.gasLimit); - bytes memory encodedTo = RLPEncoder.encodeAddress(address(uint160(_transaction.to))); - bytes memory encodedValue = RLPEncoder.encodeUint256(_transaction.value); - encodedFixedLengthParams = bytes.concat( - encodedChainId, - encodedNonce, - encodedGasPrice, - encodedGasLimit, - encodedTo, - encodedValue - ); - } - - // Encode only the length of the transaction data, and not the data itself, - // so as not to copy to memory a potentially huge transaction data twice. - bytes memory encodedDataLength; - { - // Safe cast, because the length of the transaction data can't be so large. - uint64 txDataLen = uint64(_transaction.data.length); - if (txDataLen != 1) { - // If the length is not equal to one, then only using the length can it be encoded definitely. - encodedDataLength = RLPEncoder.encodeNonSingleBytesLen( - txDataLen - ); - } else if (_transaction.data[0] >= 0x80) { - // If input is a byte in [0x80, 0xff] range, RLP encoding will concatenates 0x81 with the byte. - encodedDataLength = hex"81"; - } - // Otherwise the length is not encoded at all. - } - - // On ZKsync, access lists are always zero length (at least for now). - bytes memory encodedAccessListLength = RLPEncoder.encodeListLen(0); - - bytes memory encodedListLength; - unchecked { - uint256 listLength = encodedFixedLengthParams.length + - encodedDataLength.length + - _transaction.data.length + - encodedAccessListLength.length; - - // Safe cast, because the length of the list can't be so large. - encodedListLength = RLPEncoder.encodeListLen(uint64(listLength)); - } - - return - keccak256( - bytes.concat( - "\x01", - encodedListLength, - encodedFixedLengthParams, - encodedDataLength, - _transaction.data, - encodedAccessListLength - ) - ); - } - - /// @notice Encode hash of the EIP1559 transaction type. - /// @return keccak256 of the serialized RLP encoded representation of transaction - function _encodeHashEIP1559Transaction(Transaction calldata _transaction) - private - view - returns (bytes32) - { - // Hash of EIP1559 transactions is encoded the following way: - // H(0x02 || RLP(chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list)) - // - // Note, that on ZKsync access lists are not supported and should always be empty. - - // Encode all fixed-length params to avoid "stack too deep error" - bytes memory encodedFixedLengthParams; - { - bytes memory encodedChainId = RLPEncoder.encodeUint256(block.chainid); - bytes memory encodedNonce = RLPEncoder.encodeUint256(_transaction.nonce); - bytes memory encodedMaxPriorityFeePerGas = RLPEncoder.encodeUint256(_transaction.maxPriorityFeePerGas); - bytes memory encodedMaxFeePerGas = RLPEncoder.encodeUint256(_transaction.maxFeePerGas); - bytes memory encodedGasLimit = RLPEncoder.encodeUint256(_transaction.gasLimit); - bytes memory encodedTo = RLPEncoder.encodeAddress(address(uint160(_transaction.to))); - bytes memory encodedValue = RLPEncoder.encodeUint256(_transaction.value); - encodedFixedLengthParams = bytes.concat( - encodedChainId, - encodedNonce, - encodedMaxPriorityFeePerGas, - encodedMaxFeePerGas, - encodedGasLimit, - encodedTo, - encodedValue - ); - } - - // Encode only the length of the transaction data, and not the data itself, - // so as not to copy to memory a potentially huge transaction data twice. - bytes memory encodedDataLength; - { - // Safe cast, because the length of the transaction data can't be so large. - uint64 txDataLen = uint64(_transaction.data.length); - if (txDataLen != 1) { - // If the length is not equal to one, then only using the length can it be encoded definitely. - encodedDataLength = RLPEncoder.encodeNonSingleBytesLen( - txDataLen - ); - } else if (_transaction.data[0] >= 0x80) { - // If input is a byte in [0x80, 0xff] range, RLP encoding will concatenates 0x81 with the byte. - encodedDataLength = hex"81"; - } - // Otherwise the length is not encoded at all. - } - - // On ZKsync, access lists are always zero length (at least for now). - bytes memory encodedAccessListLength = RLPEncoder.encodeListLen(0); - - bytes memory encodedListLength; - unchecked { - uint256 listLength = encodedFixedLengthParams.length + - encodedDataLength.length + - _transaction.data.length + - encodedAccessListLength.length; - - // Safe cast, because the length of the list can't be so large. - encodedListLength = RLPEncoder.encodeListLen(uint64(listLength)); - } - - return - keccak256( - bytes.concat( - "\x02", - encodedListLength, - encodedFixedLengthParams, - encodedDataLength, - _transaction.data, - encodedAccessListLength - ) - ); - } - - /// @notice Processes the common paymaster flows, e.g. setting proper allowance - /// for tokens, etc. For more information on the expected behavior, check out - /// the "Paymaster flows" section in the documentation. - function processPaymasterInput(Transaction calldata _transaction) internal { - require( - _transaction.paymasterInput.length >= 4, - "The standard paymaster input must be at least 4 bytes long" - ); - - bytes4 paymasterInputSelector = bytes4( - _transaction.paymasterInput[0:4] - ); - if (paymasterInputSelector == IPaymasterFlow.approvalBased.selector) { - require( - _transaction.paymasterInput.length >= 68, - "The approvalBased paymaster input must be at least 68 bytes long" - ); - - // While the actual data consists of address, uint256 and bytes data, - // the data is needed only for the paymaster, so we ignore it here for the sake of optimization - (address token, uint256 minAllowance) = abi.decode( - _transaction.paymasterInput[4:68], - (address, uint256) - ); - address paymaster = address(uint160(_transaction.paymaster)); - - uint256 currentAllowance = IERC20(token).allowance( - address(this), - paymaster - ); - if (currentAllowance < minAllowance) { - // Some tokens, e.g. USDT require that the allowance is firsty set to zero - // and only then updated to the new value. - - IERC20(token).safeApprove(paymaster, 0); - IERC20(token).safeApprove(paymaster, minAllowance); - } - } else if (paymasterInputSelector == IPaymasterFlow.general.selector) { - // Do nothing. general(bytes) paymaster flow means that the paymaster must interpret these bytes on his own. - } else { - revert("Unsupported paymaster flow"); - } - } - - /// @notice Pays the required fee for the transaction to the bootloader. - /// @dev Currently it pays the maximum amount "_transaction.maxFeePerGas * _transaction.gasLimit", - /// it will change in the future. - function payToTheBootloader(Transaction calldata _transaction) - internal - returns (bool success) - { - address bootloaderAddr = BOOTLOADER_FORMAL_ADDRESS; - uint256 amount = _transaction.maxFeePerGas * _transaction.gasLimit; - - assembly { - success := call(gas(), bootloaderAddr, amount, 0, 0, 0, 0) - } - } - - // Returns the balance required to process the transaction. - function totalRequiredBalance(Transaction calldata _transaction) internal pure returns (uint256 requiredBalance) { - if(address(uint160(_transaction.paymaster)) != address(0)) { - // Paymaster pays for the fee - requiredBalance = _transaction.value; - } else { - // The user should have enough balance for both the fee and the value of the transaction - requiredBalance = _transaction.maxFeePerGas * _transaction.gasLimit + _transaction.value; - } - } -} diff --git a/etc/contracts-test-data/contracts/custom-account/Utils.sol b/etc/contracts-test-data/contracts/custom-account/Utils.sol deleted file mode 100644 index e562948942d..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/Utils.sol +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity >=0.8.0; - -/** - * @author Matter Labs - * @dev Common utilities used in ZKsync system contracts - */ -library Utils { - function safeCastToU128(uint256 _x) internal pure returns (uint128) { - require(_x <= type(uint128).max, "Overflow"); - - return uint128(_x); - } - - function safeCastToU32(uint256 _x) internal pure returns (uint32) { - require(_x <= type(uint32).max, "Overflow"); - - return uint32(_x); - } - - function safeCastToU24(uint256 _x) internal pure returns (uint24) { - require(_x <= type(uint24).max, "Overflow"); - - return uint24(_x); - } - - /// @return codeLength The bytecode length in bytes - function bytecodeLenInBytes(bytes32 _bytecodeHash) internal pure returns (uint256 codeLength) { - codeLength = bytecodeLenInWords(_bytecodeHash) << 5; // _bytecodeHash * 32 - } - - /// @return codeLengthInWords The bytecode length in machine words - function bytecodeLenInWords(bytes32 _bytecodeHash) internal pure returns (uint256 codeLengthInWords) { - unchecked { - codeLengthInWords = uint256(uint8(_bytecodeHash[2])) * 256 + uint256(uint8(_bytecodeHash[3])); - } - } -} diff --git a/etc/contracts-test-data/contracts/custom-account/custom-account.sol b/etc/contracts-test-data/contracts/custom-account/custom-account.sol deleted file mode 100644 index 7601f5cd7b8..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/custom-account.sol +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -import './Constants.sol'; -import './TransactionHelper.sol'; - -import './SystemContractsCaller.sol'; - -import './interfaces/IAccount.sol'; - -contract CustomAccount is IAccount { - using TransactionHelper for Transaction; - - bool public violateValidationRules; - - bytes32 public lastTxHash; - - constructor(bool _violateValidationRules) { - violateValidationRules = _violateValidationRules; - } - - // bytes4(keccak256("isValidSignature(bytes32,bytes)") - bytes4 constant EIP1271_SUCCESS_RETURN_VALUE = 0x1626ba7e; - - function validateTransaction(bytes32 _txHash, bytes32 _suggestedSignedTxHash, Transaction calldata _transaction) external payable override returns (bytes4 magic) { - // By default we consider the transaction as successful - magic = VALIDATION_SUCCESS_MAGIC; - - _validateTransaction(_suggestedSignedTxHash, _transaction); - lastTxHash = _txHash; - - if (violateValidationRules) { - // Such a tx should not pass the validation step, because it depends on the balance of another account - require(BOOTLOADER_FORMAL_ADDRESS.balance == 0, "Bootloader balance must be zero"); - } - } - - function _validateTransaction(bytes32 _suggestedSignedTxHash, Transaction calldata _transaction) internal { - if (_suggestedSignedTxHash == bytes32(0)) { - _suggestedSignedTxHash = _transaction.encodeHash(); - } - - SystemContractsCaller.systemCallWithPropagatedRevert( - uint32(gasleft()), - address(NONCE_HOLDER_SYSTEM_CONTRACT), - 0, - abi.encodeCall(INonceHolder.incrementMinNonceIfEquals, (_transaction.nonce)) - ); - - bytes memory correctSignature = abi.encodePacked(_suggestedSignedTxHash, address(this)); - require(keccak256(_transaction.signature) == keccak256(correctSignature), "Incorrect signature"); - } - - function executeTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable override { - _execute(_transaction); - } - - function executeTransactionFromOutside(Transaction calldata _transaction) external payable override { - _validateTransaction(bytes32(0), _transaction); - _execute(_transaction); - } - - function _execute(Transaction calldata _transaction) internal { - address to = address(uint160(_transaction.to)); - uint256 value = _transaction.reserved[1]; - bytes memory data = _transaction.data; - - if(to == address(DEPLOYER_SYSTEM_CONTRACT)) { - // We allow calling ContractDeployer with any calldata - SystemContractsCaller.systemCallWithPropagatedRevert( - uint32(gasleft()), - to, - uint128(_transaction.reserved[1]), // By convention, reserved[1] is `value` - _transaction.data - ); - } else { - bool success; - assembly { - success := call(gas(), to, value, add(data, 0x20), mload(data), 0, 0) - } - require(success); - } - } - - // Here, the user pays the bootloader for the transaction - function payForTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable { - bool success = _transaction.payToTheBootloader(); - require(success, "Failed to pay the fee to the operator"); - } - - // Here, the user should prepare for the transaction to be paid for by a paymaster - // Here, the account should set the allowance for the smart contracts - function prepareForPaymaster(bytes32, bytes32, Transaction calldata _transaction) external payable { - _transaction.processPaymasterInput(); - } - - fallback() external payable { - // fallback of default AA shouldn't be called by bootloader under no circumstances - assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS); - - // If the contract is called directly, behave like an EOA - } - - receive() external payable {} -} diff --git a/etc/contracts-test-data/contracts/custom-account/custom-paymaster.sol b/etc/contracts-test-data/contracts/custom-account/custom-paymaster.sol deleted file mode 100644 index af9fec30f7d..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/custom-paymaster.sol +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import "./interfaces/IPaymaster.sol"; -import "./interfaces/IPaymasterFlow.sol"; -import "./TransactionHelper.sol"; -import "./Constants.sol"; - -// This is a dummy paymaster. It expects the paymasterInput to contain its "signature" as well as the needed exchange rate. -// It supports only approval-based paymaster flow. -contract CustomPaymaster is IPaymaster { - using TransactionHelper for Transaction; - - uint256 public txCounter = 0; - mapping(uint256 => bool) public calledContext; - uint256 public wasAnytime = 0; - - bytes32 lastTxHash = 0; - - function validateSignature(bytes memory _signature) internal pure { - // For the purpose of this test, any signature of length 46 is fine. - require(_signature.length == 46); - } - - function validateAndPayForPaymasterTransaction(bytes32 _txHash, bytes32, Transaction calldata _transaction) override external payable returns (bytes4 magic, bytes memory context) { - // By default we consider the transaction as passed - magic = PAYMASTER_VALIDATION_SUCCESS_MAGIC; - - lastTxHash = _txHash; - require(_transaction.paymasterInput.length >= 4, "The standard paymaster input must be at least 4 bytes long"); - - bytes4 paymasterInputSelector = bytes4(_transaction.paymasterInput[0:4]); - if (paymasterInputSelector == IPaymasterFlow.approvalBased.selector) { - // While the actual data consists of address, uint256 and bytes data, - // the data is needed only for the paymaster, so we ignore it here for the sake of optimization - (address token,, bytes memory input) = abi.decode(_transaction.paymasterInput[4:], (address, uint256, bytes)); - - (bytes memory pseudoSignature, uint256 rateNumerator, uint256 rateDenominator, uint256 amount) = abi.decode(input, (bytes, uint256, uint256, uint256)); - validateSignature(pseudoSignature); - - // Firstly, we verify that the user has provided enough allowance - address userAddress = address(uint160(_transaction.from)); - address thisAddress = address(this); - - uint256 providedAllowance = IERC20(token).allowance(userAddress, thisAddress); - require(providedAllowance >= amount, "The user did not provide enough allowance"); - - uint256 requiredETH = _transaction.gasLimit * _transaction.maxFeePerGas; - uint256 ethExchnaged = amount * rateNumerator / rateDenominator; - - require(ethExchnaged >= requiredETH, "User does not provide enough tokens to exchange"); - - // Pulling all the tokens from the user - IERC20(token).transferFrom(userAddress, thisAddress, amount); - bool success = _transaction.payToTheBootloader(); - require(success, "Failed to transfer funds to the bootloader"); - - // For now, refunds are not supported, so we just test the fact that the transferred context is correct - txCounter += 1; - context = abi.encode(txCounter); - } else { - revert("Unsupported paymaster flow"); - } - } - - function postTransaction( - bytes calldata _context, - Transaction calldata, - bytes32 _txHash, - bytes32, - ExecutionResult, - uint256 - ) override external payable { - require(_txHash == lastTxHash, "Incorrect last tx hash"); - uint256 contextCounter = abi.decode(_context, (uint256)); - calledContext[contextCounter] = true; - } - - receive() external payable {} -} diff --git a/etc/contracts-test-data/contracts/custom-account/interfaces/IAccount.sol b/etc/contracts-test-data/contracts/custom-account/interfaces/IAccount.sol deleted file mode 100644 index 521ae96d413..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/interfaces/IAccount.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -import "../TransactionHelper.sol"; - -bytes4 constant VALIDATION_SUCCESS_MAGIC = IAccount.validateTransaction.selector; - -interface IAccount { - /// @notice Called by the bootloader to validate that an account agrees to process the transaction - /// (and potentially pay for it). - /// @param _txHash The hash of the transaction to be used in the explorer - /// @param _suggestedSignedHash The hash of the transaction is signed by EOAs - /// @param _transaction The transaction itself - /// @return magic The magic value that should be equal to the signature of this function - /// if the user agrees to proceed with the transaction. - /// @dev The developer should strive to preserve as many steps as possible both for valid - /// and invalid transactions as this very method is also used during the gas fee estimation - /// (without some of the necessary data, e.g. signature). - function validateTransaction( - bytes32 _txHash, - bytes32 _suggestedSignedHash, - Transaction calldata _transaction - ) external payable returns (bytes4 magic); - - function executeTransaction( - bytes32 _txHash, - bytes32 _suggestedSignedHash, - Transaction calldata _transaction - ) external payable; - - // There is no point in providing possible signed hash in the `executeTransactionFromOutside` method, - // since it typically should not be trusted. - function executeTransactionFromOutside(Transaction calldata _transaction) external payable; - - function payForTransaction( - bytes32 _txHash, - bytes32 _suggestedSignedHash, - Transaction calldata _transaction - ) external payable; - - function prepareForPaymaster( - bytes32 _txHash, - bytes32 _possibleSignedHash, - Transaction calldata _transaction - ) external payable; -} diff --git a/etc/contracts-test-data/contracts/custom-account/interfaces/IContractDeployer.sol b/etc/contracts-test-data/contracts/custom-account/interfaces/IContractDeployer.sol deleted file mode 100644 index f9a6db8c467..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/interfaces/IContractDeployer.sol +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -interface IContractDeployer { - /// @notice Defines the version of the account abstraction protocol - /// that a contract claims to follow. - /// - `None` means that the account is just a contract and it should never be interacted - /// with as a custom account - /// - `Version1` means that the account follows the first version of the account abstraction protocol - enum AccountAbstractionVersion { - None, - Version1 - } - - /// @notice Defines the nonce ordering used by the account - /// - `Sequential` means that it is expected that the nonces are monotonic and increment by 1 - /// at a time (the same as EOAs). - /// - `Arbitrary` means that the nonces for the accounts can be arbitrary. The operator - /// should serve the transactions from such an account on a first-come-first-serve basis. - /// @dev This ordering is more of a suggestion to the operator on how the AA expects its transactions - /// to be processed and is not considered as a system invariant. - enum AccountNonceOrdering { - Sequential, - Arbitrary - } - - struct AccountInfo { - AccountAbstractionVersion supportedAAVersion; - AccountNonceOrdering nonceOrdering; - } - - event ContractDeployed( - address indexed deployerAddress, - bytes32 indexed bytecodeHash, - address indexed contractAddress - ); - - function getNewAddressCreate2( - address _sender, - bytes32 _bytecodeHash, - bytes32 _salt, - bytes calldata _input - ) external pure returns (address newAddress); - - function getNewAddressCreate(address _sender, uint256 _senderNonce) external pure returns (address newAddress); - - function create2( - bytes32 _salt, - bytes32 _bytecodeHash, - bytes calldata _input - ) external payable returns (address newAddress); - - function create2Account( - bytes32 _salt, - bytes32 _bytecodeHash, - bytes calldata _input, - AccountAbstractionVersion _aaVersion - ) external payable returns (address newAddress); - - /// @dev While the `_salt` parameter is not used anywhere here, - /// it is still needed for consistency between `create` and - /// `create2` functions (required by the compiler). - function create( - bytes32 _salt, - bytes32 _bytecodeHash, - bytes calldata _input - ) external payable returns (address newAddress); - - /// @dev While `_salt` is never used here, we leave it here as a parameter - /// for the consistency with the `create` function. - function createAccount( - bytes32 _salt, - bytes32 _bytecodeHash, - bytes calldata _input, - AccountAbstractionVersion _aaVersion - ) external payable returns (address newAddress); - - /// @notice Returns the information about a certain AA. - function getAccountInfo( - address _address - ) external view returns (AccountInfo memory info); - - /// @notice Can be called by an account to update its account version - function updateAccountVersion(AccountAbstractionVersion _version) external; - - /// @notice Can be called by an account to update its nonce ordering - function updateNonceOrdering(AccountNonceOrdering _nonceOrdering) external; - - /// @notice A struct that describes a forced deployment on an address - struct ForceDeployment { - // The bytecode hash to put on an address - bytes32 bytecodeHash; - // The address on which to deploy the bytecodehash to - address newAddress; - // Whether to call the constructor or not - bool callConstructor; - // The value with which to initialize a contract - uint256 value; - // The constructor calldata - bytes input; - } - - /// @notice This method is to be used only during an upgrade to set a bytecode on any address. - /// @dev We do not require `onlySystemCall` here, since the method is accessible only - /// by `FORCE_DEPLOYER`. - function forceDeployOnAddresses( - ForceDeployment[] calldata _deployments - ) external payable; -} diff --git a/etc/contracts-test-data/contracts/custom-account/interfaces/IERC20.sol b/etc/contracts-test-data/contracts/custom-account/interfaces/IERC20.sol deleted file mode 100644 index b816bfed086..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/interfaces/IERC20.sol +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) - -pragma solidity ^0.8.0; - -/** - * @dev Interface of the ERC20 standard as defined in the EIP. - */ -interface IERC20 { - /** - * @dev Emitted when `value` tokens are moved from one account (`from`) to - * another (`to`). - * - * Note that `value` may be zero. - */ - event Transfer(address indexed from, address indexed to, uint256 value); - - /** - * @dev Emitted when the allowance of a `spender` for an `owner` is set by - * a call to {approve}. `value` is the new allowance. - */ - event Approval(address indexed owner, address indexed spender, uint256 value); - - /** - * @dev Returns the amount of tokens in existence. - */ - function totalSupply() external view returns (uint256); - - /** - * @dev Returns the amount of tokens owned by `account`. - */ - function balanceOf(address account) external view returns (uint256); - - /** - * @dev Moves `amount` tokens from the caller's account to `to`. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transfer(address to, uint256 amount) external returns (bool); - - /** - * @dev Returns the remaining number of tokens that `spender` will be - * allowed to spend on behalf of `owner` through {transferFrom}. This is - * zero by default. - * - * This value changes when {approve} or {transferFrom} are called. - */ - function allowance(address owner, address spender) external view returns (uint256); - - /** - * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * IMPORTANT: Beware that changing an allowance with this method brings the risk - * that someone may use both the old and the new allowance by unfortunate - * transaction ordering. One possible solution to mitigate this race - * condition is to first reduce the spender's allowance to 0 and set the - * desired value afterwards: - * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - * - * Emits an {Approval} event. - */ - function approve(address spender, uint256 amount) external returns (bool); - - /** - * @dev Moves `amount` tokens from `from` to `to` using the - * allowance mechanism. `amount` is then deducted from the caller's - * allowance. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transferFrom( - address from, - address to, - uint256 amount - ) external returns (bool); -} diff --git a/etc/contracts-test-data/contracts/custom-account/interfaces/INonceHolder.sol b/etc/contracts-test-data/contracts/custom-account/interfaces/INonceHolder.sol deleted file mode 100644 index 18ac4702326..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/interfaces/INonceHolder.sol +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -/** - * @author Matter Labs - * @dev Interface of the nonce holder contract -- a contract used by the system to ensure - * that there is always a unique identifier for a transaction with a particular account (we call it nonce). - * In other words, the pair of (address, nonce) should always be unique. - * @dev Custom accounts should use methods of this contract to store nonces or other possible unique identifiers - * for the transaction. - */ -interface INonceHolder { - /// @dev Returns the current minimal nonce for account. - function getMinNonce(address _address) external view returns (uint256); - - /// @dev Returns the raw version of the current minimal nonce - /// (equal to minNonce + 2^128 * deployment nonce). - function getRawNonce(address _address) external view returns (uint256); - - /// @dev Increases the minimal nonce for the msg.sender. - function increaseMinNonce(uint256 _value) external returns (uint256); - - /// @dev Sets the nonce value `key` as used. - function setValueUnderNonce(uint256 _key, uint256 _value) external; - - /// @dev Gets the value stored inside a custom nonce. - function getValueUnderNonce(uint256 _key) external view returns (uint256); - - /// @dev A convenience method to increment the minimal nonce if it is equal - /// to the `_expectedNonce`. - function incrementMinNonceIfEquals(uint256 _expectedNonce) external; - - /// @dev Returns the deployment nonce for the accounts used for CREATE opcode. - function getDeploymentNonce(address _address) external view returns (uint256); - - /// @dev Increments the deployment nonce for the account and returns the previous one. - function incrementDeploymentNonce(address _address) external returns (uint256); - - /// @dev Determines whether a certain nonce has been already used for an account. - function validateNonceUsage(address _address, uint256 _key, bool _shouldBeUsed) external view; -} diff --git a/etc/contracts-test-data/contracts/custom-account/interfaces/IPaymaster.sol b/etc/contracts-test-data/contracts/custom-account/interfaces/IPaymaster.sol deleted file mode 100644 index 1bd5b81f32b..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/interfaces/IPaymaster.sol +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -import "../TransactionHelper.sol"; - -enum ExecutionResult { - Revert, - Success -} - -bytes4 constant PAYMASTER_VALIDATION_SUCCESS_MAGIC = IPaymaster.validateAndPayForPaymasterTransaction.selector; - -interface IPaymaster { - /// @dev Called by the bootloader to verify that the paymaster agrees to pay for the - /// fee for the transaction. This transaction should also send the necessary amount of funds onto the bootloader - /// address. - /// @param _txHash The hash of the transaction - /// @param _suggestedSignedHash The hash of the transaction that is signed by an EOA - /// @param _transaction The transaction itself. - /// @return magic The value that should be equal to the signature of the validateAndPayForPaymasterTransaction - /// if the paymaster agrees to pay for the transaction. - /// @return context The "context" of the transaction: an array of bytes of length at most 1024 bytes, which will be - /// passed to the `postTransaction` method of the account. - /// @dev The developer should strive to preserve as many steps as possible both for valid - /// and invalid transactions as this very method is also used during the gas fee estimation - /// (without some of the necessary data, e.g. signature). - function validateAndPayForPaymasterTransaction( - bytes32 _txHash, - bytes32 _suggestedSignedHash, - Transaction calldata _transaction - ) external payable returns (bytes4 magic, bytes memory context); - - /// @dev Called by the bootloader after the execution of the transaction. Please note that - /// there is no guarantee that this method will be called at all. Unlike the original EIP4337, - /// this method won't be called if the transaction execution results in out-of-gas. - /// @param _context, the context of the execution, returned by the "validateAndPayForPaymasterTransaction" method. - /// @param _transaction, the users' transaction. - /// @param _txResult, the result of the transaction execution (success or failure). - /// @param _maxRefundedGas, the upper bound on the amount of gas that could be refunded to the paymaster. - /// @dev The exact amount refunded depends on the gas spent by the "postOp" itself and so the developers should - /// take that into account. - function postTransaction( - bytes calldata _context, - Transaction calldata _transaction, - bytes32 _txHash, - bytes32 _suggestedSignedHash, - ExecutionResult _txResult, - uint256 _maxRefundedGas - ) external payable; -} diff --git a/etc/contracts-test-data/contracts/custom-account/interfaces/IPaymasterFlow.sol b/etc/contracts-test-data/contracts/custom-account/interfaces/IPaymasterFlow.sol deleted file mode 100644 index 97bd9507929..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/interfaces/IPaymasterFlow.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -/** - * @author Matter Labs - * @dev The interface that is used for encoding/decoding of - * different types of paymaster flows. - * @notice This is NOT an interface to be implementated - * by contracts. It is just used for encoding. - */ -interface IPaymasterFlow { - function general(bytes calldata input) external; - - function approvalBased(address _token, uint256 _minAllowance, bytes calldata _innerInput) external; -} diff --git a/etc/contracts-test-data/contracts/custom-account/many-owners-custom-account.sol b/etc/contracts-test-data/contracts/custom-account/many-owners-custom-account.sol deleted file mode 100644 index e4d01207235..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/many-owners-custom-account.sol +++ /dev/null @@ -1,151 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -// Example custom account contract, that allows any of the selected owners to act on its behalf. -// This contract is for UNITTESTS ONLY. Do NOT use in production. -pragma solidity ^0.8.0; - -import "./Constants.sol"; -import "./TransactionHelper.sol"; - -import "./SystemContractsCaller.sol"; - -import "./interfaces/IAccount.sol"; - -contract ManyOwnersCustomAccount is IAccount { - using TransactionHelper for Transaction; - - address[] public owners; - - // Sets the current owners. - // This is NOT safe, this contract is for unittests ONLY. - function setOwners(address[] memory _owners) external { - owners = _owners; - } - - // bytes4(keccak256("isValidSignature(bytes32,bytes)") - bytes4 constant EIP1271_SUCCESS_RETURN_VALUE = 0x1626ba7e; - - function validateTransaction( - bytes32, - bytes32 _suggestedSignedTxHash, - Transaction calldata _transaction - ) external payable override returns (bytes4 magic) { - // By default we consider the transaction as successful - magic = VALIDATION_SUCCESS_MAGIC; - - _validateTransaction(_suggestedSignedTxHash, _transaction); - } - - function _validateTransaction( - bytes32 _suggestedSignedTxHash, - Transaction calldata _transaction - ) internal { - if (_suggestedSignedTxHash == bytes32(0)) { - _suggestedSignedTxHash = _transaction.encodeHash(); - } - - SystemContractsCaller.systemCallWithPropagatedRevert( - uint32(gasleft()), - address(NONCE_HOLDER_SYSTEM_CONTRACT), - 0, - abi.encodeCall( - INonceHolder.incrementMinNonceIfEquals, - (_transaction.nonce) - ) - ); - - bytes memory _signature = _transaction.signature; - - uint8 v; - bytes32 r; - bytes32 s; - // Signature loading code - // we jump 32 (0x20) as the first slot of bytes contains the length - // we jump 65 (0x41) per signature - // for v we load 32 bytes ending with v (the first 31 come from s) then apply a mask - assembly { - r := mload(add(_signature, 0x20)) - s := mload(add(_signature, 0x40)) - v := and(mload(add(_signature, 0x41)), 0xff) - } - require(v == 27 || v == 28, "v is neither 27 nor 28"); - require( - uint256(s) <= - 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, - "Invalid s" - ); - - address recoveredAddress = ecrecover(_suggestedSignedTxHash, v, r, s); - - for (uint i = 0; i < owners.length; i++) { - if (recoveredAddress == owners[i]) { - return; - } - } - revert("Invalid signature"); - } - - function executeTransaction( - bytes32, - bytes32, - Transaction calldata _transaction - ) external payable override { - _execute(_transaction); - } - - function executeTransactionFromOutside( - Transaction calldata _transaction - ) external payable override { - _validateTransaction(bytes32(0), _transaction); - _execute(_transaction); - } - - function _execute(Transaction calldata _transaction) internal { - address to = address(uint160(_transaction.to)); - uint256 value = _transaction.value; - - bytes memory data = _transaction.data; - bool success; - assembly { - success := call( - gas(), - to, - value, - add(data, 0x20), - mload(data), - 0, - 0 - ) - } - require(success); - } - - // Here, the user pays the bootloader for the transaction - function payForTransaction( - bytes32, - bytes32, - Transaction calldata _transaction - ) external payable { - bool success = _transaction.payToTheBootloader(); - require(success, "Failed to pay the fee to the operator"); - } - - // Here, the user should prepare for the transaction to be paid for by a paymaster - // Here, the account should set the allowance for the smart contracts - function prepareForPaymaster( - bytes32, - bytes32, - Transaction calldata _transaction - ) external payable { - _transaction.processPaymasterInput(); - } - - fallback() external payable { - // fallback of default AA shouldn't be called by bootloader under no circumstances - assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS); - - // If the contract is called directly, behave like an EOA - } - - receive() external payable {} -} diff --git a/etc/contracts-test-data/contracts/custom-account/nonce-holder-test.sol b/etc/contracts-test-data/contracts/custom-account/nonce-holder-test.sol deleted file mode 100644 index 5e276eab3af..00000000000 --- a/etc/contracts-test-data/contracts/custom-account/nonce-holder-test.sol +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -import './Constants.sol'; -import './TransactionHelper.sol'; - -import './interfaces/IAccount.sol'; -import './interfaces/IContractDeployer.sol'; - -import './SystemContractsCaller.sol'; - -/** -* @author Matter Labs -* @dev Dummy account used for tests that accepts any transaction. -*/ -contract NonceHolderTest is IAccount { - using TransactionHelper for Transaction; - - // bytes4(keccak256("isValidSignature(bytes32,bytes)") - bytes4 constant EIP1271_SUCCESS_RETURN_VALUE = 0x1626ba7e; - - function validateTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable override returns (bytes4 magic) { - // By default we consider the transaction as successful - magic = VALIDATION_SUCCESS_MAGIC; - - _validateTransaction(_transaction); - } - - function _validateTransaction(Transaction calldata _transaction) internal { - bytes memory data; - - if (uint8(_transaction.signature[0]) == 0) { - // It only erases nonce as non-allowed - data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.setValueUnderNonce, (_transaction.nonce, 1)); - } else if(uint8(_transaction.signature[0]) == 1) { - // It should increase minimal nonce by 5 - data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.increaseMinNonce, (5)); - } else if(uint8(_transaction.signature[0]) == 2) { - // It should try increasing nnonce by 2**90 - data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.increaseMinNonce, (2**90)); - } else if (uint8(_transaction.signature[0]) == 3) { - // Do nothing - return; - } else if(uint8(_transaction.signature[0]) == 4) { - // It should increase minimal nonce by 1 - data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.increaseMinNonce, (1)); - } else if (uint8(_transaction.signature[0]) == 5) { - // Increase minimal nonce by 5 and set the nonce ordering of the account as arbitrary - data = abi.encodeCall(NONCE_HOLDER_SYSTEM_CONTRACT.increaseMinNonce, (5)); - SystemContractsCaller.systemCallWithPropagatedRevert( - uint32(gasleft()), - address(DEPLOYER_SYSTEM_CONTRACT), - 0, - abi.encodeCall(DEPLOYER_SYSTEM_CONTRACT.updateNonceOrdering, (IContractDeployer.AccountNonceOrdering.Arbitrary)) - ); - } else { - revert("Unsupported test"); - } - - SystemContractsCaller.systemCallWithPropagatedRevert( - uint32(gasleft()), - address(NONCE_HOLDER_SYSTEM_CONTRACT), - 0, - data - ); - } - - function executeTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable override { - _execute(_transaction); - } - - function executeTransactionFromOutside(Transaction calldata _transaction) external payable override { - _validateTransaction(_transaction); - _execute(_transaction); - } - - function _execute(Transaction calldata _transaction) internal {} - - // Here, the user pays the bootloader for the transaction - function payForTransaction(bytes32, bytes32, Transaction calldata _transaction) external payable override { - bool success = _transaction.payToTheBootloader(); - require(success, "Failed to pay the fee to the operator"); - } - - // Here, the user should prepare for the transaction to be paid for by a paymaster - // Here, the account should set the allowance for the smart contracts - function prepareForPaymaster(bytes32, bytes32, Transaction calldata _transaction) external payable override { - _transaction.processPaymasterInput(); - } - - fallback() external payable { - // fallback of default AA shouldn't be called by bootloader under no circumstances - assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS); - - // If the contract is called directly, behave like an EOA - } - - receive() external payable {} -} diff --git a/etc/contracts-test-data/contracts/error/error.sol b/etc/contracts-test-data/contracts/error/error.sol deleted file mode 100644 index ba8085c2665..00000000000 --- a/etc/contracts-test-data/contracts/error/error.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.8.0; - -// SPDX-License-Identifier: MIT OR Apache-2.0 - -contract SimpleRequire { - error TestError(uint256 one, uint256 two, uint256 three, string data); - - function new_error() public pure { - revert TestError({one: 1, two: 2, three: 1, data: "data"}); - } - - function require_short() public pure { - require(false, "short"); - } - - function require_long() public pure { - require( - false, - 'longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong' - ); - } -} diff --git a/etc/contracts-test-data/contracts/estimator/estimator.sol b/etc/contracts-test-data/contracts/estimator/estimator.sol deleted file mode 100644 index 7fc7dfffc64..00000000000 --- a/etc/contracts-test-data/contracts/estimator/estimator.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -// This contract is used to estimate the protocol properties -// related to the fee calculation, such as block capacity -// and different operations costs. - -pragma solidity ^0.8.0; - -// Copied from `contracts/zksync/contracts/L2ContractHelper.sol`. -interface IL2Messenger { - function sendToL1(bytes memory _message) external returns (bytes32); -} - -uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15 -IL2Messenger constant L2_MESSENGER = IL2Messenger(address(SYSTEM_CONTRACTS_OFFSET + 0x08)); - -// TODO: Should be set to the actual value (SMA-1185). -// Represents the maximum amount of L2->L1 messages that can happen in one block. -uint256 constant MAX_L2_L1_MESSAGES_IN_BLOCK = 256; - -contract Estimator { - function estimateBlockCapacity() public { - // Block capacity is defined by several parameters, but the "cheapest" way to seal the block - // is to send a limited amount of messages to the L1. - // Here we're going to do just it. - for (uint256 i = 0; i < MAX_L2_L1_MESSAGES_IN_BLOCK; i++) { - L2_MESSENGER.sendToL1(bytes("")); - } - } -} diff --git a/etc/contracts-test-data/contracts/events/events.sol b/etc/contracts-test-data/contracts/events/events.sol deleted file mode 100644 index 93a451d5469..00000000000 --- a/etc/contracts-test-data/contracts/events/events.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -contract Emitter { - event Trivial(); - event Simple(uint256 Number, address Account); - event Indexed(uint256 indexed Number, address Account); - - function test(uint256 number) public { - emit Trivial(); - emit Simple(number, address(0xdeadbeef)); - emit Indexed(number, address(0xc0ffee)); - } -} diff --git a/etc/contracts-test-data/contracts/events/sample-calldata b/etc/contracts-test-data/contracts/events/sample-calldata deleted file mode 100644 index c137101ba026010f41d872325c4d53eab9d99a27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 UcmY#kARn;Lf2oO2HzQCI07%#Y-T(jq diff --git a/etc/contracts-test-data/contracts/expensive/expensive.sol b/etc/contracts-test-data/contracts/expensive/expensive.sol deleted file mode 100644 index 27e18b6eb6c..00000000000 --- a/etc/contracts-test-data/contracts/expensive/expensive.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; -pragma abicoder v2; - -contract Expensive { - uint[] array; - - function expensive(uint iterations) public returns (bytes32) { - for (uint i = 0; i < iterations; i++) { - array.push(i); - } - return keccak256(abi.encodePacked(array)); - } - - function cleanUp() public { - for (uint i = 0; i < array.length; i++) { - array[i] = 0; - } - } -} diff --git a/etc/contracts-test-data/contracts/failed-call/failed_call.sol b/etc/contracts-test-data/contracts/failed-call/failed_call.sol deleted file mode 100644 index 7a8f43fbd89..00000000000 --- a/etc/contracts-test-data/contracts/failed-call/failed_call.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT OR Apache-2.0 - -pragma solidity ^0.8.0; - -contract FailedCall { - bool public success; - bytes1 public data_first_byte; - - constructor() { - address MSG_VALUE_SIMULATOR = 0x0000000000000000000000000000000000008009; - - while (gasleft() > 20000) { - // Burn gas so that there's about 20k left before the external call. - } - - // This call fails because MSG_VALUE_SIMULATOR forcibly takes 27k gas - (bool s, bytes memory data) = MSG_VALUE_SIMULATOR.call( - abi.encodeWithSignature("deadBeef()") - ); - - success = s; - data_first_byte = data[0]; - } -} diff --git a/etc/contracts-test-data/contracts/infinite/infinite.sol b/etc/contracts-test-data/contracts/infinite/infinite.sol deleted file mode 100644 index 3ed4e035f60..00000000000 --- a/etc/contracts-test-data/contracts/infinite/infinite.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; -pragma abicoder v2; - -contract InfiniteLoop { - event Iteration(uint256 number); - - function infiniteLoop() public { - uint256 x = 0; - - while (true) { - x += 1; - // This event is needed so that LLVM - // won't optimize the loop away. - emit Iteration(x); - } - } -} diff --git a/etc/contracts-test-data/contracts/loadnext/loadnext_contract.sol b/etc/contracts-test-data/contracts/loadnext/loadnext_contract.sol deleted file mode 100644 index b14286a4503..00000000000 --- a/etc/contracts-test-data/contracts/loadnext/loadnext_contract.sol +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; -pragma abicoder v2; - -contract LoadnextContract { - event Event(uint val); - uint[] readArray; - uint[] writeArray; - - constructor (uint reads) { - for (uint i = 0; i < reads; i++) { - readArray.push(i); - } - } - - function execute(uint reads, uint writes, uint hashes, uint events, uint max_recursion, uint deploys) external returns(uint) { - if (max_recursion > 0) { - return this.execute(reads, writes, hashes, events, max_recursion - 1, deploys); - } - - uint sum = 0; - - // Somehow use result of storage read for compiler to not optimize this place. - for (uint i = 0; i < reads; i++) { - sum += readArray[i]; - } - - for (uint i = 0; i < writes; i++) { - writeArray.push(i); - } - - for (uint i = 0; i < events; i++) { - emit Event(i); - } - - // Somehow use result of keccak for compiler to not optimize this place. - for (uint i = 0; i < hashes; i++) { - sum += uint8(keccak256(abi.encodePacked("Message for encoding"))[0]); - } - - for (uint i = 0; i < deploys; i++) { - Foo foo = new Foo(); - } - return sum; - } - - function burnGas(uint256 gasToBurn) external { - uint256 initialGas = gasleft(); - while(initialGas - gasleft() < gasToBurn) {} - } -} - -contract Foo { - string public name = "Foo"; -} diff --git a/etc/contracts-test-data/contracts/long-return-data/long-return-data.sol b/etc/contracts-test-data/contracts/long-return-data/long-return-data.sol deleted file mode 100644 index 793bf191cbd..00000000000 --- a/etc/contracts-test-data/contracts/long-return-data/long-return-data.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.0; - -contract LongReturnData{ - function longReturnData() external returns (bool, bytes memory) { - // do some recursion, let's have more layers - (bool success, bytes memory _tmp) = this.longReturnData{gas: 79500000}(); - require(success == false); // they should fail by design - assembly { - return(0, 0xffffffffffffffff) - } - } -} diff --git a/etc/contracts-test-data/contracts/precompiles/precompiles.sol b/etc/contracts-test-data/contracts/precompiles/precompiles.sol deleted file mode 100644 index 7ba10166275..00000000000 --- a/etc/contracts-test-data/contracts/precompiles/precompiles.sol +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.8.0; - -address constant CODE_ORACLE_ADDR = 0x0000000000000000000000000000000000008012; - -contract Precompiles { - function doKeccak(uint256 iters) public pure returns (uint256) { - uint256 sum = 0; - for (uint256 i = 0; i < iters; i += 1) { - sum += uint(keccak256(abi.encode(i))) % 256; - } - return sum; - } - - function doSha256(uint256 iters) public pure returns (uint256) { - uint256 sum = 0; - for (uint256 i = 0; i < iters; i += 1) { - sum += uint(sha256(abi.encode(i))) % 256; - } - return sum; - } - - uint256 lastCodeOracleCost; - function callCodeOracle(bytes32 _versionedHash, bytes32 _expectedBytecodeHash) public { - uint256 gasBefore = gasleft(); - - // Call the code oracle - (bool success, bytes memory returnedBytecode) = CODE_ORACLE_ADDR.staticcall(abi.encodePacked(_versionedHash)); - - lastCodeOracleCost = gasBefore - gasleft(); - - // Check the result - require(success, "CodeOracle call failed"); - - // Check the returned bytecode - require(keccak256(returnedBytecode) == _expectedBytecodeHash, "Returned bytecode does not match the expected hash"); - } -} diff --git a/etc/contracts-test-data/contracts/simple-transfer/simple-transfer.sol b/etc/contracts-test-data/contracts/simple-transfer/simple-transfer.sol deleted file mode 100644 index 591e97cc1ae..00000000000 --- a/etc/contracts-test-data/contracts/simple-transfer/simple-transfer.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -contract SimpleTransfer { - address public owner; - - constructor() { - owner = msg.sender; // Set the contract creator as the owner - } - - // This function allows the contract to receive Ether with msg.data being empty - receive() external payable {} - - modifier onlyOwner() { - require(msg.sender == owner, "Only the owner can execute this."); - _; - } - - // Function to withdraw Ether to the owner's address - function withdraw(uint _amount) public onlyOwner { - require(address(this).balance >= _amount, "Insufficient balance in contract"); - payable(owner).transfer(_amount); - } - - // Function to transfer Ether from this contract to any address - function transfer(address _to, uint _amount) public onlyOwner { - require(address(this).balance >= _amount, "Insufficient balance in contract"); - payable(_to).transfer(_amount); - } - - // Function to check the contract's balance - function getBalance() public view returns (uint) { - return address(this).balance; - } -} diff --git a/etc/contracts-test-data/contracts/storage/storage.sol b/etc/contracts-test-data/contracts/storage/storage.sol deleted file mode 100644 index 2f386f5c732..00000000000 --- a/etc/contracts-test-data/contracts/storage/storage.sol +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.8.0; - -contract StorageTester { - uint256 public value; - - // Will cause 65-byte pubdata to be published - uint256 constant BIG_VALUE = 0x0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; - - // Will cause 34-byte pubdata to be published - uint256 constant SMALL_VALUE = 1; - - function simpleWrite() external { - value = BIG_VALUE; - } - - function resettingWrite() external { - value = BIG_VALUE; - value = SMALL_VALUE; - } - - // We have to use a variable since otherwise the function will be optimized - // to never do the write in the first place - function writeAndRevert(bool shouldRevert) external { - value = BIG_VALUE; - - if(shouldRevert) { - revert("This method always reverts"); - } - } - - function resettingWriteViaRevert() external { - value = SMALL_VALUE; - (bool success ,) = (address(this)).call(abi.encodeWithSignature("writeAndRevert(bool)", (true))); - value = SMALL_VALUE; - } - - // This test aims to check that the tstore/sstore are writing into separate spaces. - function testTrasientAndNonTransientStore() external { - value = 100; - - uint256 x; - - uint256 storedVal; - uint256 tStoredVal; - assembly { - tstore(0, 1) - - storedVal := sload(0) - tStoredVal := tload(0) - } - - require(storedVal == 100, "Stored value should be 100"); - require(tStoredVal == 1, "Transient stored value should be 1"); - } - - - uint256 constant TSTORE_TEST_KEY = 0xff; - - // We have to use a variable since otherwise the function will be optimized - // to never do the write in the first place - function tStoreAndRevert(uint256 value, bool shouldRevert) external { - uint256 key = TSTORE_TEST_KEY; - assembly { - tstore(key, value) - } - - if(shouldRevert) { - revert("This method always reverts"); - } - } - - // We have to use a variable since otherwise the function will be optimized - // to never do the write in the first place - function assertTValue(uint256 expectedValue) external { - uint256 key = TSTORE_TEST_KEY; - uint256 realValue; - assembly { - realValue := tload(key) - } - - require(realValue == expectedValue, "The value in transient storage is not what was expected"); - } - - function testTstoreRollback() external { - // Firstly, write the 1000 to the transient storage - this.tStoreAndRevert(1000, false); - - // Now call and ignore the error - (bool success, ) = (address(this)).call(abi.encodeWithSignature("tStoreAndRevert(uint256,bool)", uint256(500), true)); - require(!success, "The call should have failed"); - - this.assertTValue(1000); - } - - function testTransientStore() external { - this.testTrasientAndNonTransientStore(); - this.testTstoreRollback(); - } - - fallback() external {} -} diff --git a/etc/contracts-test-data/contracts/transfer/transfer.sol b/etc/contracts-test-data/contracts/transfer/transfer.sol deleted file mode 100644 index 4c63a2e9c7d..00000000000 --- a/etc/contracts-test-data/contracts/transfer/transfer.sol +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.8.0; - -contract TransferTest { - function transfer(address payable to, uint256 amount) public payable { - to.transfer(amount); - } - - function send(address payable to, uint256 amount) public payable { - bool success = to.send(amount); - - require(success, "Transaction failed"); - } - - receive() external payable { - - } -} - -contract Recipient { - event Received(address indexed sender, uint256 amount); - - receive() external payable { - require(gasleft() >= 2100, "Not enough gas"); - require(gasleft() <= 2300, "Too much gas"); - emit Received(msg.sender, msg.value); - } -} - -contract ReentrantRecipient { - uint256 x; - - event Received(uint256 tmp, uint256 amount); - - function setX() external payable { - x = 1; - } - - receive() external payable { - require(gasleft() >= 15000); - x = 1; - } -} diff --git a/etc/contracts-test-data/counter/counter.sol b/etc/contracts-test-data/counter/counter.sol deleted file mode 100644 index ec9219d7a19..00000000000 --- a/etc/contracts-test-data/counter/counter.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.8.0; - -contract Counter { - uint256 value; - - function increment(uint256 x) public { - value += x; - } - - function incrementWithRevertPayable(uint256 x, bool shouldRevert) public payable returns (uint256) { - return incrementWithRevert(x, shouldRevert); - } - - function incrementWithRevert(uint256 x, bool shouldRevert) public returns (uint256) { - value += x; - if (shouldRevert) { - revert("This method always reverts"); - } - return value; - } - - function get() public view returns (uint256) { - return value; - } -} diff --git a/etc/contracts-test-data/hardhat.config.ts b/etc/contracts-test-data/hardhat.config.ts deleted file mode 100644 index 1883c1f6cd4..00000000000 --- a/etc/contracts-test-data/hardhat.config.ts +++ /dev/null @@ -1,35 +0,0 @@ -import '@matterlabs/hardhat-zksync-solc'; - -const COMPILER_VERSION = '1.5.0'; -const PRE_RELEASE_VERSION = 'prerelease-a167aa3-code4rena'; -function getZksolcUrl(): string { - // @ts-ignore - const platform = { darwin: 'macosx', linux: 'linux', win32: 'windows' }[process.platform]; - // @ts-ignore - const toolchain = { linux: '-musl', win32: '-gnu', darwin: '' }[process.platform]; - const arch = process.arch === 'x64' ? 'amd64' : process.arch; - const ext = process.platform === 'win32' ? '.exe' : ''; - - return `https://github.com/matter-labs/era-compiler-solidity/releases/download/${PRE_RELEASE_VERSION}/zksolc-${platform}-${arch}${toolchain}-v${COMPILER_VERSION}${ext}`; -} - -export default { - zksolc: { - compilerSource: 'binary', - settings: { - compilerPath: getZksolcUrl(), - isSystem: true - } - }, - networks: { - hardhat: { - zksync: true - } - }, - solidity: { - version: '0.8.24', - settings: { - evmVersion: 'cancun' - } - } -}; diff --git a/etc/contracts-test-data/package.json b/etc/contracts-test-data/package.json deleted file mode 100644 index 543a982e4b7..00000000000 --- a/etc/contracts-test-data/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "contracts-test-data", - "version": "0.1.0", - "license": "MIT", - "dependencies": { - "@openzeppelin/contracts": "^4.8.0", - "hardhat": "=2.22.2" - }, - "devDependencies": { - "@matterlabs/hardhat-zksync-solc": "^0.3.15" - }, - "scripts": { - "build": "hardhat compile", - "clean": "hardhat clean" - } -} diff --git a/etc/contracts-test-data/yarn.lock b/etc/contracts-test-data/yarn.lock deleted file mode 100644 index 47c70d2d63e..00000000000 --- a/etc/contracts-test-data/yarn.lock +++ /dev/null @@ -1,2757 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@balena/dockerignore@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@balena/dockerignore/-/dockerignore-1.0.2.tgz#9ffe4726915251e8eb69f44ef3547e0da2c03e0d" - integrity sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q== - -"@chainsafe/as-sha256@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz#3639df0e1435cab03f4d9870cc3ac079e57a6fc9" - integrity sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg== - -"@chainsafe/persistent-merkle-tree@^0.4.2": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz#4c9ee80cc57cd3be7208d98c40014ad38f36f7ff" - integrity sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ== - dependencies: - "@chainsafe/as-sha256" "^0.3.1" - -"@chainsafe/persistent-merkle-tree@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz#2b4a62c9489a5739dedd197250d8d2f5427e9f63" - integrity sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw== - dependencies: - "@chainsafe/as-sha256" "^0.3.1" - -"@chainsafe/ssz@^0.10.0": - version "0.10.2" - resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.10.2.tgz#c782929e1bb25fec66ba72e75934b31fd087579e" - integrity sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg== - dependencies: - "@chainsafe/as-sha256" "^0.3.1" - "@chainsafe/persistent-merkle-tree" "^0.5.0" - -"@chainsafe/ssz@^0.9.2": - version "0.9.4" - resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.9.4.tgz#696a8db46d6975b600f8309ad3a12f7c0e310497" - integrity sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ== - dependencies: - "@chainsafe/as-sha256" "^0.3.1" - "@chainsafe/persistent-merkle-tree" "^0.4.2" - case "^1.6.3" - -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" - integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" - integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - -"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" - integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" - integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - -"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" - integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== - dependencies: - "@ethersproject/bytes" "^5.7.0" - -"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" - integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - -"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" - integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - bn.js "^5.2.1" - -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" - integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" - integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - -"@ethersproject/contracts@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" - integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== - dependencies: - "@ethersproject/abi" "^5.7.0" - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - -"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" - integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" - integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - -"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" - integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - -"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" - integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" - integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== - -"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": - version "5.7.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" - integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" - integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - -"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" - integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.1", "@ethersproject/providers@^5.7.2": - version "5.7.2" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" - integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - bech32 "1.1.4" - ws "7.4.6" - -"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" - integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" - integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" - integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - hash.js "1.1.7" - -"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" - integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - bn.js "^5.2.1" - elliptic "6.5.4" - hash.js "1.1.7" - -"@ethersproject/solidity@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" - integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" - integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" - integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - -"@ethersproject/units@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" - integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/wallet@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" - integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/json-wallets" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - -"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": - version "5.7.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" - integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== - dependencies: - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" - integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@fastify/busboy@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.0.0.tgz#f22824caff3ae506b18207bad4126dbc6ccdb6b8" - integrity sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ== - -"@matterlabs/hardhat-zksync-solc@^0.3.15": - version "0.3.17" - resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.3.17.tgz#72f199544dc89b268d7bfc06d022a311042752fd" - integrity sha512-aZgQ0yfXW5xPkfuEH1d44ncWV4T2LzKZd0VVPo4PL5cUrYs2/II1FaEDp5zsf3FxOR1xT3mBsjuSrtJkk4AL8Q== - dependencies: - "@nomiclabs/hardhat-docker" "^2.0.0" - chalk "4.1.2" - dockerode "^3.3.4" - -"@metamask/eth-sig-util@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" - integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== - dependencies: - ethereumjs-abi "^0.6.8" - ethereumjs-util "^6.2.1" - ethjs-util "^0.1.6" - tweetnacl "^1.0.3" - tweetnacl-util "^0.15.1" - -"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" - integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== - -"@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" - integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== - -"@nomicfoundation/ethereumjs-block@5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz#6f89664f55febbd723195b6d0974773d29ee133d" - integrity sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-trie" "6.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - ethereum-cryptography "0.1.3" - ethers "^5.7.1" - -"@nomicfoundation/ethereumjs-blockchain@7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz#80e0bd3535bfeb9baa29836b6f25123dab06a726" - integrity sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.1" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-ethash" "3.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-trie" "6.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - abstract-level "^1.0.3" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - level "^8.0.0" - lru-cache "^5.1.1" - memory-level "^1.0.0" - -"@nomicfoundation/ethereumjs-common@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz#4702d82df35b07b5407583b54a45bf728e46a2f0" - integrity sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g== - dependencies: - "@nomicfoundation/ethereumjs-util" "9.0.1" - crc-32 "^1.2.0" - -"@nomicfoundation/ethereumjs-ethash@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz#65ca494d53e71e8415c9a49ef48bc921c538fc41" - integrity sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - abstract-level "^1.0.3" - bigint-crypto-utils "^3.0.23" - ethereum-cryptography "0.1.3" - -"@nomicfoundation/ethereumjs-evm@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz#f35681e203363f69ce2b3d3bf9f44d4e883ca1f1" - integrity sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ== - dependencies: - "@ethersproject/providers" "^5.7.1" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - mcl-wasm "^0.7.1" - rustbn.js "~0.2.0" - -"@nomicfoundation/ethereumjs-rlp@5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz#0b30c1cf77d125d390408e391c4bb5291ef43c28" - integrity sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ== - -"@nomicfoundation/ethereumjs-statemanager@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz#8824a97938db4471911e2d2f140f79195def5935" - integrity sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - ethers "^5.7.1" - js-sdsl "^4.1.4" - -"@nomicfoundation/ethereumjs-trie@6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz#662c55f6b50659fd4b22ea9f806a7401cafb7717" - integrity sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA== - dependencies: - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - "@types/readable-stream" "^2.3.13" - ethereum-cryptography "0.1.3" - readable-stream "^3.6.0" - -"@nomicfoundation/ethereumjs-tx@5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz#7629dc2036b4a33c34e9f0a592b43227ef4f0c7d" - integrity sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w== - dependencies: - "@chainsafe/ssz" "^0.9.2" - "@ethersproject/providers" "^5.7.2" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - ethereum-cryptography "0.1.3" - -"@nomicfoundation/ethereumjs-util@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz#530cda8bae33f8b5020a8f199ed1d0a2ce48ec89" - integrity sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA== - dependencies: - "@chainsafe/ssz" "^0.10.0" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - ethereum-cryptography "0.1.3" - -"@nomicfoundation/ethereumjs-vm@7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz#7d035e0993bcad10716c8b36e61dfb87fa3ca05f" - integrity sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.1" - "@nomicfoundation/ethereumjs-blockchain" "7.0.1" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-evm" "2.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-statemanager" "2.0.1" - "@nomicfoundation/ethereumjs-trie" "6.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - mcl-wasm "^0.7.1" - rustbn.js "~0.2.0" - -"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" - integrity sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w== - -"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz#6e25ccdf6e2d22389c35553b64fe6f3fdaec432c" - integrity sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA== - -"@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz#0a224ea50317139caeebcdedd435c28a039d169c" - integrity sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA== - -"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz#dfa085d9ffab9efb2e7b383aed3f557f7687ac2b" - integrity sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg== - -"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz#c9e06b5d513dd3ab02a7ac069c160051675889a4" - integrity sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w== - -"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz#8d328d16839e52571f72f2998c81e46bf320f893" - integrity sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA== - -"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz#9b49d0634b5976bb5ed1604a1e1b736f390959bb" - integrity sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w== - -"@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz#e2867af7264ebbcc3131ef837878955dd6a3676f" - integrity sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg== - -"@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz#0685f78608dd516c8cdfb4896ed451317e559585" - integrity sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ== - -"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz#c9a44f7108646f083b82e851486e0f6aeb785836" - integrity sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw== - -"@nomicfoundation/solidity-analyzer@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz#f5f4d36d3f66752f59a57e7208cd856f3ddf6f2d" - integrity sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg== - optionalDependencies: - "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.1" - "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.1" - "@nomicfoundation/solidity-analyzer-freebsd-x64" "0.1.1" - "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.1" - "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.1" - "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.1" - "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.1" - "@nomicfoundation/solidity-analyzer-win32-arm64-msvc" "0.1.1" - "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" - "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" - -"@nomiclabs/hardhat-docker@^2.0.0": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-docker/-/hardhat-docker-2.0.2.tgz#ae964be17951275a55859ff7358e9e7c77448846" - integrity sha512-XgGEpRT3wlA1VslyB57zyAHV+oll8KnV1TjwnxxC1tpAL04/lbdwpdO5KxInVN8irMSepqFpsiSkqlcnvbE7Ng== - dependencies: - dockerode "^2.5.8" - fs-extra "^7.0.1" - node-fetch "^2.6.0" - -"@openzeppelin/contracts@^4.8.0": - version "4.9.3" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" - integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== - -"@scure/base@~1.1.0": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" - integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== - -"@scure/bip32@1.1.5": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" - integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== - dependencies: - "@noble/hashes" "~1.2.0" - "@noble/secp256k1" "~1.7.0" - "@scure/base" "~1.1.0" - -"@scure/bip39@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" - integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== - dependencies: - "@noble/hashes" "~1.2.0" - "@scure/base" "~1.1.0" - -"@sentry/core@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" - integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/minimal" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/hub@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" - integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== - dependencies: - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/minimal@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" - integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/types" "5.30.0" - tslib "^1.9.3" - -"@sentry/node@^5.18.1": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" - integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== - dependencies: - "@sentry/core" "5.30.0" - "@sentry/hub" "5.30.0" - "@sentry/tracing" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - cookie "^0.4.1" - https-proxy-agent "^5.0.0" - lru_map "^0.3.3" - tslib "^1.9.3" - -"@sentry/tracing@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" - integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/minimal" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/types@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" - integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== - -"@sentry/utils@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" - integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== - dependencies: - "@sentry/types" "5.30.0" - tslib "^1.9.3" - -"@types/bn.js@^4.11.3": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" - -"@types/bn.js@^5.1.0": - version "5.1.5" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" - integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== - dependencies: - "@types/node" "*" - -"@types/lru-cache@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" - integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== - -"@types/node@*": - version "20.9.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298" - integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw== - dependencies: - undici-types "~5.26.4" - -"@types/pbkdf2@^3.0.0": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.2.tgz#2dc43808e9985a2c69ff02e2d2027bd4fe33e8dc" - integrity sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew== - dependencies: - "@types/node" "*" - -"@types/readable-stream@^2.3.13": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" - integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== - dependencies: - "@types/node" "*" - safe-buffer "~5.1.1" - -"@types/secp256k1@^4.0.1": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.6.tgz#d60ba2349a51c2cbc5e816dcd831a42029d376bf" - integrity sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ== - dependencies: - "@types/node" "*" - -JSONStream@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" - integrity sha512-mn0KSip7N4e0UDPZHnqDsHECo5uGQrixQKnAskOM1BIB8hd7QKbd6il8IPRPudPHOeHiECoCFqhyMaRO9+nWyA== - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - -abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" - integrity sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA== - dependencies: - buffer "^6.0.3" - catering "^2.1.0" - is-buffer "^2.0.5" - level-supports "^4.0.0" - level-transcoder "^1.0.1" - module-error "^1.0.1" - queue-microtask "^1.2.3" - -adm-zip@^0.4.16: - version "0.4.16" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" - integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== - -aes-js@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -aggregate-error@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" - integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== - dependencies: - clean-stack "^2.0.0" - indent-string "^4.0.0" - -ansi-colors@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-colors@^4.1.1: - version "4.1.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" - integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== - -ansi-escapes@^4.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -asn1@^0.2.6: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base-x@^3.0.2: - version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== - dependencies: - safe-buffer "^5.0.1" - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bcrypt-pbkdf@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== - dependencies: - tweetnacl "^0.14.3" - -bech32@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" - integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== - -bigint-crypto-utils@^3.0.23: - version "3.3.0" - resolved "https://registry.yarnpkg.com/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz#72ad00ae91062cf07f2b1def9594006c279c1d77" - integrity sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -bl@^1.0.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" - integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - -bl@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -blakejs@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" - integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== - -bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.2.0, bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== - -browser-level@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browser-level/-/browser-level-1.0.1.tgz#36e8c3183d0fe1c405239792faaab5f315871011" - integrity sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ== - dependencies: - abstract-level "^1.0.2" - catering "^2.1.1" - module-error "^1.0.2" - run-parallel-limit "^1.1.0" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -bs58@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== - dependencies: - base-x "^3.0.2" - -bs58check@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== - dependencies: - bs58 "^4.0.0" - create-hash "^1.1.0" - safe-buffer "^5.1.2" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ== - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== - -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -buffer@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - -buildcheck@~0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/buildcheck/-/buildcheck-0.0.6.tgz#89aa6e417cfd1e2196e3f8fe915eb709d2fe4238" - integrity sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A== - -bytes@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== - -camelcase@^6.0.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -case@^1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" - integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== - -catering@^2.1.0, catering@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" - integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== - -chalk@4.1.2, chalk@^4.1.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chokidar@3.5.3, chokidar@^3.4.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -chownr@^1.0.1, chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -classic-level@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/classic-level/-/classic-level-1.3.0.tgz#5e36680e01dc6b271775c093f2150844c5edd5c8" - integrity sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg== - dependencies: - abstract-level "^1.0.2" - catering "^2.1.0" - module-error "^1.0.1" - napi-macros "^2.2.2" - node-gyp-build "^4.3.0" - -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -command-exists@^1.2.8: - version "1.2.9" - resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" - integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== - -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -concat-stream@~1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -cookie@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" - integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cpu-features@~0.0.8: - version "0.0.9" - resolved "https://registry.yarnpkg.com/cpu-features/-/cpu-features-0.0.9.tgz#5226b92f0f1c63122b0a3eb84cb8335a4de499fc" - integrity sha512-AKjgn2rP2yJyfbepsmLfiYcmtNn/2eUvocUyM/09yB0YDiz39HteK/5/T4Onf0pmdYDMgkBoGvRLvEguzyL7wQ== - dependencies: - buildcheck "~0.0.6" - nan "^2.17.0" - -crc-32@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" - integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.3: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -debug@^3.2.6: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -decamelize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== - -depd@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -diff@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - -docker-modem@^1.0.8: - version "1.0.9" - resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-1.0.9.tgz#a1f13e50e6afb6cf3431b2d5e7aac589db6aaba8" - integrity sha512-lVjqCSCIAUDZPAZIeyM125HXfNvOmYYInciphNrLrylUtKyW66meAjSPXWchKVzoIYZx69TPnAepVSSkeawoIw== - dependencies: - JSONStream "1.3.2" - debug "^3.2.6" - readable-stream "~1.0.26-4" - split-ca "^1.0.0" - -docker-modem@^3.0.0: - version "3.0.8" - resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-3.0.8.tgz#ef62c8bdff6e8a7d12f0160988c295ea8705e77a" - integrity sha512-f0ReSURdM3pcKPNS30mxOHSbaFLcknGmQjwSfmbcdOw1XWKXVhukM3NJHhr7NpY9BIyyWQb0EBo3KQvvuU5egQ== - dependencies: - debug "^4.1.1" - readable-stream "^3.5.0" - split-ca "^1.0.1" - ssh2 "^1.11.0" - -dockerode@^2.5.8: - version "2.5.8" - resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-2.5.8.tgz#1b661e36e1e4f860e25f56e0deabe9f87f1d0acc" - integrity sha512-+7iOUYBeDTScmOmQqpUYQaE7F4vvIt6+gIZNHWhqAQEI887tiPFB9OvXI/HzQYqfUNvukMK+9myLW63oTJPZpw== - dependencies: - concat-stream "~1.6.2" - docker-modem "^1.0.8" - tar-fs "~1.16.3" - -dockerode@^3.3.4: - version "3.3.5" - resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.5.tgz#7ae3f40f2bec53ae5e9a741ce655fff459745629" - integrity sha512-/0YNa3ZDNeLr/tSckmD69+Gq+qVNhvKfAHNeZJBnp7EOP6RGKV8ORrJHkUn20So5wU+xxT7+1n5u8PjHbfjbSA== - dependencies: - "@balena/dockerignore" "^1.0.2" - docker-modem "^3.0.0" - tar-fs "~2.0.1" - -elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -enquirer@^2.3.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" - integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== - dependencies: - ansi-colors "^4.1.1" - strip-ansi "^6.0.1" - -env-paths@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" - integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== - dependencies: - "@types/pbkdf2" "^3.0.0" - "@types/secp256k1" "^4.0.1" - blakejs "^1.1.0" - browserify-aes "^1.2.0" - bs58check "^2.1.2" - create-hash "^1.2.0" - create-hmac "^1.1.7" - hash.js "^1.1.7" - keccak "^3.0.0" - pbkdf2 "^3.0.17" - randombytes "^2.1.0" - safe-buffer "^5.1.2" - scrypt-js "^3.0.0" - secp256k1 "^4.0.1" - setimmediate "^1.0.5" - -ethereum-cryptography@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" - integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== - dependencies: - "@noble/hashes" "1.2.0" - "@noble/secp256k1" "1.7.1" - "@scure/bip32" "1.1.5" - "@scure/bip39" "1.1.1" - -ethereumjs-abi@^0.6.8: - version "0.6.8" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" - integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" - integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.3" - -ethers@^5.7.1: - version "5.7.2" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" - integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== - dependencies: - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/abstract-signer" "5.7.0" - "@ethersproject/address" "5.7.0" - "@ethersproject/base64" "5.7.0" - "@ethersproject/basex" "5.7.0" - "@ethersproject/bignumber" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/constants" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/hash" "5.7.0" - "@ethersproject/hdnode" "5.7.0" - "@ethersproject/json-wallets" "5.7.0" - "@ethersproject/keccak256" "5.7.0" - "@ethersproject/logger" "5.7.0" - "@ethersproject/networks" "5.7.1" - "@ethersproject/pbkdf2" "5.7.0" - "@ethersproject/properties" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/random" "5.7.0" - "@ethersproject/rlp" "5.7.0" - "@ethersproject/sha2" "5.7.0" - "@ethersproject/signing-key" "5.7.0" - "@ethersproject/solidity" "5.7.0" - "@ethersproject/strings" "5.7.0" - "@ethersproject/transactions" "5.7.0" - "@ethersproject/units" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@ethersproject/web" "5.7.1" - "@ethersproject/wordlists" "5.7.0" - -ethjs-util@0.1.6, ethjs-util@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" - integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== - dependencies: - is-hex-prefixed "1.0.0" - strip-hex-prefix "1.0.0" - -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - -evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== - dependencies: - locate-path "^2.0.0" - -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - -follow-redirects@^1.12.1: - version "1.15.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" - integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== - -fp-ts@1.19.3: - version "1.19.3" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" - integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== - -fp-ts@^1.0.0: - version "1.19.5" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" - integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - -fs-extra@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -hardhat@=2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.16.0.tgz#c5611d433416b31f6ce92f733b1f1b5236ad6230" - integrity sha512-7VQEJPQRAZdtrYUZaU9GgCpP3MBNy/pTdscARNJQMWKj5C+R7V32G5uIZKIqZ4QiqXa6CBfxxe+G+ahxUbHZHA== - dependencies: - "@ethersproject/abi" "^5.1.2" - "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/ethereumjs-block" "5.0.1" - "@nomicfoundation/ethereumjs-blockchain" "7.0.1" - "@nomicfoundation/ethereumjs-common" "4.0.1" - "@nomicfoundation/ethereumjs-evm" "2.0.1" - "@nomicfoundation/ethereumjs-rlp" "5.0.1" - "@nomicfoundation/ethereumjs-statemanager" "2.0.1" - "@nomicfoundation/ethereumjs-trie" "6.0.1" - "@nomicfoundation/ethereumjs-tx" "5.0.1" - "@nomicfoundation/ethereumjs-util" "9.0.1" - "@nomicfoundation/ethereumjs-vm" "7.0.1" - "@nomicfoundation/solidity-analyzer" "^0.1.0" - "@sentry/node" "^5.18.1" - "@types/bn.js" "^5.1.0" - "@types/lru-cache" "^5.1.0" - abort-controller "^3.0.0" - adm-zip "^0.4.16" - aggregate-error "^3.0.0" - ansi-escapes "^4.3.0" - chalk "^2.4.2" - chokidar "^3.4.0" - ci-info "^2.0.0" - debug "^4.1.1" - enquirer "^2.3.0" - env-paths "^2.2.0" - ethereum-cryptography "^1.0.3" - ethereumjs-abi "^0.6.8" - find-up "^2.1.0" - fp-ts "1.19.3" - fs-extra "^7.0.1" - glob "7.2.0" - immutable "^4.0.0-rc.12" - io-ts "1.10.4" - keccak "^3.0.2" - lodash "^4.17.11" - mnemonist "^0.38.0" - mocha "^10.0.0" - p-map "^4.0.0" - raw-body "^2.4.1" - resolve "1.17.0" - semver "^6.3.0" - solc "0.7.3" - source-map-support "^0.5.13" - stacktrace-parser "^0.1.10" - tsort "0.0.1" - undici "^5.14.0" - uuid "^8.3.2" - ws "^7.4.6" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== - dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" - -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ieee754@^1.1.13, ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -immutable@^4.0.0-rc.12: - version "4.3.4" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f" - integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA== - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -io-ts@1.10.4: - version "1.10.4" - resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" - integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== - dependencies: - fp-ts "^1.0.0" - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-buffer@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-hex-prefixed@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -js-sdsl@^4.1.4: - version "4.4.2" - resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.2.tgz#2e3c031b1f47d3aca8b775532e3ebb0818e7f847" - integrity sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w== - -js-sha3@0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -js-yaml@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== - optionalDependencies: - graceful-fs "^4.1.6" - -jsonparse@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== - -keccak@^3.0.0, keccak@^3.0.2: - version "3.0.4" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" - integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.0" - -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== - optionalDependencies: - graceful-fs "^4.1.9" - -level-supports@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-4.0.1.tgz#431546f9d81f10ff0fea0e74533a0e875c08c66a" - integrity sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA== - -level-transcoder@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" - integrity sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w== - dependencies: - buffer "^6.0.3" - module-error "^1.0.1" - -level@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/level/-/level-8.0.0.tgz#41b4c515dabe28212a3e881b61c161ffead14394" - integrity sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ== - dependencies: - browser-level "^1.0.1" - classic-level "^1.2.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash@^4.17.11: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -lru_map@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" - integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== - -mcl-wasm@^0.7.1: - version "0.7.9" - resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" - integrity sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ== - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -memory-level@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/memory-level/-/memory-level-1.0.0.tgz#7323c3fd368f9af2f71c3cd76ba403a17ac41692" - integrity sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og== - dependencies: - abstract-level "^1.0.0" - functional-red-black-tree "^1.0.1" - module-error "^1.0.1" - -memorystream@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== - -minimatch@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" - integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== - dependencies: - brace-expansion "^2.0.1" - -minimatch@^3.0.4, minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.6: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -mkdirp-classic@^0.5.2: - version "0.5.3" - resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" - integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== - -mkdirp@^0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - -mnemonist@^0.38.0: - version "0.38.5" - resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" - integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== - dependencies: - obliterator "^2.0.0" - -mocha@^10.0.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" - integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== - dependencies: - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.5.3" - debug "4.3.4" - diff "5.0.0" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.2.0" - he "1.2.0" - js-yaml "4.1.0" - log-symbols "4.1.0" - minimatch "5.0.1" - ms "2.1.3" - nanoid "3.3.3" - serialize-javascript "6.0.0" - strip-json-comments "3.1.1" - supports-color "8.1.1" - workerpool "6.2.1" - yargs "16.2.0" - yargs-parser "20.2.4" - yargs-unparser "2.0.0" - -module-error@^1.0.1, module-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" - integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@2.1.3, ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -nan@^2.17.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" - integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== - -nanoid@3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" - integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== - -napi-macros@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.2.2.tgz#817fef20c3e0e40a963fbf7b37d1600bd0201044" - integrity sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g== - -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-fetch@^2.6.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - -node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" - integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -obliterator@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" - integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== - dependencies: - p-limit "^1.1.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -pbkdf2@^3.0.17: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -pump@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" - integrity sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -queue-microtask@^1.2.2, queue-microtask@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -raw-body@^2.4.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" - integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - -readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5: - version "2.3.8" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" - integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@~1.0.26-4: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -require-from-string@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -resolve@1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - -rimraf@^2.2.8: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rlp@^2.2.3: - version "2.2.7" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" - integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== - dependencies: - bn.js "^5.2.0" - -run-parallel-limit@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz#be80e936f5768623a38a963262d6bef8ff11e7ba" - integrity sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw== - dependencies: - queue-microtask "^1.2.2" - -rustbn.js@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" - integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -scrypt-js@3.0.1, scrypt-js@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - -secp256k1@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" - integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== - dependencies: - elliptic "^6.5.4" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -semver@^5.5.0: - version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@^6.3.0: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -serialize-javascript@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -solc@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" - integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - follow-redirects "^1.12.1" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -source-map-support@^0.5.13: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -split-ca@^1.0.0, split-ca@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/split-ca/-/split-ca-1.0.1.tgz#6c83aff3692fa61256e0cd197e05e9de157691a6" - integrity sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ== - -ssh2@^1.11.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/ssh2/-/ssh2-1.14.0.tgz#8f68440e1b768b66942c9e4e4620b2725b3555bb" - integrity sha512-AqzD1UCqit8tbOKoj6ztDDi1ffJZ2rV2SwlgrVVrHPkV5vWqGJOVp5pmtj18PunkPJAuKQsnInyKV+/Nb2bUnA== - dependencies: - asn1 "^0.2.6" - bcrypt-pbkdf "^1.0.2" - optionalDependencies: - cpu-features "~0.0.8" - nan "^2.17.0" - -stacktrace-parser@^0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" - integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== - dependencies: - type-fest "^0.7.1" - -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-hex-prefix@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== - dependencies: - is-hex-prefixed "1.0.0" - -strip-json-comments@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -tar-fs@~1.16.3: - version "1.16.3" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" - integrity sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw== - dependencies: - chownr "^1.0.1" - mkdirp "^0.5.1" - pump "^1.0.0" - tar-stream "^1.1.2" - -tar-fs@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.1.tgz#e44086c1c60d31a4f0cf893b1c4e155dabfae9e2" - integrity sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA== - dependencies: - chownr "^1.1.1" - mkdirp-classic "^0.5.2" - pump "^3.0.0" - tar-stream "^2.0.0" - -tar-stream@^1.1.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== - dependencies: - bl "^1.0.0" - buffer-alloc "^1.2.0" - end-of-stream "^1.0.0" - fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.1" - xtend "^4.0.0" - -tar-stream@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" - integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - -"through@>=2.2.7 <3": - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - -tmp@0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -to-buffer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - -tslib@^1.9.3: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsort@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" - integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== - -tweetnacl-util@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" - integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== - -tweetnacl@^0.14.3: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== - -tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" - integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -undici@^5.14.0: - version "5.27.2" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.27.2.tgz#a270c563aea5b46cc0df2550523638c95c5d4411" - integrity sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ== - dependencies: - "@fastify/busboy" "^2.0.0" - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -unpipe@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -workerpool@6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" - integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -ws@7.4.6: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== - -ws@^7.4.6: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== - -xtend@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yargs-parser@20.2.4: - version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-unparser@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== - dependencies: - camelcase "^6.0.0" - decamelize "^4.0.0" - flat "^5.0.2" - is-plain-obj "^2.1.0" - -yargs@16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From affaf38b270c530b4ca19640800fcccee338b36d Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 12:03:20 +0300 Subject: [PATCH 10/32] Move `test_account` to `lib` dir ...and rename to `test_contracts` --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 4 ++-- core/lib/dal/Cargo.toml | 2 +- core/lib/dal/src/consensus/tests.rs | 2 +- core/lib/multivm/Cargo.toml | 2 +- core/lib/multivm/src/versions/testonly.rs | 2 +- core/lib/multivm/src/versions/tests.rs | 2 +- .../src/versions/vm_fast/tests/block_tip.rs | 2 +- .../vm_fast/tests/bytecode_publishing.rs | 2 +- .../src/versions/vm_fast/tests/code_oracle.rs | 2 +- .../src/versions/vm_fast/tests/default_aa.rs | 2 +- .../src/versions/vm_fast/tests/gas_limit.rs | 2 +- .../vm_fast/tests/get_used_contracts.rs | 2 +- .../vm_fast/tests/is_write_initial.rs | 2 +- .../versions/vm_fast/tests/l1_tx_execution.rs | 2 +- .../versions/vm_fast/tests/nonce_holder.rs | 2 +- .../src/versions/vm_fast/tests/precompiles.rs | 2 +- .../versions/vm_fast/tests/prestate_tracer.rs | 2 +- .../src/versions/vm_fast/tests/refunds.rs | 2 +- .../versions/vm_fast/tests/require_eip712.rs | 2 +- .../src/versions/vm_fast/tests/rollbacks.rs | 2 +- .../src/versions/vm_fast/tests/storage.rs | 2 +- .../src/versions/vm_fast/tests/tester/mod.rs | 2 +- .../vm_fast/tests/tester/vm_tester.rs | 2 +- .../vm_fast/tests/tracing_execution_error.rs | 2 +- .../src/versions/vm_fast/tests/transfer.rs | 2 +- .../src/versions/vm_fast/tests/upgrade.rs | 2 +- .../src/versions/vm_latest/tests/block_tip.rs | 2 +- .../vm_latest/tests/bytecode_publishing.rs | 2 +- .../versions/vm_latest/tests/call_tracer.rs | 2 +- .../versions/vm_latest/tests/code_oracle.rs | 2 +- .../versions/vm_latest/tests/default_aa.rs | 2 +- .../src/versions/vm_latest/tests/gas_limit.rs | 2 +- .../vm_latest/tests/get_used_contracts.rs | 2 +- .../vm_latest/tests/is_write_initial.rs | 2 +- .../vm_latest/tests/l1_tx_execution.rs | 2 +- .../src/versions/vm_latest/tests/migration.rs | 2 +- .../versions/vm_latest/tests/nonce_holder.rs | 2 +- .../versions/vm_latest/tests/precompiles.rs | 2 +- .../vm_latest/tests/prestate_tracer.rs | 2 +- .../src/versions/vm_latest/tests/refunds.rs | 2 +- .../vm_latest/tests/require_eip712.rs | 2 +- .../src/versions/vm_latest/tests/rollbacks.rs | 2 +- .../src/versions/vm_latest/tests/storage.rs | 2 +- .../versions/vm_latest/tests/tester/mod.rs | 2 +- .../vm_latest/tests/tester/vm_tester.rs | 2 +- .../tests/tracing_execution_error.rs | 2 +- .../src/versions/vm_latest/tests/transfer.rs | 2 +- .../src/versions/vm_latest/tests/upgrade.rs | 2 +- .../test_contracts}/Cargo.toml | 4 ++-- .../test_contracts}/build.rs | 0 .../complex-upgrade/complex-upgrade.sol | 0 .../contracts/complex-upgrade/msg-sender.sol | 0 .../contracts/context/context.sol | 0 .../contracts/counter/counter.sol | 0 .../contracts/counter/proxy_counter.sol | 0 .../test_contracts}/contracts/create/Foo.sol | 0 .../contracts/create/create.sol | 0 .../contracts/custom-account/Constants.sol | 0 .../contracts/custom-account/RLPEncoder.sol | 0 .../custom-account/SystemContext.sol | 0 .../custom-account/SystemContractsCaller.sol | 0 .../custom-account/TransactionHelper.sol | 0 .../contracts/custom-account/Utils.sol | 0 .../custom-account/custom-account.sol | 0 .../custom-account/custom-paymaster.sol | 0 .../custom-account/interfaces/IAccount.sol | 0 .../interfaces/IContractDeployer.sol | 0 .../custom-account/interfaces/IERC20.sol | 0 .../interfaces/INonceHolder.sol | 0 .../custom-account/interfaces/IPaymaster.sol | 0 .../interfaces/IPaymasterFlow.sol | 0 .../many-owners-custom-account.sol | 0 .../custom-account/nonce-holder-test.sol | 0 .../test_contracts}/contracts/error/error.sol | 0 .../contracts/estimator/estimator.sol | 0 .../contracts/events/events.sol | 0 .../contracts/events/sample-calldata | Bin .../contracts/expensive/expensive.sol | 0 .../contracts/failed-call/failed_call.sol | 0 .../contracts/infinite/infinite.sol | 0 .../contracts/loadnext/loadnext_contract.sol | 0 .../long-return-data/long-return-data.sol | 0 .../contracts/precompiles/precompiles.sol | 0 .../simple-transfer/simple-transfer.sol | 0 .../contracts/storage/storage.sol | 0 .../contracts/transfer/transfer.sol | 0 .../test_contracts}/hardhat.config.ts | 0 .../test_contracts}/package.json | 5 +++-- .../test_contracts}/src/contracts.rs | 0 .../test_contracts}/src/lib.rs | 0 .../test_contracts}/yarn.lock | 0 core/node/api_server/Cargo.toml | 2 +- core/node/api_server/src/testonly.rs | 2 +- .../api_server/src/tx_sender/tests/mod.rs | 2 +- core/node/consensus/Cargo.toml | 2 +- core/node/consensus/src/registry/testonly.rs | 4 ++-- core/node/consensus/src/registry/tests.rs | 2 +- core/node/consensus/src/testonly.rs | 2 +- core/node/consensus/src/tests/attestation.rs | 2 +- core/node/consensus/src/tests/batch.rs | 2 +- core/node/consensus/src/tests/mod.rs | 2 +- core/node/state_keeper/Cargo.toml | 2 +- .../state_keeper/src/executor/tests/mod.rs | 2 +- .../state_keeper/src/executor/tests/tester.rs | 2 +- core/node/state_keeper/src/testonly/mod.rs | 2 +- core/node/vm_runner/Cargo.toml | 2 +- core/node/vm_runner/src/tests/mod.rs | 2 +- core/node/vm_runner/src/tests/process.rs | 2 +- core/node/vm_runner/src/tests/storage.rs | 2 +- core/tests/loadnext/Cargo.toml | 2 +- core/tests/loadnext/src/account/mod.rs | 2 +- core/tests/loadnext/src/account_pool.rs | 2 +- core/tests/loadnext/src/config.rs | 2 +- core/tests/vm-benchmark/Cargo.toml | 2 +- core/tests/vm-benchmark/src/transaction.rs | 4 ++-- core/tests/vm-benchmark/src/vm.rs | 2 +- 117 files changed, 90 insertions(+), 89 deletions(-) rename core/{tests/test_account => lib/test_contracts}/Cargo.toml (84%) rename core/{tests/test_account => lib/test_contracts}/build.rs (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/complex-upgrade/complex-upgrade.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/complex-upgrade/msg-sender.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/context/context.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/counter/counter.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/counter/proxy_counter.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/create/Foo.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/create/create.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/Constants.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/RLPEncoder.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/SystemContext.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/SystemContractsCaller.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/TransactionHelper.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/Utils.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/custom-account.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/custom-paymaster.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/interfaces/IAccount.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/interfaces/IContractDeployer.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/interfaces/IERC20.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/interfaces/INonceHolder.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/interfaces/IPaymaster.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/interfaces/IPaymasterFlow.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/many-owners-custom-account.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/custom-account/nonce-holder-test.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/error/error.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/estimator/estimator.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/events/events.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/events/sample-calldata (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/expensive/expensive.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/failed-call/failed_call.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/infinite/infinite.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/loadnext/loadnext_contract.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/long-return-data/long-return-data.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/precompiles/precompiles.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/simple-transfer/simple-transfer.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/storage/storage.sol (100%) rename core/{tests/test_account => lib/test_contracts}/contracts/transfer/transfer.sol (100%) rename core/{tests/test_account => lib/test_contracts}/hardhat.config.ts (100%) rename core/{tests/test_account => lib/test_contracts}/package.json (75%) rename core/{tests/test_account => lib/test_contracts}/src/contracts.rs (100%) rename core/{tests/test_account => lib/test_contracts}/src/lib.rs (100%) rename core/{tests/test_account => lib/test_contracts}/yarn.lock (100%) diff --git a/Cargo.lock b/Cargo.lock index eba48b7bd58..a561972000e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4235,7 +4235,7 @@ dependencies = [ "zksync_eth_client", "zksync_eth_signer", "zksync_system_constants", - "zksync_test_account", + "zksync_test_contracts", "zksync_types", "zksync_utils", "zksync_vlog", @@ -8725,7 +8725,7 @@ dependencies = [ "vise", "zksync_contracts", "zksync_multivm", - "zksync_test_account", + "zksync_test_contracts", "zksync_types", "zksync_utils", "zksync_vlog", @@ -10058,7 +10058,7 @@ dependencies = [ "zksync_protobuf", "zksync_protobuf_build", "zksync_system_constants", - "zksync_test_account", + "zksync_test_contracts", "zksync_types", "zksync_utils", "zksync_vm_interface", @@ -10484,7 +10484,7 @@ dependencies = [ "zksync_contracts", "zksync_eth_signer", "zksync_system_constants", - "zksync_test_account", + "zksync_test_contracts", "zksync_types", "zksync_utils", "zksync_vm2", @@ -10538,7 +10538,7 @@ dependencies = [ "zksync_state", "zksync_state_keeper", "zksync_system_constants", - "zksync_test_account", + "zksync_test_contracts", "zksync_types", "zksync_utils", "zksync_vm_executor", @@ -10581,7 +10581,7 @@ dependencies = [ "zksync_state", "zksync_state_keeper", "zksync_system_constants", - "zksync_test_account", + "zksync_test_contracts", "zksync_types", "zksync_utils", "zksync_vm_executor", @@ -11100,7 +11100,7 @@ dependencies = [ "zksync_state", "zksync_storage", "zksync_system_constants", - "zksync_test_account", + "zksync_test_contracts", "zksync_types", "zksync_utils", "zksync_vm_executor", @@ -11191,7 +11191,7 @@ dependencies = [ ] [[package]] -name = "zksync_test_account" +name = "zksync_test_contracts" version = "0.1.0" dependencies = [ "ethabi", @@ -11375,7 +11375,7 @@ dependencies = [ "zksync_prover_interface", "zksync_state", "zksync_storage", - "zksync_test_account", + "zksync_test_contracts", "zksync_types", "zksync_utils", "zksync_vm_executor", diff --git a/Cargo.toml b/Cargo.toml index 691341f71ba..a4008a5fc79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,8 +76,8 @@ members = [ "core/lib/snapshots_applier", "core/lib/crypto_primitives", "core/lib/external_price_api", + "core/lib/test_contracts", # Test infrastructure - "core/tests/test_account", "core/tests/loadnext", "core/tests/vm-benchmark", ] @@ -273,7 +273,7 @@ zksync_state = { version = "0.1.0", path = "core/lib/state" } zksync_storage = { version = "0.1.0", path = "core/lib/storage" } zksync_system_constants = { version = "0.1.0", path = "core/lib/constants" } zksync_tee_verifier = { version = "0.1.0", path = "core/lib/tee_verifier" } -zksync_test_account = { version = "0.1.0", path = "core/tests/test_account" } +zksync_test_contracts = { version = "0.1.0", path = "core/lib/test_contracts" } zksync_types = { version = "0.1.0", path = "core/lib/types" } zksync_utils = { version = "0.1.0", path = "core/lib/utils" } zksync_web3_decl = { version = "0.1.0", path = "core/lib/web3_decl" } diff --git a/core/lib/dal/Cargo.toml b/core/lib/dal/Cargo.toml index ccca49525e4..6ad227348f9 100644 --- a/core/lib/dal/Cargo.toml +++ b/core/lib/dal/Cargo.toml @@ -53,7 +53,7 @@ tracing.workspace = true chrono = { workspace = true, features = ["serde"] } [dev-dependencies] -zksync_test_account.workspace = true +zksync_test_contracts.workspace = true zksync_concurrency.workspace = true [build-dependencies] diff --git a/core/lib/dal/src/consensus/tests.rs b/core/lib/dal/src/consensus/tests.rs index 7059f1a74ea..d98f491e606 100644 --- a/core/lib/dal/src/consensus/tests.rs +++ b/core/lib/dal/src/consensus/tests.rs @@ -7,7 +7,7 @@ use zksync_protobuf::{ testonly::{test_encode, test_encode_random}, ProtoRepr, }; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{ web3::Bytes, Execute, ExecuteTransactionCommon, L1BatchNumber, ProtocolVersionId, Transaction, }; diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index 7d604157d1a..6e11f47711e 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -41,6 +41,6 @@ vise.workspace = true [dev-dependencies] assert_matches.workspace = true pretty_assertions.workspace = true -zksync_test_account.workspace = true +zksync_test_contracts.workspace = true ethabi.workspace = true zksync_eth_signer.workspace = true diff --git a/core/lib/multivm/src/versions/testonly.rs b/core/lib/multivm/src/versions/testonly.rs index 51a4d0842d9..f1942a8655a 100644 --- a/core/lib/multivm/src/versions/testonly.rs +++ b/core/lib/multivm/src/versions/testonly.rs @@ -1,5 +1,5 @@ use zksync_contracts::BaseSystemContracts; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{ block::L2BlockHasher, fee_model::BatchFeeInput, get_code_key, get_is_account_key, helpers::unix_timestamp_ms, utils::storage_key_for_eth_balance, Address, L1BatchNumber, diff --git a/core/lib/multivm/src/versions/tests.rs b/core/lib/multivm/src/versions/tests.rs index d1984ee3159..0a62fc52613 100644 --- a/core/lib/multivm/src/versions/tests.rs +++ b/core/lib/multivm/src/versions/tests.rs @@ -2,7 +2,7 @@ //! these tests are placed here. use assert_matches::assert_matches; -use zksync_test_account::{Account, LoadnextContractExecutionParams, TestContract, TxType}; +use zksync_test_contracts::{Account, LoadnextContractExecutionParams, TestContract, TxType}; use zksync_types::{ block::L2BlockHasher, fee::Fee, AccountTreeId, Address, Execute, L1BatchNumber, L2BlockNumber, ProtocolVersionId, StorageKey, H256, U256, diff --git a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs index 0ad17e02c3f..21e0256037d 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs @@ -6,7 +6,7 @@ use zksync_contracts::load_sys_contract; use zksync_system_constants::{ CONTRACT_FORCE_DEPLOYER_ADDRESS, KNOWN_CODES_STORAGE_ADDRESS, L1_MESSENGER_ADDRESS, }; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ commitment::SerializeCommitment, fee_model::BatchFeeInput, get_code_key, l2_to_l1_log::L2ToL1Log, writes::StateDiffRecord, Address, Execute, H256, U256, diff --git a/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs b/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs index 31fba8be449..a9c3bdf2877 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use super::tester::{DeployContractsTx, TxType, VmTesterBuilder}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs index d24c1dfd3d1..7363c7b3458 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs @@ -1,5 +1,5 @@ use ethabi::Token; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ get_known_code_key, web3::keccak256, Address, Execute, StorageLogWithPreviousValue, U256, }; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/default_aa.rs b/core/lib/multivm/src/versions/vm_fast/tests/default_aa.rs index 04259c68732..8bbca77c4ca 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/default_aa.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/default_aa.rs @@ -1,5 +1,5 @@ use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ get_code_key, get_known_code_key, get_nonce_key, system_contracts::{DEPLOYMENT_NONCE_INCREMENT, TX_NONCE_INCREMENT}, diff --git a/core/lib/multivm/src/versions/vm_fast/tests/gas_limit.rs b/core/lib/multivm/src/versions/vm_fast/tests/gas_limit.rs index 3f0a47b980e..0a231be235a 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/gas_limit.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/gas_limit.rs @@ -1,4 +1,4 @@ -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{fee::Fee, Execute}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs index 9192f57f461..681b60db2f1 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs @@ -5,7 +5,7 @@ use ethabi::Token; use itertools::Itertools; use zk_evm_1_3_1::zkevm_opcode_defs::decoding::{EncodingModeProduction, VmEncodingMode}; use zksync_system_constants::CONTRACT_DEPLOYER_ADDRESS; -use zksync_test_account::{Account, TestContract}; +use zksync_test_contracts::{Account, TestContract}; use zksync_types::{AccountTreeId, Address, Execute, StorageKey, H256, U256}; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs b/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs index e83cebe2445..c68857e927b 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::get_nonce_key; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs b/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs index 6aa4ad439bd..cfa29b782ac 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs @@ -1,7 +1,7 @@ use ethabi::Token; use zksync_contracts::l1_messenger_contract; use zksync_system_constants::{BOOTLOADER_ADDRESS, L1_MESSENGER_ADDRESS}; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ get_code_key, get_known_code_key, l2_to_l1_log::{L2ToL1Log, UserL2ToL1Log}, diff --git a/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs b/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs index f76b9f8dd17..a7180ae2355 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Execute, ExecuteTransactionCommon, Nonce}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs index 8724e96dc5e..84be0696c79 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs @@ -1,5 +1,5 @@ use circuit_sequencer_api_1_5_0::geometry_config::get_geometry_config; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute}; use super::tester::VmTesterBuilder; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/prestate_tracer.rs b/core/lib/multivm/src/versions/vm_fast/tests/prestate_tracer.rs index 63620c7d9ff..7cc1df822df 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/prestate_tracer.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/prestate_tracer.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use once_cell::sync::OnceCell; -use zksync_test_account::TxType; +use zksync_test_contracts::TxType; use zksync_types::{utils::deployed_address_create, Execute, U256}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs b/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs index 56935999469..4f3e16a4d7c 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs @@ -1,5 +1,5 @@ use ethabi::Token; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute, U256}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs index 7b1c025110e..767d4fff6fa 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs @@ -1,7 +1,7 @@ use ethabi::Token; use zksync_eth_signer::TransactionParameters; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ fee::Fee, l2::L2Tx, transaction_request::TransactionRequest, utils::storage_key_for_standard_token_balance, AccountTreeId, Address, Eip712Domain, Execute, diff --git a/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs index 39761fae26c..234ee537f4e 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs @@ -1,6 +1,6 @@ use assert_matches::assert_matches; use ethabi::Token; -use zksync_test_account::{LoadnextContractExecutionParams, TestContract}; +use zksync_test_contracts::{LoadnextContractExecutionParams, TestContract}; use zksync_types::{Address, Execute, U256}; use zksync_vm_interface::VmInterfaceExt; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/storage.rs b/core/lib/multivm/src/versions/vm_fast/tests/storage.rs index 147778fc476..d4cc91dd41e 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/storage.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/storage.rs @@ -1,5 +1,5 @@ use ethabi::Token; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute, U256}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tester/mod.rs b/core/lib/multivm/src/versions/vm_fast/tests/tester/mod.rs index 212e569d510..cef447b28f5 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tester/mod.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tester/mod.rs @@ -1,6 +1,6 @@ pub(crate) use transaction_test_info::{ExpectedError, TransactionTestInfo, TxModifier}; pub(crate) use vm_tester::{get_empty_storage, VmTester, VmTesterBuilder}; -pub(crate) use zksync_test_account::{Account, DeployContractsTx, TxType}; +pub(crate) use zksync_test_contracts::{Account, DeployContractsTx, TxType}; mod transaction_test_info; mod vm_tester; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tester/vm_tester.rs b/core/lib/multivm/src/versions/vm_fast/tests/tester/vm_tester.rs index 7e05f5e3d7d..6ba0d8da75f 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tester/vm_tester.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tester/vm_tester.rs @@ -1,7 +1,7 @@ use std::{cell::RefCell, rc::Rc}; use zksync_contracts::BaseSystemContracts; -use zksync_test_account::{Account, TestContract, TxType}; +use zksync_test_contracts::{Account, TestContract, TxType}; use zksync_types::{ block::L2BlockHasher, utils::deployed_address_create, AccountTreeId, Address, L1BatchNumber, L2BlockNumber, Nonce, StorageKey, diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs index df3eb209be2..7be7ecbd218 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Execute, H160}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs index 0d2507e0332..3464b496d65 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs @@ -1,6 +1,6 @@ use ethabi::Token; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{utils::storage_key_for_eth_balance, AccountTreeId, Address, Execute, U256}; use zksync_utils::u256_to_h256; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs index 4fc7106a56c..d20850c3751 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs @@ -1,5 +1,5 @@ use zksync_contracts::{deployer_contract, load_sys_contract}; -use zksync_test_account::{TestContract, TxType}; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::{ ethabi::{Contract, Token}, get_code_key, get_known_code_key, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs index c6bdb3fb080..6230ef21674 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs @@ -7,7 +7,7 @@ use zksync_contracts::load_sys_contract; use zksync_system_constants::{ CONTRACT_FORCE_DEPLOYER_ADDRESS, KNOWN_CODES_STORAGE_ADDRESS, L1_MESSENGER_ADDRESS, }; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ commitment::SerializeCommitment, fee_model::BatchFeeInput, get_code_key, l2_to_l1_log::L2ToL1Log, writes::StateDiffRecord, Address, Execute, H256, U256, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs b/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs index 72fab95243e..5ffb65430c8 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use crate::{ interface::{TxExecutionMode, VmEvent, VmExecutionMode, VmInterface, VmInterfaceExt}, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs index 8455336dc64..c449394b098 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use once_cell::sync::OnceCell; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs index e838eb5fdd6..547a57108ee 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs @@ -3,7 +3,7 @@ use zk_evm_1_5_0::{ aux_structures::{MemoryPage, Timestamp}, zkevm_opcode_defs::{ContractCodeSha256Format, VersionedHashLen32}, }; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ get_known_code_key, web3::keccak256, Address, Execute, StorageLogWithPreviousValue, U256, }; diff --git a/core/lib/multivm/src/versions/vm_latest/tests/default_aa.rs b/core/lib/multivm/src/versions/vm_latest/tests/default_aa.rs index edc2b5c3d9c..432fa0d6e71 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/default_aa.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/default_aa.rs @@ -1,5 +1,5 @@ use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ get_code_key, get_known_code_key, get_nonce_key, system_contracts::{DEPLOYMENT_NONCE_INCREMENT, TX_NONCE_INCREMENT}, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/gas_limit.rs b/core/lib/multivm/src/versions/vm_latest/tests/gas_limit.rs index cc9aac5bb91..6fd61d98081 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/gas_limit.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/gas_limit.rs @@ -1,4 +1,4 @@ -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{fee::Fee, Execute}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs index bc4863c9276..cd558204acc 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs @@ -14,7 +14,7 @@ use zk_evm_1_5_0::{ zkevm_opcode_defs::{VersionedHashHeader, VersionedHashNormalizedPreimage}, }; use zksync_system_constants::CONTRACT_DEPLOYER_ADDRESS; -use zksync_test_account::{Account, TestContract}; +use zksync_test_contracts::{Account, TestContract}; use zksync_types::{Address, Execute, U256}; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; use zksync_vm_interface::VmExecutionResultAndLogs; diff --git a/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs b/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs index 9f3f0309ff2..093355b1a98 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::get_nonce_key; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs b/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs index 509acfe7ef1..e70faba0b3c 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs @@ -1,7 +1,7 @@ use ethabi::Token; use zksync_contracts::l1_messenger_contract; use zksync_system_constants::{BOOTLOADER_ADDRESS, L1_MESSENGER_ADDRESS}; -use zksync_test_account::{Account, TestContract}; +use zksync_test_contracts::{Account, TestContract}; use zksync_types::{ get_code_key, get_known_code_key, l2_to_l1_log::{L2ToL1Log, UserL2ToL1Log}, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/migration.rs b/core/lib/multivm/src/versions/vm_latest/tests/migration.rs index 691c91e31df..9345a07ce3e 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/migration.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/migration.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{get_code_key, H256, SYSTEM_CONTEXT_ADDRESS}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs b/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs index 2f998aca51a..bb1bc3b3476 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Execute, Nonce}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs index be03fb5bbc6..6380d34f7cc 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs @@ -1,5 +1,5 @@ use zk_evm_1_5_0::zk_evm_abstractions::precompiles::PrecompileAddress; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs index 7f1d7f0c616..8f1f6d2f3a0 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use once_cell::sync::OnceCell; -use zksync_test_account::{TestContract, TxType}; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::{utils::deployed_address_create, Execute, U256}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs b/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs index 223d64a388d..01be1eb523d 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs @@ -1,5 +1,5 @@ use ethabi::Token; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute, U256}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs index 6bf7424b2bc..0b179dd9297 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs @@ -1,7 +1,7 @@ use ethabi::Token; use zksync_eth_signer::TransactionParameters; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ fee::Fee, l2::L2Tx, transaction_request::TransactionRequest, utils::storage_key_for_standard_token_balance, AccountTreeId, Address, Eip712Domain, Execute, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs index 6d9df24fd30..cb7ccef82c8 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs @@ -1,6 +1,6 @@ use assert_matches::assert_matches; use ethabi::Token; -use zksync_test_account::{LoadnextContractExecutionParams, TestContract}; +use zksync_test_contracts::{LoadnextContractExecutionParams, TestContract}; use zksync_types::{get_nonce_key, Address, Execute, U256}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/storage.rs b/core/lib/multivm/src/versions/vm_latest/tests/storage.rs index d03c06ea85b..7474f8e19fb 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/storage.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/storage.rs @@ -1,5 +1,5 @@ use ethabi::Token; -use zksync_test_account::{Account, TestContract}; +use zksync_test_contracts::{Account, TestContract}; use zksync_types::{fee::Fee, Address, Execute, U256}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tester/mod.rs b/core/lib/multivm/src/versions/vm_latest/tests/tester/mod.rs index c3cc5d8d980..38adc7d18c8 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tester/mod.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tester/mod.rs @@ -2,7 +2,7 @@ pub(crate) use transaction_test_info::{ExpectedError, TransactionTestInfo, TxMod pub(crate) use vm_tester::{ default_l1_batch, get_empty_storage, InMemoryStorageView, VmTester, VmTesterBuilder, }; -pub(crate) use zksync_test_account::{Account, DeployContractsTx, TxType}; +pub(crate) use zksync_test_contracts::{Account, DeployContractsTx, TxType}; mod inner_state; mod transaction_test_info; diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs b/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs index b91f9f9eaf7..c19d354d2ab 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs @@ -1,7 +1,7 @@ use std::marker::PhantomData; use zksync_contracts::BaseSystemContracts; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{ block::L2BlockHasher, fee_model::BatchFeeInput, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs index 689273caab3..9b39cec3a49 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs @@ -1,4 +1,4 @@ -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Execute, H160}; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs index ad041879349..ee20f53965c 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs @@ -1,6 +1,6 @@ use ethabi::Token; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{utils::storage_key_for_eth_balance, AccountTreeId, Address, Execute, U256}; use zksync_utils::u256_to_h256; diff --git a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs index 40a322abca0..133d868f837 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs @@ -1,6 +1,6 @@ use zk_evm_1_5_0::aux_structures::Timestamp; use zksync_contracts::{deployer_contract, load_sys_contract}; -use zksync_test_account::{TestContract, TxType}; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::{ ethabi::{Contract, Token}, get_code_key, get_known_code_key, diff --git a/core/tests/test_account/Cargo.toml b/core/lib/test_contracts/Cargo.toml similarity index 84% rename from core/tests/test_account/Cargo.toml rename to core/lib/test_contracts/Cargo.toml index 4bc62b16686..d9571e3400e 100644 --- a/core/tests/test_account/Cargo.toml +++ b/core/lib/test_contracts/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "zksync_test_account" -description = "ZKsync test account for writing unit tests" +name = "zksync_test_contracts" +description = "ZKsync test contracts for writing unit tests" version.workspace = true edition.workspace = true authors.workspace = true diff --git a/core/tests/test_account/build.rs b/core/lib/test_contracts/build.rs similarity index 100% rename from core/tests/test_account/build.rs rename to core/lib/test_contracts/build.rs diff --git a/core/tests/test_account/contracts/complex-upgrade/complex-upgrade.sol b/core/lib/test_contracts/contracts/complex-upgrade/complex-upgrade.sol similarity index 100% rename from core/tests/test_account/contracts/complex-upgrade/complex-upgrade.sol rename to core/lib/test_contracts/contracts/complex-upgrade/complex-upgrade.sol diff --git a/core/tests/test_account/contracts/complex-upgrade/msg-sender.sol b/core/lib/test_contracts/contracts/complex-upgrade/msg-sender.sol similarity index 100% rename from core/tests/test_account/contracts/complex-upgrade/msg-sender.sol rename to core/lib/test_contracts/contracts/complex-upgrade/msg-sender.sol diff --git a/core/tests/test_account/contracts/context/context.sol b/core/lib/test_contracts/contracts/context/context.sol similarity index 100% rename from core/tests/test_account/contracts/context/context.sol rename to core/lib/test_contracts/contracts/context/context.sol diff --git a/core/tests/test_account/contracts/counter/counter.sol b/core/lib/test_contracts/contracts/counter/counter.sol similarity index 100% rename from core/tests/test_account/contracts/counter/counter.sol rename to core/lib/test_contracts/contracts/counter/counter.sol diff --git a/core/tests/test_account/contracts/counter/proxy_counter.sol b/core/lib/test_contracts/contracts/counter/proxy_counter.sol similarity index 100% rename from core/tests/test_account/contracts/counter/proxy_counter.sol rename to core/lib/test_contracts/contracts/counter/proxy_counter.sol diff --git a/core/tests/test_account/contracts/create/Foo.sol b/core/lib/test_contracts/contracts/create/Foo.sol similarity index 100% rename from core/tests/test_account/contracts/create/Foo.sol rename to core/lib/test_contracts/contracts/create/Foo.sol diff --git a/core/tests/test_account/contracts/create/create.sol b/core/lib/test_contracts/contracts/create/create.sol similarity index 100% rename from core/tests/test_account/contracts/create/create.sol rename to core/lib/test_contracts/contracts/create/create.sol diff --git a/core/tests/test_account/contracts/custom-account/Constants.sol b/core/lib/test_contracts/contracts/custom-account/Constants.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/Constants.sol rename to core/lib/test_contracts/contracts/custom-account/Constants.sol diff --git a/core/tests/test_account/contracts/custom-account/RLPEncoder.sol b/core/lib/test_contracts/contracts/custom-account/RLPEncoder.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/RLPEncoder.sol rename to core/lib/test_contracts/contracts/custom-account/RLPEncoder.sol diff --git a/core/tests/test_account/contracts/custom-account/SystemContext.sol b/core/lib/test_contracts/contracts/custom-account/SystemContext.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/SystemContext.sol rename to core/lib/test_contracts/contracts/custom-account/SystemContext.sol diff --git a/core/tests/test_account/contracts/custom-account/SystemContractsCaller.sol b/core/lib/test_contracts/contracts/custom-account/SystemContractsCaller.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/SystemContractsCaller.sol rename to core/lib/test_contracts/contracts/custom-account/SystemContractsCaller.sol diff --git a/core/tests/test_account/contracts/custom-account/TransactionHelper.sol b/core/lib/test_contracts/contracts/custom-account/TransactionHelper.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/TransactionHelper.sol rename to core/lib/test_contracts/contracts/custom-account/TransactionHelper.sol diff --git a/core/tests/test_account/contracts/custom-account/Utils.sol b/core/lib/test_contracts/contracts/custom-account/Utils.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/Utils.sol rename to core/lib/test_contracts/contracts/custom-account/Utils.sol diff --git a/core/tests/test_account/contracts/custom-account/custom-account.sol b/core/lib/test_contracts/contracts/custom-account/custom-account.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/custom-account.sol rename to core/lib/test_contracts/contracts/custom-account/custom-account.sol diff --git a/core/tests/test_account/contracts/custom-account/custom-paymaster.sol b/core/lib/test_contracts/contracts/custom-account/custom-paymaster.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/custom-paymaster.sol rename to core/lib/test_contracts/contracts/custom-account/custom-paymaster.sol diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IAccount.sol b/core/lib/test_contracts/contracts/custom-account/interfaces/IAccount.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/interfaces/IAccount.sol rename to core/lib/test_contracts/contracts/custom-account/interfaces/IAccount.sol diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IContractDeployer.sol b/core/lib/test_contracts/contracts/custom-account/interfaces/IContractDeployer.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/interfaces/IContractDeployer.sol rename to core/lib/test_contracts/contracts/custom-account/interfaces/IContractDeployer.sol diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IERC20.sol b/core/lib/test_contracts/contracts/custom-account/interfaces/IERC20.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/interfaces/IERC20.sol rename to core/lib/test_contracts/contracts/custom-account/interfaces/IERC20.sol diff --git a/core/tests/test_account/contracts/custom-account/interfaces/INonceHolder.sol b/core/lib/test_contracts/contracts/custom-account/interfaces/INonceHolder.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/interfaces/INonceHolder.sol rename to core/lib/test_contracts/contracts/custom-account/interfaces/INonceHolder.sol diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IPaymaster.sol b/core/lib/test_contracts/contracts/custom-account/interfaces/IPaymaster.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/interfaces/IPaymaster.sol rename to core/lib/test_contracts/contracts/custom-account/interfaces/IPaymaster.sol diff --git a/core/tests/test_account/contracts/custom-account/interfaces/IPaymasterFlow.sol b/core/lib/test_contracts/contracts/custom-account/interfaces/IPaymasterFlow.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/interfaces/IPaymasterFlow.sol rename to core/lib/test_contracts/contracts/custom-account/interfaces/IPaymasterFlow.sol diff --git a/core/tests/test_account/contracts/custom-account/many-owners-custom-account.sol b/core/lib/test_contracts/contracts/custom-account/many-owners-custom-account.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/many-owners-custom-account.sol rename to core/lib/test_contracts/contracts/custom-account/many-owners-custom-account.sol diff --git a/core/tests/test_account/contracts/custom-account/nonce-holder-test.sol b/core/lib/test_contracts/contracts/custom-account/nonce-holder-test.sol similarity index 100% rename from core/tests/test_account/contracts/custom-account/nonce-holder-test.sol rename to core/lib/test_contracts/contracts/custom-account/nonce-holder-test.sol diff --git a/core/tests/test_account/contracts/error/error.sol b/core/lib/test_contracts/contracts/error/error.sol similarity index 100% rename from core/tests/test_account/contracts/error/error.sol rename to core/lib/test_contracts/contracts/error/error.sol diff --git a/core/tests/test_account/contracts/estimator/estimator.sol b/core/lib/test_contracts/contracts/estimator/estimator.sol similarity index 100% rename from core/tests/test_account/contracts/estimator/estimator.sol rename to core/lib/test_contracts/contracts/estimator/estimator.sol diff --git a/core/tests/test_account/contracts/events/events.sol b/core/lib/test_contracts/contracts/events/events.sol similarity index 100% rename from core/tests/test_account/contracts/events/events.sol rename to core/lib/test_contracts/contracts/events/events.sol diff --git a/core/tests/test_account/contracts/events/sample-calldata b/core/lib/test_contracts/contracts/events/sample-calldata similarity index 100% rename from core/tests/test_account/contracts/events/sample-calldata rename to core/lib/test_contracts/contracts/events/sample-calldata diff --git a/core/tests/test_account/contracts/expensive/expensive.sol b/core/lib/test_contracts/contracts/expensive/expensive.sol similarity index 100% rename from core/tests/test_account/contracts/expensive/expensive.sol rename to core/lib/test_contracts/contracts/expensive/expensive.sol diff --git a/core/tests/test_account/contracts/failed-call/failed_call.sol b/core/lib/test_contracts/contracts/failed-call/failed_call.sol similarity index 100% rename from core/tests/test_account/contracts/failed-call/failed_call.sol rename to core/lib/test_contracts/contracts/failed-call/failed_call.sol diff --git a/core/tests/test_account/contracts/infinite/infinite.sol b/core/lib/test_contracts/contracts/infinite/infinite.sol similarity index 100% rename from core/tests/test_account/contracts/infinite/infinite.sol rename to core/lib/test_contracts/contracts/infinite/infinite.sol diff --git a/core/tests/test_account/contracts/loadnext/loadnext_contract.sol b/core/lib/test_contracts/contracts/loadnext/loadnext_contract.sol similarity index 100% rename from core/tests/test_account/contracts/loadnext/loadnext_contract.sol rename to core/lib/test_contracts/contracts/loadnext/loadnext_contract.sol diff --git a/core/tests/test_account/contracts/long-return-data/long-return-data.sol b/core/lib/test_contracts/contracts/long-return-data/long-return-data.sol similarity index 100% rename from core/tests/test_account/contracts/long-return-data/long-return-data.sol rename to core/lib/test_contracts/contracts/long-return-data/long-return-data.sol diff --git a/core/tests/test_account/contracts/precompiles/precompiles.sol b/core/lib/test_contracts/contracts/precompiles/precompiles.sol similarity index 100% rename from core/tests/test_account/contracts/precompiles/precompiles.sol rename to core/lib/test_contracts/contracts/precompiles/precompiles.sol diff --git a/core/tests/test_account/contracts/simple-transfer/simple-transfer.sol b/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol similarity index 100% rename from core/tests/test_account/contracts/simple-transfer/simple-transfer.sol rename to core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol diff --git a/core/tests/test_account/contracts/storage/storage.sol b/core/lib/test_contracts/contracts/storage/storage.sol similarity index 100% rename from core/tests/test_account/contracts/storage/storage.sol rename to core/lib/test_contracts/contracts/storage/storage.sol diff --git a/core/tests/test_account/contracts/transfer/transfer.sol b/core/lib/test_contracts/contracts/transfer/transfer.sol similarity index 100% rename from core/tests/test_account/contracts/transfer/transfer.sol rename to core/lib/test_contracts/contracts/transfer/transfer.sol diff --git a/core/tests/test_account/hardhat.config.ts b/core/lib/test_contracts/hardhat.config.ts similarity index 100% rename from core/tests/test_account/hardhat.config.ts rename to core/lib/test_contracts/hardhat.config.ts diff --git a/core/tests/test_account/package.json b/core/lib/test_contracts/package.json similarity index 75% rename from core/tests/test_account/package.json rename to core/lib/test_contracts/package.json index 543a982e4b7..2531a1b56b5 100644 --- a/core/tests/test_account/package.json +++ b/core/lib/test_contracts/package.json @@ -1,7 +1,8 @@ { - "name": "contracts-test-data", + "name": "@zksync/test-contracts", "version": "0.1.0", - "license": "MIT", + "private": true, + "license": "MIT OR Apache-2.0", "dependencies": { "@openzeppelin/contracts": "^4.8.0", "hardhat": "=2.22.2" diff --git a/core/tests/test_account/src/contracts.rs b/core/lib/test_contracts/src/contracts.rs similarity index 100% rename from core/tests/test_account/src/contracts.rs rename to core/lib/test_contracts/src/contracts.rs diff --git a/core/tests/test_account/src/lib.rs b/core/lib/test_contracts/src/lib.rs similarity index 100% rename from core/tests/test_account/src/lib.rs rename to core/lib/test_contracts/src/lib.rs diff --git a/core/tests/test_account/yarn.lock b/core/lib/test_contracts/yarn.lock similarity index 100% rename from core/tests/test_account/yarn.lock rename to core/lib/test_contracts/yarn.lock diff --git a/core/node/api_server/Cargo.toml b/core/node/api_server/Cargo.toml index e26147703ad..84f3ef1e629 100644 --- a/core/node/api_server/Cargo.toml +++ b/core/node/api_server/Cargo.toml @@ -59,7 +59,7 @@ lru.workspace = true zk_evm_1_5_0.workspace = true zksync_node_genesis.workspace = true zksync_node_test_utils.workspace = true -zksync_test_account.workspace = true +zksync_test_contracts.workspace = true assert_matches.workspace = true test-casing.workspace = true diff --git a/core/node/api_server/src/testonly.rs b/core/node/api_server/src/testonly.rs index 709c17570b3..8365cf97db3 100644 --- a/core/node/api_server/src/testonly.rs +++ b/core/node/api_server/src/testonly.rs @@ -8,7 +8,7 @@ use zksync_dal::{Connection, Core, CoreDal}; use zksync_multivm::utils::derive_base_fee_and_gas_per_pubdata; use zksync_node_fee_model::BatchFeeModelInputProvider; use zksync_system_constants::L2_BASE_TOKEN_ADDRESS; -use zksync_test_account::{LoadnextContractExecutionParams, TestContract}; +use zksync_test_contracts::{LoadnextContractExecutionParams, TestContract}; use zksync_types::{ api::state_override::{Bytecode, OverrideAccount, OverrideState, StateOverride}, ethabi, diff --git a/core/node/api_server/src/tx_sender/tests/mod.rs b/core/node/api_server/src/tx_sender/tests/mod.rs index dab10061448..63c6473f09b 100644 --- a/core/node/api_server/src/tx_sender/tests/mod.rs +++ b/core/node/api_server/src/tx_sender/tests/mod.rs @@ -3,7 +3,7 @@ use test_casing::TestCases; use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; use zksync_node_test_utils::{create_l2_block, prepare_recovery_snapshot}; -use zksync_test_account::LoadnextContractExecutionParams; +use zksync_test_contracts::LoadnextContractExecutionParams; use zksync_types::{get_nonce_key, L1BatchNumber, L2BlockNumber, StorageLog}; use zksync_vm_executor::oneshot::MockOneshotExecutor; diff --git a/core/node/consensus/Cargo.toml b/core/node/consensus/Cargo.toml index fdcc9089e33..7d8f52bce32 100644 --- a/core/node/consensus/Cargo.toml +++ b/core/node/consensus/Cargo.toml @@ -48,7 +48,7 @@ semver.workspace = true zksync_node_genesis.workspace = true zksync_node_test_utils.workspace = true zksync_node_api_server.workspace = true -zksync_test_account.workspace = true +zksync_test_contracts.workspace = true test-casing.workspace = true rand.workspace = true diff --git a/core/node/consensus/src/registry/testonly.rs b/core/node/consensus/src/registry/testonly.rs index 07a87e3b676..8742d9e52c6 100644 --- a/core/node/consensus/src/registry/testonly.rs +++ b/core/node/consensus/src/registry/testonly.rs @@ -1,7 +1,7 @@ use rand::Rng; use zksync_consensus_crypto::ByteFmt; use zksync_consensus_roles::{attester, validator}; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{ethabi, Execute, Transaction, U256}; use super::*; @@ -74,7 +74,7 @@ impl Registry { let tx = account.get_deploy_tx( &abi::ConsensusRegistry::bytecode(), None, - zksync_test_account::TxType::L2, + zksync_test_contracts::TxType::L2, ); (Address::new(tx.address), tx.tx) } diff --git a/core/node/consensus/src/registry/tests.rs b/core/node/consensus/src/registry/tests.rs index 935cd673891..7752d545435 100644 --- a/core/node/consensus/src/registry/tests.rs +++ b/core/node/consensus/src/registry/tests.rs @@ -1,7 +1,7 @@ use rand::Rng as _; use zksync_concurrency::{ctx, scope}; use zksync_consensus_roles::{attester, validator::testonly::Setup}; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::ProtocolVersionId; use super::*; diff --git a/core/node/consensus/src/testonly.rs b/core/node/consensus/src/testonly.rs index 04a2dfbc083..f40516672dc 100644 --- a/core/node/consensus/src/testonly.rs +++ b/core/node/consensus/src/testonly.rs @@ -40,7 +40,7 @@ use zksync_state_keeper::{ AsyncRocksdbCache, OutputHandler, StateKeeperPersistence, TreeWritesPersistence, ZkSyncStateKeeper, }; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{ ethabi, fee_model::{BatchFeeInput, L1PeggedBatchFeeModelInput}, diff --git a/core/node/consensus/src/tests/attestation.rs b/core/node/consensus/src/tests/attestation.rs index 35d849ae616..d489819a830 100644 --- a/core/node/consensus/src/tests/attestation.rs +++ b/core/node/consensus/src/tests/attestation.rs @@ -8,7 +8,7 @@ use zksync_consensus_roles::{ validator::testonly::{Setup, SetupSpec}, }; use zksync_dal::consensus_dal; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{L1BatchNumber, ProtocolVersionId}; use zksync_web3_decl::namespaces::EnNamespaceClient as _; diff --git a/core/node/consensus/src/tests/batch.rs b/core/node/consensus/src/tests/batch.rs index f0cae7f2c02..5e2a7ce3705 100644 --- a/core/node/consensus/src/tests/batch.rs +++ b/core/node/consensus/src/tests/batch.rs @@ -1,7 +1,7 @@ use test_casing::{test_casing, Product}; use zksync_concurrency::{ctx, scope}; use zksync_consensus_roles::validator; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{L1BatchNumber, ProtocolVersionId}; use super::{FROM_SNAPSHOT, VERSIONS}; diff --git a/core/node/consensus/src/tests/mod.rs b/core/node/consensus/src/tests/mod.rs index 52abe3c810c..2f8c9b4c498 100644 --- a/core/node/consensus/src/tests/mod.rs +++ b/core/node/consensus/src/tests/mod.rs @@ -11,7 +11,7 @@ use zksync_consensus_roles::{ }; use zksync_consensus_storage::BlockStore; use zksync_dal::consensus_dal; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::ProtocolVersionId; use crate::{ diff --git a/core/node/state_keeper/Cargo.toml b/core/node/state_keeper/Cargo.toml index 0e924b9f066..0721ae8ef25 100644 --- a/core/node/state_keeper/Cargo.toml +++ b/core/node/state_keeper/Cargo.toml @@ -25,7 +25,7 @@ zksync_node_fee_model.workspace = true zksync_utils.workspace = true zksync_contracts.workspace = true zksync_protobuf.workspace = true -zksync_test_account.workspace = true +zksync_test_contracts.workspace = true zksync_node_genesis.workspace = true zksync_node_test_utils.workspace = true zksync_vm_executor.workspace = true diff --git a/core/node/state_keeper/src/executor/tests/mod.rs b/core/node/state_keeper/src/executor/tests/mod.rs index 04fb016ab63..98a31ad8f3e 100644 --- a/core/node/state_keeper/src/executor/tests/mod.rs +++ b/core/node/state_keeper/src/executor/tests/mod.rs @@ -5,7 +5,7 @@ use rand::{thread_rng, Rng}; use test_casing::{test_casing, Product}; use zksync_dal::{ConnectionPool, Core}; use zksync_multivm::interface::{BatchTransactionExecutionResult, ExecutionResult, Halt}; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{ get_nonce_key, utils::storage_key_for_eth_balance, vm::FastVmMode, PriorityOpId, }; diff --git a/core/node/state_keeper/src/executor/tests/tester.rs b/core/node/state_keeper/src/executor/tests/tester.rs index 0e71a0e84d6..9073191177f 100644 --- a/core/node/state_keeper/src/executor/tests/tester.rs +++ b/core/node/state_keeper/src/executor/tests/tester.rs @@ -18,7 +18,7 @@ use zksync_multivm::{ use zksync_node_genesis::{create_genesis_l1_batch, GenesisParams}; use zksync_node_test_utils::{recover, Snapshot}; use zksync_state::{OwnedStorage, ReadStorageFactory, RocksdbStorageOptions}; -use zksync_test_account::{ +use zksync_test_contracts::{ Account, DeployContractsTx, LoadnextContractExecutionParams, TestContract, TxType, }; use zksync_types::{ diff --git a/core/node/state_keeper/src/testonly/mod.rs b/core/node/state_keeper/src/testonly/mod.rs index edcf3ccc4f5..f8f8bc53db6 100644 --- a/core/node/state_keeper/src/testonly/mod.rs +++ b/core/node/state_keeper/src/testonly/mod.rs @@ -12,7 +12,7 @@ use zksync_multivm::interface::{ SystemEnv, VmExecutionResultAndLogs, }; use zksync_state::OwnedStorage; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{ fee::Fee, utils::storage_key_for_standard_token_balance, AccountTreeId, Address, Execute, L1BatchNumber, L2BlockNumber, PriorityOpId, StorageLog, Transaction, L2_BASE_TOKEN_ADDRESS, diff --git a/core/node/vm_runner/Cargo.toml b/core/node/vm_runner/Cargo.toml index 9c235ad6b29..f6c3806008e 100644 --- a/core/node/vm_runner/Cargo.toml +++ b/core/node/vm_runner/Cargo.toml @@ -36,7 +36,7 @@ vise.workspace = true [dev-dependencies] zksync_node_test_utils.workspace = true zksync_node_genesis.workspace = true -zksync_test_account.workspace = true +zksync_test_contracts.workspace = true assert_matches.workspace = true backon.workspace = true futures = { workspace = true, features = ["compat"] } diff --git a/core/node/vm_runner/src/tests/mod.rs b/core/node/vm_runner/src/tests/mod.rs index 53bef106a8f..b846e09a85e 100644 --- a/core/node/vm_runner/src/tests/mod.rs +++ b/core/node/vm_runner/src/tests/mod.rs @@ -9,7 +9,7 @@ use zksync_node_test_utils::{ create_l1_batch_metadata, create_l2_block, execute_l2_transaction, l1_batch_metadata_to_commitment_artifacts, }; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{ block::{L1BatchHeader, L2BlockHasher}, fee::Fee, diff --git a/core/node/vm_runner/src/tests/process.rs b/core/node/vm_runner/src/tests/process.rs index 8e9bd66f3c9..cd77bca79c1 100644 --- a/core/node/vm_runner/src/tests/process.rs +++ b/core/node/vm_runner/src/tests/process.rs @@ -5,7 +5,7 @@ use test_casing::test_casing; use tokio::sync::{watch, RwLock}; use zksync_dal::{ConnectionPool, Core}; use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{L1BatchNumber, L2ChainId}; use zksync_vm_executor::batch::MainBatchExecutorFactory; diff --git a/core/node/vm_runner/src/tests/storage.rs b/core/node/vm_runner/src/tests/storage.rs index 838b469f0ef..8727eecbcd0 100644 --- a/core/node/vm_runner/src/tests/storage.rs +++ b/core/node/vm_runner/src/tests/storage.rs @@ -10,7 +10,7 @@ use tokio::{ use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; use zksync_state::{interface::ReadStorage, OwnedStorage, PostgresStorage}; -use zksync_test_account::Account; +use zksync_test_contracts::Account; use zksync_types::{AccountTreeId, L1BatchNumber, L2ChainId, StorageKey}; use crate::{ diff --git a/core/tests/loadnext/Cargo.toml b/core/tests/loadnext/Cargo.toml index 7d4cb2b8c19..13bf7294740 100644 --- a/core/tests/loadnext/Cargo.toml +++ b/core/tests/loadnext/Cargo.toml @@ -17,7 +17,7 @@ zksync_eth_signer.workspace = true zksync_web3_decl.workspace = true zksync_eth_client.workspace = true zksync_config.workspace = true -zksync_test_account.workspace = true +zksync_test_contracts.workspace = true zksync_system_constants.workspace = true zksync_vlog.workspace = true diff --git a/core/tests/loadnext/src/account/mod.rs b/core/tests/loadnext/src/account/mod.rs index dc6c205d282..967970f96fb 100644 --- a/core/tests/loadnext/src/account/mod.rs +++ b/core/tests/loadnext/src/account/mod.rs @@ -7,7 +7,7 @@ use std::{ use futures::{channel::mpsc, SinkExt}; use rand::Rng; use tokio::sync::RwLock; -use zksync_test_account::LoadnextContractExecutionParams; +use zksync_test_contracts::LoadnextContractExecutionParams; use zksync_types::{api::TransactionReceipt, Address, Nonce, H256, U256, U64}; use zksync_web3_decl::{ client::{Client, L2}, diff --git a/core/tests/loadnext/src/account_pool.rs b/core/tests/loadnext/src/account_pool.rs index 9890fbf38eb..6cc8d7f6949 100644 --- a/core/tests/loadnext/src/account_pool.rs +++ b/core/tests/loadnext/src/account_pool.rs @@ -5,7 +5,7 @@ use once_cell::sync::OnceCell; use rand::Rng; use tokio::time::timeout; use zksync_eth_signer::PrivateKeySigner; -use zksync_test_account::TestContract; +use zksync_test_contracts::TestContract; use zksync_types::{Address, K256PrivateKey, L2ChainId, H256}; use zksync_web3_decl::client::{Client, L2}; diff --git a/core/tests/loadnext/src/config.rs b/core/tests/loadnext/src/config.rs index 836dbe864bb..c05bf94df04 100644 --- a/core/tests/loadnext/src/config.rs +++ b/core/tests/loadnext/src/config.rs @@ -2,7 +2,7 @@ use std::time::Duration; use serde::Deserialize; use tokio::sync::Semaphore; -use zksync_test_account::LoadnextContractExecutionParams; +use zksync_test_contracts::LoadnextContractExecutionParams; use zksync_types::{network::Network, Address, L2ChainId, H160}; use crate::fs_utils::read_tokens; diff --git a/core/tests/vm-benchmark/Cargo.toml b/core/tests/vm-benchmark/Cargo.toml index 326311b1280..f5c9c192468 100644 --- a/core/tests/vm-benchmark/Cargo.toml +++ b/core/tests/vm-benchmark/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] zksync_contracts.workspace = true -zksync_test_account.workspace = true +zksync_test_contracts.workspace = true zksync_multivm.workspace = true zksync_types.workspace = true zksync_utils.workspace = true diff --git a/core/tests/vm-benchmark/src/transaction.rs b/core/tests/vm-benchmark/src/transaction.rs index d3053bc69ab..5a108d6aca4 100644 --- a/core/tests/vm-benchmark/src/transaction.rs +++ b/core/tests/vm-benchmark/src/transaction.rs @@ -1,7 +1,7 @@ use once_cell::sync::Lazy; use zksync_multivm::utils::get_max_gas_per_pubdata_byte; -pub use zksync_test_account::LoadnextContractExecutionParams as LoadTestParams; -use zksync_test_account::{Account, TestContract}; +pub use zksync_test_contracts::LoadnextContractExecutionParams as LoadTestParams; +use zksync_test_contracts::{Account, TestContract}; use zksync_types::{ ethabi::Token, fee::Fee, l2::L2Tx, utils::deployed_address_create, Address, Execute, K256PrivateKey, L2ChainId, Nonce, ProtocolVersionId, Transaction, H256, U256, diff --git a/core/tests/vm-benchmark/src/vm.rs b/core/tests/vm-benchmark/src/vm.rs index d3f37014438..803ea587e4b 100644 --- a/core/tests/vm-benchmark/src/vm.rs +++ b/core/tests/vm-benchmark/src/vm.rs @@ -194,7 +194,7 @@ impl BenchmarkingVm { mod tests { use assert_matches::assert_matches; use zksync_multivm::interface::ExecutionResult; - use zksync_test_account::TestContract; + use zksync_test_contracts::TestContract; use super::*; use crate::{ From 757ed67be3c6d6b91dac7c9dedc4a4dfdf97bafc Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 12:07:56 +0300 Subject: [PATCH 11/32] Remove unused contracts --- .../test_contracts/contracts/create/Foo.sol | 8 ----- .../contracts/create/create.sol | 17 ---------- .../contracts/estimator/estimator.sol | 30 ------------------ .../contracts/events/events.sol | 15 --------- .../contracts/events/sample-calldata | Bin 96 -> 0 bytes .../long-return-data/long-return-data.sol | 13 -------- 6 files changed, 83 deletions(-) delete mode 100644 core/lib/test_contracts/contracts/create/Foo.sol delete mode 100644 core/lib/test_contracts/contracts/create/create.sol delete mode 100644 core/lib/test_contracts/contracts/estimator/estimator.sol delete mode 100644 core/lib/test_contracts/contracts/events/events.sol delete mode 100644 core/lib/test_contracts/contracts/events/sample-calldata delete mode 100644 core/lib/test_contracts/contracts/long-return-data/long-return-data.sol diff --git a/core/lib/test_contracts/contracts/create/Foo.sol b/core/lib/test_contracts/contracts/create/Foo.sol deleted file mode 100644 index 1ae4868e5bf..00000000000 --- a/core/lib/test_contracts/contracts/create/Foo.sol +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.1; -pragma abicoder v2; - -contract Foo { - string public name = "Foo"; -} diff --git a/core/lib/test_contracts/contracts/create/create.sol b/core/lib/test_contracts/contracts/create/create.sol deleted file mode 100644 index ef03e7c457c..00000000000 --- a/core/lib/test_contracts/contracts/create/create.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity >=0.8.1; -pragma abicoder v2; - -// import Foo.sol from current directory -import "./Foo.sol"; - -contract Import { - // Initialize Foo.sol - Foo public foo = new Foo(); - - // Test Foo.sol by getting it's name. - function getFooName() public view returns (string memory) { - return foo.name(); - } -} \ No newline at end of file diff --git a/core/lib/test_contracts/contracts/estimator/estimator.sol b/core/lib/test_contracts/contracts/estimator/estimator.sol deleted file mode 100644 index 7fc7dfffc64..00000000000 --- a/core/lib/test_contracts/contracts/estimator/estimator.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -// This contract is used to estimate the protocol properties -// related to the fee calculation, such as block capacity -// and different operations costs. - -pragma solidity ^0.8.0; - -// Copied from `contracts/zksync/contracts/L2ContractHelper.sol`. -interface IL2Messenger { - function sendToL1(bytes memory _message) external returns (bytes32); -} - -uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15 -IL2Messenger constant L2_MESSENGER = IL2Messenger(address(SYSTEM_CONTRACTS_OFFSET + 0x08)); - -// TODO: Should be set to the actual value (SMA-1185). -// Represents the maximum amount of L2->L1 messages that can happen in one block. -uint256 constant MAX_L2_L1_MESSAGES_IN_BLOCK = 256; - -contract Estimator { - function estimateBlockCapacity() public { - // Block capacity is defined by several parameters, but the "cheapest" way to seal the block - // is to send a limited amount of messages to the L1. - // Here we're going to do just it. - for (uint256 i = 0; i < MAX_L2_L1_MESSAGES_IN_BLOCK; i++) { - L2_MESSENGER.sendToL1(bytes("")); - } - } -} diff --git a/core/lib/test_contracts/contracts/events/events.sol b/core/lib/test_contracts/contracts/events/events.sol deleted file mode 100644 index 93a451d5469..00000000000 --- a/core/lib/test_contracts/contracts/events/events.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -contract Emitter { - event Trivial(); - event Simple(uint256 Number, address Account); - event Indexed(uint256 indexed Number, address Account); - - function test(uint256 number) public { - emit Trivial(); - emit Simple(number, address(0xdeadbeef)); - emit Indexed(number, address(0xc0ffee)); - } -} diff --git a/core/lib/test_contracts/contracts/events/sample-calldata b/core/lib/test_contracts/contracts/events/sample-calldata deleted file mode 100644 index c137101ba026010f41d872325c4d53eab9d99a27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 UcmY#kARn;Lf2oO2HzQCI07%#Y-T(jq diff --git a/core/lib/test_contracts/contracts/long-return-data/long-return-data.sol b/core/lib/test_contracts/contracts/long-return-data/long-return-data.sol deleted file mode 100644 index 793bf191cbd..00000000000 --- a/core/lib/test_contracts/contracts/long-return-data/long-return-data.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.0; - -contract LongReturnData{ - function longReturnData() external returns (bool, bytes memory) { - // do some recursion, let's have more layers - (bool success, bytes memory _tmp) = this.longReturnData{gas: 79500000}(); - require(success == false); // they should fail by design - assembly { - return(0, 0xffffffffffffffff) - } - } -} From e93f3225ead7a1faed0d0f4e846c02db73f3ba6b Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 12:27:20 +0300 Subject: [PATCH 12/32] Document test contracts --- .../src/versions/vm_fast/tests/code_oracle.rs | 12 ++--- .../src/versions/vm_fast/tests/precompiles.rs | 4 +- .../vm_fast/tests/tracing_execution_error.rs | 4 +- .../versions/vm_latest/tests/code_oracle.rs | 12 ++--- .../versions/vm_latest/tests/precompiles.rs | 4 +- .../tests/tracing_execution_error.rs | 4 +- core/lib/test_contracts/README.md | 7 +++ core/lib/test_contracts/src/contracts.rs | 46 +++++++++++++++---- core/node/api_server/src/testonly.rs | 2 +- 9 files changed, 64 insertions(+), 31 deletions(-) create mode 100644 core/lib/test_contracts/README.md diff --git a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs index 7363c7b3458..09e2fe4572e 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs @@ -22,7 +22,7 @@ fn generate_large_bytecode() -> Vec { #[test] fn test_code_oracle() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = TestContract::precompiles().bytecode.clone(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.clone(); // Filling the zkevm bytecode let normal_zkevm_bytecode = &TestContract::counter().bytecode; @@ -47,7 +47,7 @@ fn test_code_oracle() { .with_storage(storage) .build(); - let precompile_contract = &TestContract::precompiles().abi; + let precompile_contract = &TestContract::precompiles_test().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); vm.vm.insert_bytecodes([normal_zkevm_bytecode.as_slice()]); @@ -114,7 +114,7 @@ fn find_code_oracle_cost_log( #[test] fn test_code_oracle_big_bytecode() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = TestContract::precompiles().bytecode.clone(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.clone(); let big_zkevm_bytecode = generate_large_bytecode(); let big_zkevm_bytecode_hash = hash_bytecode(&big_zkevm_bytecode); @@ -139,7 +139,7 @@ fn test_code_oracle_big_bytecode() { .with_storage(storage) .build(); - let precompile_contract = &TestContract::precompiles().abi; + let precompile_contract = &TestContract::precompiles_test().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); vm.vm.insert_bytecodes([big_zkevm_bytecode.as_slice()]); @@ -183,7 +183,7 @@ fn refunds_in_code_oracle() { u256_to_h256(U256::one()), ); - let precompile_contract = &TestContract::precompiles().abi; + let precompile_contract = &TestContract::precompiles_test().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); // Execute code oracle twice with identical VM state that only differs in that the queried bytecode @@ -195,7 +195,7 @@ fn refunds_in_code_oracle() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![ContractToDeploy::new( - TestContract::precompiles().bytecode.clone(), + TestContract::precompiles_test().bytecode.clone(), precompiles_contract_address, )]) .with_storage(storage.clone()) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs index 84be0696c79..8a341965681 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs @@ -12,7 +12,7 @@ use crate::{ #[test] fn test_keccak() { // Execute special transaction and check that at least 1000 keccak calls were made. - let contract = TestContract::precompiles().bytecode.clone(); + let contract = TestContract::precompiles_test().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() @@ -50,7 +50,7 @@ fn test_keccak() { #[test] fn test_sha256() { // Execute special transaction and check that at least 1000 `sha256` calls were made. - let contract = TestContract::precompiles().bytecode.clone(); + let contract = TestContract::precompiles_test().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs index 7be7ecbd218..5b5c4da634a 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs @@ -13,7 +13,7 @@ use crate::{ #[test] fn test_tracing_of_execution_errors() { let contract_address = H160::random(); - let bytecode = TestContract::require().bytecode.clone(); + let bytecode = TestContract::reverts_test().bytecode.clone(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_base_system_smart_contracts(BASE_SYSTEM_CONTRACTS.clone()) @@ -24,7 +24,7 @@ fn test_tracing_of_execution_errors() { .build(); let account = &mut vm.rich_accounts[0]; - let require_fn = TestContract::require() + let require_fn = TestContract::reverts_test() .abi .function("require_short") .unwrap(); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs index 547a57108ee..39abda34d23 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs @@ -25,7 +25,7 @@ fn generate_large_bytecode() -> Vec { #[test] fn test_code_oracle() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = TestContract::precompiles().bytecode.clone(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.clone(); // Filling the zkevm bytecode let normal_zkevm_bytecode = &TestContract::counter().bytecode; @@ -51,7 +51,7 @@ fn test_code_oracle() { .with_storage(storage) .build(); - let precompile_contract = &TestContract::precompiles().abi; + let precompile_contract = &TestContract::precompiles_test().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); vm.vm.state.decommittment_processor.populate( @@ -125,7 +125,7 @@ fn find_code_oracle_cost_log( #[test] fn test_code_oracle_big_bytecode() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = TestContract::precompiles().bytecode.clone(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.clone(); let big_zkevm_bytecode = generate_large_bytecode(); let big_zkevm_bytecode_hash = hash_bytecode(&big_zkevm_bytecode); @@ -151,7 +151,7 @@ fn test_code_oracle_big_bytecode() { .with_storage(storage) .build(); - let precompile_contract = &TestContract::precompiles().abi; + let precompile_contract = &TestContract::precompiles_test().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); vm.vm.state.decommittment_processor.populate( @@ -199,7 +199,7 @@ fn refunds_in_code_oracle() { u256_to_h256(U256::one()), ); - let precompile_contract = &TestContract::precompiles().abi; + let precompile_contract = &TestContract::precompiles_test().abi; let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); // Execute code oracle twice with identical VM state that only differs in that the queried bytecode @@ -211,7 +211,7 @@ fn refunds_in_code_oracle() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![( - TestContract::precompiles().bytecode.clone(), + TestContract::precompiles_test().bytecode.clone(), precompiles_contract_address, false, )]) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs index 6380d34f7cc..3384c185f8f 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs @@ -12,7 +12,7 @@ use crate::{ #[test] fn test_keccak() { // Execute special transaction and check that at least 1000 keccak calls were made. - let contract = TestContract::precompiles().bytecode.clone(); + let contract = TestContract::precompiles_test().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() @@ -58,7 +58,7 @@ fn test_keccak() { #[test] fn test_sha256() { // Execute special transaction and check that at least 1000 `sha256` calls were made. - let contract = TestContract::precompiles().bytecode.clone(); + let contract = TestContract::precompiles_test().bytecode.clone(); let address = Address::random(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs index 9b39cec3a49..eda85fe2b50 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs @@ -15,7 +15,7 @@ use crate::{ #[test] fn test_tracing_of_execution_errors() { let contract_address = H160::random(); - let bytecode = TestContract::require().bytecode.clone(); + let bytecode = TestContract::reverts_test().bytecode.clone(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() .with_base_system_smart_contracts(BASE_SYSTEM_CONTRACTS.clone()) @@ -26,7 +26,7 @@ fn test_tracing_of_execution_errors() { .build(); let account = &mut vm.rich_accounts[0]; - let require_fn = TestContract::require() + let require_fn = TestContract::reverts_test() .abi .function("require_short") .unwrap(); diff --git a/core/lib/test_contracts/README.md b/core/lib/test_contracts/README.md new file mode 100644 index 00000000000..adf2810d2ff --- /dev/null +++ b/core/lib/test_contracts/README.md @@ -0,0 +1,7 @@ +# ZKsync Era Test Contracts + +This library exposes contracts used in ZKsync Era codebase for unit testing. + +## Building + +Building the library requires `yarn` installed globally. diff --git a/core/lib/test_contracts/src/contracts.rs b/core/lib/test_contracts/src/contracts.rs index 4f158a251cd..c85bc1a0099 100644 --- a/core/lib/test_contracts/src/contracts.rs +++ b/core/lib/test_contracts/src/contracts.rs @@ -39,16 +39,21 @@ const SIMPLE_TRANSFER_CONTRACT: &str = include_contract!("simple-transfer/simple-transfer"::SimpleTransfer); const REENTRANT_RECIPIENT_CONTRACT: &str = include_contract!("transfer/transfer"::ReentrantRecipient); -const REQUIRE_CONTRACT: &str = include_contract!("error/error"::SimpleRequire); +const REVERTS_TEST_CONTRACT: &str = include_contract!("error/error"::SimpleRequire); const STORAGE_TEST_CONTRACT: &str = include_contract!("storage/storage"::StorageTester); const TRANSFER_RECIPIENT_CONTRACT: &str = include_contract!("transfer/transfer"::Recipient); const TRANSFER_TEST_CONTRACT: &str = include_contract!("transfer/transfer"::TransferTest); +/// Test contract consisting of deployable EraVM bytecode and Web3 ABI. #[derive(Debug, Clone)] +#[non_exhaustive] pub struct TestContract { + /// Web3 ABI of this contract. pub abi: ethabi::Contract, + /// EraVM bytecode of this contract. pub bytecode: Vec, - pub deployed: Vec, + /// Contract dependencies (i.e., potential factory deps to be included in the contract deployment / transactions). + pub dependencies: Vec, } impl TestContract { @@ -68,35 +73,41 @@ impl TestContract { Self { abi, bytecode, - deployed: vec![], + dependencies: vec![], } } + /// Returns a contract used to test complex system contract upgrades. pub fn complex_upgrade() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(COMPLEX_UPGRADE_CONTRACT)); &CONTRACT } - pub fn context() -> &'static Self { + /// Returns a contract used to test context methods. + pub fn context_test() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(CONTEXT_CONTRACT)); &CONTRACT } + /// Returns a simple counter contract. pub fn counter() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(COUNTER_CONTRACT)); &CONTRACT } + /// Returns a contract used in load testing that emulates various kinds of expensive operations + /// (storage reads / writes, hashing, recursion via far calls etc.). pub fn load_test() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| { let mut contract = TestContract::new(LOAD_TEST_CONTRACT); - contract.deployed = vec![TestContract::new(LOAD_TEST_DEPLOYED_CONTRACT)]; + contract.dependencies = vec![TestContract::new(LOAD_TEST_DEPLOYED_CONTRACT)]; contract }); &CONTRACT } + /// Returns a contract with expensive storage operations. pub fn expensive() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(EXPENSIVE_CONTRACT)); &CONTRACT @@ -107,17 +118,20 @@ impl TestContract { &CONTRACT } + /// Returns a contract with an infinite loop (useful for testing out-of-gas reverts). pub fn infinite_loop() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(INFINITE_LOOP_CONTRACT)); &CONTRACT } + /// Returns a custom account with multiple owners. pub fn many_owners() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(MANY_OWNERS_CONTRACT)); &CONTRACT } + /// Returns a contract testing `msg.sender` value. pub fn msg_sender_test() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(MSG_SENDER_TEST_CONTRACT)); @@ -130,52 +144,62 @@ impl TestContract { &CONTRACT } - pub fn precompiles() -> &'static Self { + /// Returns a contract testing precompiles. + pub fn precompiles_test() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(PRECOMPILES_CONTRACT)); &CONTRACT } + /// Returns a contract proxying calls to a [counter](Self::counter()). pub fn proxy_counter() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(PROXY_COUNTER_CONTRACT)); &CONTRACT } + /// Returns a reentrant recipient for transfers. pub fn reentrant_recipient() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(REENTRANT_RECIPIENT_CONTRACT)); &CONTRACT } - pub fn require() -> &'static Self { - static CONTRACT: Lazy = Lazy::new(|| TestContract::new(REQUIRE_CONTRACT)); + /// Returns a contract testing reverts. + pub fn reverts_test() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(REVERTS_TEST_CONTRACT)); &CONTRACT } + /// Returns a simple fungible token contract. pub fn simple_transfer() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(SIMPLE_TRANSFER_CONTRACT)); &CONTRACT } + /// Returns a contract testing storage operations. pub fn storage_test() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(STORAGE_TEST_CONTRACT)); &CONTRACT } + /// Returns a contract for testing base token transfers. pub fn transfer_test() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(TRANSFER_TEST_CONTRACT)); &CONTRACT } + /// Returns a test recipient for the [transfer test](Self::transfer_test()) contract. pub fn transfer_recipient() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| TestContract::new(TRANSFER_RECIPIENT_CONTRACT)); &CONTRACT } + /// Returns all factory deps for this contract deployment (including its own bytecode). pub fn factory_deps(&self) -> Vec> { let mut deps = vec![]; self.insert_factory_deps(&mut deps); @@ -183,16 +207,18 @@ impl TestContract { } fn insert_factory_deps(&self, dest: &mut Vec>) { - for deployed in &self.deployed { + for deployed in &self.dependencies { dest.push(deployed.bytecode.clone()); deployed.insert_factory_deps(dest); } } + /// Generates the `Execute` payload for deploying this contract with zero salt. pub fn deploy_payload(&self, args: &[Token]) -> Execute { self.deploy_payload_with_salt(H256::zero(), args) } + /// Generates the `Execute` payload for deploying this contract with custom salt. pub fn deploy_payload_with_salt(&self, salt: H256, args: &[Token]) -> Execute { let mut execute = Execute::for_deploy(salt, self.bytecode.clone(), args); execute.factory_deps.extend(self.factory_deps()); @@ -262,7 +288,7 @@ mod tests { #[test] fn contracts_are_initialized_correctly() { TestContract::counter().abi.function("get").unwrap(); - TestContract::context() + TestContract::context_test() .abi .function("getBlockNumber") .unwrap(); diff --git a/core/node/api_server/src/testonly.rs b/core/node/api_server/src/testonly.rs index 8365cf97db3..fa2616f9ac6 100644 --- a/core/node/api_server/src/testonly.rs +++ b/core/node/api_server/src/testonly.rs @@ -412,7 +412,7 @@ impl TestAccount for K256PrivateKey { } fn create_code_oracle_tx(&self, bytecode_hash: H256, expected_keccak_hash: H256) -> L2Tx { - let calldata = TestContract::precompiles() + let calldata = TestContract::precompiles_test() .abi .function("callCodeOracle") .expect("no `callCodeOracle` function") From 118a698084ed3dfa1a77b4520ba280f868fc0957 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 4 Oct 2024 12:51:11 +0300 Subject: [PATCH 13/32] Restore transient store / code oracle tests --- .../contracts/storage/storage.sol | 4 +- .../state_keeper/src/executor/tests/mod.rs | 71 +++++++++++-- .../state_keeper/src/executor/tests/tester.rs | 100 ++++++++++++++++-- 3 files changed, 156 insertions(+), 19 deletions(-) diff --git a/core/lib/test_contracts/contracts/storage/storage.sol b/core/lib/test_contracts/contracts/storage/storage.sol index 2f386f5c732..f1c629aeb2c 100644 --- a/core/lib/test_contracts/contracts/storage/storage.sol +++ b/core/lib/test_contracts/contracts/storage/storage.sol @@ -37,7 +37,7 @@ contract StorageTester { } // This test aims to check that the tstore/sstore are writing into separate spaces. - function testTrasientAndNonTransientStore() external { + function testTransientAndNonTransientStore() external { value = 100; uint256 x; @@ -95,7 +95,7 @@ contract StorageTester { } function testTransientStore() external { - this.testTrasientAndNonTransientStore(); + this.testTransientAndNonTransientStore(); this.testTstoreRollback(); } diff --git a/core/node/state_keeper/src/executor/tests/mod.rs b/core/node/state_keeper/src/executor/tests/mod.rs index 98a31ad8f3e..141c5ffb884 100644 --- a/core/node/state_keeper/src/executor/tests/mod.rs +++ b/core/node/state_keeper/src/executor/tests/mod.rs @@ -5,14 +5,12 @@ use rand::{thread_rng, Rng}; use test_casing::{test_casing, Product}; use zksync_dal::{ConnectionPool, Core}; use zksync_multivm::interface::{BatchTransactionExecutionResult, ExecutionResult, Halt}; -use zksync_test_contracts::Account; +use zksync_test_contracts::{Account, TestContract}; use zksync_types::{ - get_nonce_key, utils::storage_key_for_eth_balance, vm::FastVmMode, PriorityOpId, + get_nonce_key, utils::storage_key_for_eth_balance, vm::FastVmMode, web3, PriorityOpId, H256, }; -use self::tester::{ - AccountFailedCall, AccountLoadNextExecutable, StorageSnapshot, TestConfig, Tester, -}; +use self::tester::{AccountExt, StorageSnapshot, TestConfig, Tester}; mod read_storage_factory; mod tester; @@ -26,6 +24,11 @@ fn assert_executed(execution_result: &BatchTransactionExecutionResult) { ); } +fn assert_succeeded(execution_result: &BatchTransactionExecutionResult) { + let result = &execution_result.tx_result.result; + assert_matches!(result, ExecutionResult::Success { .. }) +} + /// Ensures that the transaction was rejected by the VM. fn assert_rejected(execution_result: &BatchTransactionExecutionResult) { let result = &execution_result.tx_result.result; @@ -173,6 +176,62 @@ async fn execute_l2_and_l1_txs(vm_mode: FastVmMode) { executor.finish_batch().await.unwrap(); } +#[tokio::test] +async fn working_with_transient_storage() { + let connection_pool = ConnectionPool::::constrained_test_pool(1).await; + let mut alice = Account::random(); + + let mut tester = Tester::new(connection_pool, FastVmMode::Shadow); + tester.genesis().await; + tester.fund(&[alice.address()]).await; + let mut executor = tester + .create_batch_executor(StorageType::AsyncRocksdbCache) + .await; + + let deploy_tx = alice.deploy_storage_tester(); + let res = executor.execute_tx(deploy_tx.tx).await.unwrap(); + assert_succeeded(&res); + + let storage_test_address = deploy_tx.address; + let test_tx = alice.test_transient_store(storage_test_address); + let res = executor.execute_tx(test_tx).await.unwrap(); + assert_succeeded(&res); + + let test_tx = alice.assert_transient_value(storage_test_address, 0.into()); + let res = executor.execute_tx(test_tx).await.unwrap(); + assert_succeeded(&res); + + executor.finish_batch().await.unwrap(); +} + +#[tokio::test] +async fn decommitting_contract() { + let connection_pool = ConnectionPool::::constrained_test_pool(1).await; + let mut alice = Account::random(); + + let mut tester = Tester::new(connection_pool, FastVmMode::Shadow); + tester.genesis().await; + tester.fund(&[alice.address()]).await; + let mut executor = tester + .create_batch_executor(StorageType::AsyncRocksdbCache) + .await; + + let deploy_tx = alice.deploy_precompiles_test(); + let res = executor.execute_tx(deploy_tx.tx).await.unwrap(); + assert_succeeded(&res); + + let keccak_bytecode_hash = web3::keccak256(&TestContract::precompiles_test().bytecode); + let test_tx = alice.test_decommit( + deploy_tx.address, + deploy_tx.bytecode_hash, + H256(keccak_bytecode_hash), + ); + let res = executor.execute_tx(test_tx).await.unwrap(); + assert_succeeded(&res); + + executor.finish_batch().await.unwrap(); +} + /// Checks that we can successfully rollback the transaction and execute it once again. #[test_casing(3, FAST_VM_MODES)] #[tokio::test] @@ -316,7 +375,7 @@ async fn deploy_failedcall(vm_mode: FastVmMode) { .create_batch_executor(StorageType::AsyncRocksdbCache) .await; - let tx = alice.deploy_failedcall_tx(); + let tx = alice.deploy_failed_call_tx(); let execute_tx = executor.execute_tx(tx.tx).await.unwrap(); assert_executed(&execute_tx); diff --git a/core/node/state_keeper/src/executor/tests/tester.rs b/core/node/state_keeper/src/executor/tests/tester.rs index 9073191177f..e9b75feab83 100644 --- a/core/node/state_keeper/src/executor/tests/tester.rs +++ b/core/node/state_keeper/src/executor/tests/tester.rs @@ -315,7 +315,7 @@ impl Tester { } } -pub trait AccountLoadNextExecutable { +pub(super) trait AccountExt { fn deploy_loadnext_tx(&mut self) -> DeployContractsTx; fn l1_execute(&mut self, serial_id: PriorityOpId) -> Transaction; @@ -342,19 +342,26 @@ pub trait AccountLoadNextExecutable { gas_to_burn: u32, gas_limit: u32, ) -> Transaction; -} -pub trait AccountFailedCall { - fn deploy_failedcall_tx(&mut self) -> DeployContractsTx; -} + fn deploy_failed_call_tx(&mut self) -> DeployContractsTx; -impl AccountFailedCall for Account { - fn deploy_failedcall_tx(&mut self) -> DeployContractsTx { - self.get_deploy_tx(&TestContract::failed_call().bytecode, None, TxType::L2) - } + fn deploy_storage_tester(&mut self) -> DeployContractsTx; + + fn test_transient_store(&mut self, address: Address) -> Transaction; + + fn assert_transient_value(&mut self, address: Address, expected: U256) -> Transaction; + + fn deploy_precompiles_test(&mut self) -> DeployContractsTx; + + fn test_decommit( + &mut self, + address: Address, + bytecode_hash: H256, + expected_keccak_hash: H256, + ) -> Transaction; } -impl AccountLoadNextExecutable for Account { +impl AccountExt for Account { fn deploy_loadnext_tx(&mut self) -> DeployContractsTx { let loadnext_contract = TestContract::load_test(); let loadnext_constructor_data = &[Token::Uint(U256::from(100))]; @@ -444,12 +451,83 @@ impl AccountLoadNextExecutable for Account { Execute { contract_address: Some(address), calldata, - value: Default::default(), + value: 0.into(), factory_deps: vec![], }, Some(fee), ) } + + fn deploy_failed_call_tx(&mut self) -> DeployContractsTx { + self.get_deploy_tx(&TestContract::failed_call().bytecode, None, TxType::L2) + } + + fn deploy_storage_tester(&mut self) -> DeployContractsTx { + self.get_deploy_tx(&TestContract::storage_test().bytecode, None, TxType::L2) + } + + fn test_transient_store(&mut self, address: Address) -> Transaction { + let test_fn = TestContract::storage_test() + .abi + .function("testTransientStore") + .unwrap(); + let calldata = test_fn.encode_input(&[]).unwrap(); + self.get_l2_tx_for_execute( + Execute { + contract_address: Some(address), + calldata, + value: 0.into(), + factory_deps: vec![], + }, + None, + ) + } + + fn assert_transient_value(&mut self, address: Address, expected: U256) -> Transaction { + let assert_fn = TestContract::storage_test() + .abi + .function("assertTValue") + .unwrap(); + let calldata = assert_fn.encode_input(&[Token::Uint(expected)]).unwrap(); + self.get_l2_tx_for_execute( + Execute { + contract_address: Some(address), + calldata, + value: 0.into(), + factory_deps: vec![], + }, + None, + ) + } + + fn deploy_precompiles_test(&mut self) -> DeployContractsTx { + self.get_deploy_tx(&TestContract::precompiles_test().bytecode, None, TxType::L2) + } + + fn test_decommit( + &mut self, + address: Address, + bytecode_hash: H256, + expected_keccak_hash: H256, + ) -> Transaction { + let assert_fn = TestContract::precompiles_test() + .abi + .function("callCodeOracle") + .unwrap(); + let calldata = assert_fn.encode_input(&[ + Token::FixedBytes(bytecode_hash.0.to_vec()), + Token::FixedBytes(expected_keccak_hash.0.to_vec()), + ]); + self.get_l2_tx_for_execute( + Execute { + contract_address: Some(address), + calldata: calldata.unwrap(), + value: 0.into(), + factory_deps: vec![], + }, + None, + ) + } } pub fn mock_loadnext_gas_burn_calldata(gas: u32) -> Vec { From f52bda7abdd1a0f853d6f5c883b849e456a017ab Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 8 Oct 2024 14:50:29 +0300 Subject: [PATCH 14/32] Add function getter shortcut --- .../src/versions/vm_fast/tests/block_tip.rs | 3 +-- .../src/versions/vm_fast/tests/code_oracle.rs | 12 +++++----- .../vm_fast/tests/get_used_contracts.rs | 10 ++------- .../src/versions/vm_fast/tests/refunds.rs | 6 ++--- .../versions/vm_fast/tests/require_eip712.rs | 5 +---- .../src/versions/vm_fast/tests/storage.rs | 17 ++++---------- .../vm_fast/tests/tracing_execution_error.rs | 5 +---- .../src/versions/vm_fast/tests/transfer.rs | 22 +++++++------------ .../src/versions/vm_fast/tests/upgrade.rs | 4 ++-- .../src/versions/vm_latest/tests/block_tip.rs | 3 +-- .../versions/vm_latest/tests/code_oracle.rs | 12 +++++----- .../vm_latest/tests/get_used_contracts.rs | 5 +---- .../src/versions/vm_latest/tests/refunds.rs | 6 ++--- .../vm_latest/tests/require_eip712.rs | 5 +---- .../src/versions/vm_latest/tests/storage.rs | 20 +++++------------ .../tests/tracing_execution_error.rs | 5 +---- .../src/versions/vm_latest/tests/transfer.rs | 21 +++++++----------- .../src/versions/vm_latest/tests/upgrade.rs | 4 ++-- core/lib/test_contracts/README.md | 3 ++- core/lib/test_contracts/src/contracts.rs | 7 ++++++ core/node/api_server/src/testonly.rs | 14 +----------- .../state_keeper/src/executor/tests/tester.rs | 17 ++++---------- 22 files changed, 70 insertions(+), 136 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs index 21e0256037d..a5826f6f44b 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs @@ -40,7 +40,7 @@ struct MimicCallInfo { const CALLS_PER_TX: usize = 1_000; fn populate_mimic_calls(data: L1MessengerTestData) -> Vec> { - let complex_upgrade = &TestContract::complex_upgrade().abi; + let complex_upgrade = TestContract::complex_upgrade(); let l1_messenger = load_sys_contract("L1Messenger"); let logs_mimic_calls = (0..data.l2_to_l1_logs).map(|_| MimicCallInfo { @@ -90,7 +90,6 @@ fn populate_mimic_calls(data: L1MessengerTestData) -> Vec> { .map(|chunk| { complex_upgrade .function("mimicCalls") - .unwrap() .encode_input(&[Token::Array(chunk.collect_vec())]) .unwrap() }) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs index 09e2fe4572e..ae82b0afea3 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs @@ -47,8 +47,8 @@ fn test_code_oracle() { .with_storage(storage) .build(); - let precompile_contract = &TestContract::precompiles_test().abi; - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); vm.vm.insert_bytecodes([normal_zkevm_bytecode.as_slice()]); let account = &mut vm.rich_accounts[0]; @@ -139,8 +139,8 @@ fn test_code_oracle_big_bytecode() { .with_storage(storage) .build(); - let precompile_contract = &TestContract::precompiles_test().abi; - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); vm.vm.insert_bytecodes([big_zkevm_bytecode.as_slice()]); @@ -183,8 +183,8 @@ fn refunds_in_code_oracle() { u256_to_h256(U256::one()), ); - let precompile_contract = &TestContract::precompiles_test().abi; - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); // Execute code oracle twice with identical VM state that only differs in that the queried bytecode // is already decommitted the second time. The second call must consume less gas (`decommit` doesn't charge additional gas diff --git a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs index 681b60db2f1..1b8ee891793 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs @@ -150,10 +150,7 @@ fn execute_proxy_counter(gas: u32) -> (VmTester<()>, ProxyCounterData, VmExecuti "{decommitted_hashes:?}" ); - let increment = TestContract::proxy_counter() - .abi - .function("increment") - .unwrap(); + let increment = TestContract::proxy_counter().function("increment"); let increment_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(deploy_tx.address), @@ -199,10 +196,7 @@ fn get_used_contracts_with_out_of_gas_far_call() { // Execute another transaction with a successful far call and check that it's still charged for decommitment. let account = &mut vm.rich_accounts[0]; - let increment = TestContract::proxy_counter() - .abi - .function("increment") - .unwrap(); + let increment = TestContract::proxy_counter().function("increment"); let increment_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(data.proxy_counter_address), diff --git a/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs b/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs index 4f3e16a4d7c..5fcdaac5ada 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs @@ -162,9 +162,9 @@ fn test_predetermined_refunded_gas() { #[test] fn negative_pubdata_for_transaction() { let expensive_contract_address = Address::random(); - let expensive_contract = &TestContract::expensive().abi; - let expensive_function = expensive_contract.function("expensive").unwrap(); - let cleanup_function = expensive_contract.function("cleanUp").unwrap(); + let expensive_contract = TestContract::expensive(); + let expensive_function = expensive_contract.function("expensive"); + let cleanup_function = expensive_contract.function("cleanUp"); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs index 767d4fff6fa..56ab7fad787 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs @@ -63,10 +63,7 @@ fn test_require_eip712() { // First, let's set the owners of the AA account to the `private_address`. // (so that messages signed by `private_address`, are authorized to act on behalf of the AA account). - let set_owners_function = TestContract::many_owners() - .abi - .function("setOwners") - .unwrap(); + let set_owners_function = TestContract::many_owners().function("setOwners"); let encoded_input = set_owners_function .encode_input(&[Token::Array(vec![Token::Address(private_account.address)])]) .unwrap(); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/storage.rs b/core/lib/multivm/src/versions/vm_fast/tests/storage.rs index d4cc91dd41e..e0ae0e47d4d 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/storage.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/storage.rs @@ -74,30 +74,23 @@ fn test_storage_one_tx(second_tx_calldata: Vec) -> u32 { #[test] fn test_storage_behavior() { - let contract = &TestContract::storage_test().abi; + let contract = TestContract::storage_test(); // In all of the tests below we provide the first tx to ensure that the tracers will not include // the statistics from the start of the bootloader and will only include those for the transaction itself. let base_pubdata = test_storage_one_tx(vec![]); - let simple_test_pubdata = test_storage_one_tx( - contract - .function("simpleWrite") - .unwrap() - .encode_input(&[]) - .unwrap(), - ); + let simple_test_pubdata = + test_storage_one_tx(contract.function("simpleWrite").encode_input(&[]).unwrap()); let resetting_write_pubdata = test_storage_one_tx( contract .function("resettingWrite") - .unwrap() .encode_input(&[]) .unwrap(), ); let resetting_write_via_revert_pubdata = test_storage_one_tx( contract .function("resettingWriteViaRevert") - .unwrap() .encode_input(&[]) .unwrap(), ); @@ -109,17 +102,15 @@ fn test_storage_behavior() { #[test] fn test_transient_storage_behavior() { - let contract = &TestContract::storage_test().abi; + let contract = TestContract::storage_test(); let first_tstore_test = contract .function("testTransientStore") - .unwrap() .encode_input(&[]) .unwrap(); // Second transaction checks that, as expected, the transient storage is cleared after the first transaction. let second_tstore_test = contract .function("assertTValue") - .unwrap() .encode_input(&[Token::Uint(U256::zero())]) .unwrap(); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs index 5b5c4da634a..c39aa99edf6 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs @@ -24,10 +24,7 @@ fn test_tracing_of_execution_errors() { .build(); let account = &mut vm.rich_accounts[0]; - let require_fn = TestContract::reverts_test() - .abi - .function("require_short") - .unwrap(); + let require_fn = TestContract::reverts_test().function("require_short"); let tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(contract_address), diff --git a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs index 3464b496d65..189ac978758 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs @@ -19,25 +19,22 @@ enum TestOptions { } fn test_send_or_transfer(test_option: TestOptions) { - let test_abi = &TestContract::transfer_test().abi; - + let test_contract = TestContract::transfer_test(); let test_contract_address = Address::random(); let recipient_address = Address::random(); let (value, calldata) = match test_option { TestOptions::Send(value) => ( value, - test_abi + test_contract .function("send") - .unwrap() .encode_input(&[Token::Address(recipient_address), Token::Uint(value)]) .unwrap(), ), TestOptions::Transfer(value) => ( value, - test_abi + test_contract .function("transfer") - .unwrap() .encode_input(&[Token::Address(recipient_address), Token::Uint(value)]) .unwrap(), ), @@ -106,17 +103,16 @@ fn test_send_and_transfer() { } fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { - let test_abi = &TestContract::transfer_test().abi; - let reentrant_recipient_abi = &TestContract::reentrant_recipient().abi; + let test_contract = TestContract::transfer_test(); + let reentrant_recipient_contract = TestContract::reentrant_recipient(); let test_contract_address = Address::random(); let reentrant_recipient_address = Address::random(); let (value, calldata) = match test_option { TestOptions::Send(value) => ( value, - test_abi + test_contract .function("send") - .unwrap() .encode_input(&[ Token::Address(reentrant_recipient_address), Token::Uint(value), @@ -125,9 +121,8 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { ), TestOptions::Transfer(value) => ( value, - test_abi + test_contract .function("transfer") - .unwrap() .encode_input(&[ Token::Address(reentrant_recipient_address), Token::Uint(value), @@ -158,9 +153,8 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { let tx1 = account.get_l2_tx_for_execute( Execute { contract_address: Some(reentrant_recipient_address), - calldata: reentrant_recipient_abi + calldata: reentrant_recipient_contract .function("setX") - .unwrap() .encode_input(&[]) .unwrap(), value: U256::from(1), diff --git a/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs index d20850c3751..37d6c890eb7 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs @@ -296,8 +296,8 @@ fn get_complex_upgrade_tx( address2: Address, bytecode_hash: H256, ) -> Transaction { - let impl_contract = &TestContract::complex_upgrade().abi; - let impl_function = impl_contract.function("someComplexUpgrade").unwrap(); + let impl_contract = TestContract::complex_upgrade(); + let impl_function = impl_contract.function("someComplexUpgrade"); let impl_calldata = impl_function .encode_input(&[ Token::Address(address1), diff --git a/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs index 6230ef21674..316ada2be66 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs @@ -46,7 +46,7 @@ struct MimicCallInfo { const CALLS_PER_TX: usize = 1_000; fn populate_mimic_calls(data: L1MessengerTestData) -> Vec> { - let complex_upgrade = &TestContract::complex_upgrade().abi; + let complex_upgrade = TestContract::complex_upgrade(); let l1_messenger = load_sys_contract("L1Messenger"); let logs_mimic_calls = (0..data.l2_to_l1_logs).map(|_| MimicCallInfo { @@ -96,7 +96,6 @@ fn populate_mimic_calls(data: L1MessengerTestData) -> Vec> { .map(|chunk| { complex_upgrade .function("mimicCalls") - .unwrap() .encode_input(&[Token::Array(chunk.collect_vec())]) .unwrap() }) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs index 39abda34d23..010ed3c6314 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs @@ -51,8 +51,8 @@ fn test_code_oracle() { .with_storage(storage) .build(); - let precompile_contract = &TestContract::precompiles_test().abi; - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); vm.vm.state.decommittment_processor.populate( vec![( @@ -151,8 +151,8 @@ fn test_code_oracle_big_bytecode() { .with_storage(storage) .build(); - let precompile_contract = &TestContract::precompiles_test().abi; - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); vm.vm.state.decommittment_processor.populate( vec![( @@ -199,8 +199,8 @@ fn refunds_in_code_oracle() { u256_to_h256(U256::one()), ); - let precompile_contract = &TestContract::precompiles_test().abi; - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); // Execute code oracle twice with identical VM state that only differs in that the queried bytecode // is already decommitted the second time. The second call must consume less gas (`decommit` doesn't charge additional gas diff --git a/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs index cd558204acc..77d469ca77c 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs @@ -204,10 +204,7 @@ fn execute_proxy_counter(gas: u32) -> (VmTester, U256, VmExecut "{decommitted_hashes:?}" ); - let increment = TestContract::proxy_counter() - .abi - .function("increment") - .unwrap(); + let increment = TestContract::proxy_counter().function("increment"); let increment_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(deploy_tx.address), diff --git a/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs b/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs index 01be1eb523d..734cdeb3e0d 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs @@ -168,9 +168,9 @@ fn test_predetermined_refunded_gas() { #[test] fn negative_pubdata_for_transaction() { let expensive_contract_address = Address::random(); - let expensive_contract = &TestContract::expensive().abi; - let expensive_function = expensive_contract.function("expensive").unwrap(); - let cleanup_function = expensive_contract.function("cleanUp").unwrap(); + let expensive_contract = TestContract::expensive(); + let expensive_function = expensive_contract.function("expensive"); + let cleanup_function = expensive_contract.function("cleanUp"); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs index 0b179dd9297..f1e8648e665 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs @@ -53,10 +53,7 @@ fn test_require_eip712() { // First, let's set the owners of the AA account to the `private_address`. // (so that messages signed by `private_address`, are authorized to act on behalf of the AA account). - let set_owners_function = TestContract::many_owners() - .abi - .function("setOwners") - .unwrap(); + let set_owners_function = TestContract::many_owners().function("setOwners"); let encoded_input = set_owners_function .encode_input(&[Token::Array(vec![Token::Address(private_account.address)])]) .unwrap(); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/storage.rs b/core/lib/multivm/src/versions/vm_latest/tests/storage.rs index 7474f8e19fb..5fb22c5eaeb 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/storage.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/storage.rs @@ -83,30 +83,23 @@ fn test_storage_one_tx(second_tx_calldata: Vec) -> u32 { #[test] fn test_storage_behavior() { - let contract = &TestContract::storage_test().abi; + let contract = TestContract::storage_test(); // In all of the tests below we provide the first tx to ensure that the tracers will not include // the statistics from the start of the bootloader and will only include those for the transaction itself. let base_pubdata = test_storage_one_tx(vec![]); - let simple_test_pubdata = test_storage_one_tx( - contract - .function("simpleWrite") - .unwrap() - .encode_input(&[]) - .unwrap(), - ); + let simple_test_pubdata = + test_storage_one_tx(contract.function("simpleWrite").encode_input(&[]).unwrap()); let resetting_write_pubdata = test_storage_one_tx( contract .function("resettingWrite") - .unwrap() .encode_input(&[]) .unwrap(), ); let resetting_write_via_revert_pubdata = test_storage_one_tx( contract .function("resettingWriteViaRevert") - .unwrap() .encode_input(&[]) .unwrap(), ); @@ -118,17 +111,15 @@ fn test_storage_behavior() { #[test] fn test_transient_storage_behavior() { - let contract = &TestContract::storage_test().abi; + let contract = TestContract::storage_test(); let first_tstore_test = contract .function("testTransientStore") - .unwrap() .encode_input(&[]) .unwrap(); // Second transaction checks that, as expected, the transient storage is cleared after the first transaction. let second_tstore_test = contract .function("assertTValue") - .unwrap() .encode_input(&[Token::Uint(U256::zero())]) .unwrap(); @@ -146,11 +137,10 @@ fn test_transient_storage_behavior() { #[test] fn test_transient_storage_behavior_panic() { - let contract = &TestContract::storage_test().abi; + let contract = TestContract::storage_test(); let basic_tstore_test = contract .function("tStoreAndRevert") - .unwrap() .encode_input(&[Token::Uint(U256::one()), Token::Bool(false)]) .unwrap(); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs index eda85fe2b50..f2c3d5f65fa 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs @@ -26,10 +26,7 @@ fn test_tracing_of_execution_errors() { .build(); let account = &mut vm.rich_accounts[0]; - let require_fn = TestContract::reverts_test() - .abi - .function("require_short") - .unwrap(); + let require_fn = TestContract::reverts_test().function("require_short"); let tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(contract_address), diff --git a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs index ee20f53965c..51a43ad0c64 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs @@ -21,24 +21,22 @@ enum TestOptions { } fn test_send_or_transfer(test_option: TestOptions) { - let test_abi = &TestContract::transfer_test().abi; + let test_contract = TestContract::transfer_test(); let test_contract_address = Address::random(); let recipient_address = Address::random(); let (value, calldata) = match test_option { TestOptions::Send(value) => ( value, - test_abi + test_contract .function("send") - .unwrap() .encode_input(&[Token::Address(recipient_address), Token::Uint(value)]) .unwrap(), ), TestOptions::Transfer(value) => ( value, - test_abi + test_contract .function("transfer") - .unwrap() .encode_input(&[Token::Address(recipient_address), Token::Uint(value)]) .unwrap(), ), @@ -108,17 +106,16 @@ fn test_send_and_transfer() { } fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { - let test_abi = &TestContract::transfer_test().abi; - let reentrant_recipient_abi = &TestContract::reentrant_recipient().abi; + let test_contract = TestContract::transfer_test(); + let reentrant_recipient_contract = TestContract::reentrant_recipient(); let test_contract_address = Address::random(); let reentrant_recipeint_address = Address::random(); let (value, calldata) = match test_option { TestOptions::Send(value) => ( value, - test_abi + test_contract .function("send") - .unwrap() .encode_input(&[ Token::Address(reentrant_recipeint_address), Token::Uint(value), @@ -127,9 +124,8 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { ), TestOptions::Transfer(value) => ( value, - test_abi + test_contract .function("transfer") - .unwrap() .encode_input(&[ Token::Address(reentrant_recipeint_address), Token::Uint(value), @@ -162,9 +158,8 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { let tx1 = account.get_l2_tx_for_execute( Execute { contract_address: Some(reentrant_recipeint_address), - calldata: reentrant_recipient_abi + calldata: reentrant_recipient_contract .function("setX") - .unwrap() .encode_input(&[]) .unwrap(), value: U256::from(1), diff --git a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs index 133d868f837..72d44b15f93 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs @@ -305,8 +305,8 @@ fn get_complex_upgrade_tx( address2: Address, bytecode_hash: H256, ) -> Transaction { - let impl_contract = &TestContract::complex_upgrade().abi; - let impl_function = impl_contract.function("someComplexUpgrade").unwrap(); + let impl_contract = TestContract::complex_upgrade(); + let impl_function = impl_contract.function("someComplexUpgrade"); let impl_calldata = impl_function .encode_input(&[ Token::Address(address1), diff --git a/core/lib/test_contracts/README.md b/core/lib/test_contracts/README.md index adf2810d2ff..9beb069832c 100644 --- a/core/lib/test_contracts/README.md +++ b/core/lib/test_contracts/README.md @@ -4,4 +4,5 @@ This library exposes contracts used in ZKsync Era codebase for unit testing. ## Building -Building the library requires `yarn` installed globally. +Building the library requires `yarn` installed globally. If there are any issues during build, it could be useful +to inspect build artifacts, which are located in one of `target/{debug,release}/build/zksync_test_contracts-$random_numbers` directories. diff --git a/core/lib/test_contracts/src/contracts.rs b/core/lib/test_contracts/src/contracts.rs index c85bc1a0099..00742420454 100644 --- a/core/lib/test_contracts/src/contracts.rs +++ b/core/lib/test_contracts/src/contracts.rs @@ -224,6 +224,13 @@ impl TestContract { execute.factory_deps.extend(self.factory_deps()); execute } + + /// Shortcut for accessing a function that panics if a function doesn't exist. + pub fn function(&self, name: &str) -> ðabi::Function { + self.abi + .function(name) + .unwrap_or_else(|err| panic!("cannot access function `{name}`: {err}")) + } } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/core/node/api_server/src/testonly.rs b/core/node/api_server/src/testonly.rs index fa2616f9ac6..85ec1d40d28 100644 --- a/core/node/api_server/src/testonly.rs +++ b/core/node/api_server/src/testonly.rs @@ -114,7 +114,7 @@ impl StateBuilder { pub fn with_precompiles_contract(self) -> Self { self.with_contract( Self::PRECOMPILES_CONTRACT_ADDRESS, - TestContract::precompiles().bytecode.clone(), + TestContract::precompiles_test().bytecode.clone(), ) } @@ -371,9 +371,7 @@ impl TestAccount for K256PrivateKey { fn create_expensive_tx(&self, write_count: usize) -> L2Tx { let calldata = TestContract::expensive() - .abi .function("expensive") - .expect("no `expensive` function in contract") .encode_input(&[Token::Uint(write_count.into())]) .expect("failed encoding `expensive` function"); L2Tx::new_signed( @@ -392,9 +390,7 @@ impl TestAccount for K256PrivateKey { fn create_expensive_cleanup_tx(&self) -> L2Tx { let calldata = TestContract::expensive() - .abi .function("cleanUp") - .expect("no `cleanUp` function in contract") .encode_input(&[]) .expect("failed encoding `cleanUp` input"); L2Tx::new_signed( @@ -413,9 +409,7 @@ impl TestAccount for K256PrivateKey { fn create_code_oracle_tx(&self, bytecode_hash: H256, expected_keccak_hash: H256) -> L2Tx { let calldata = TestContract::precompiles_test() - .abi .function("callCodeOracle") - .expect("no `callCodeOracle` function") .encode_input(&[ Token::FixedBytes(bytecode_hash.0.to_vec()), Token::FixedBytes(expected_keccak_hash.0.to_vec()), @@ -437,9 +431,7 @@ impl TestAccount for K256PrivateKey { fn create_counter_tx(&self, increment: U256, revert: bool) -> L2Tx { let calldata = TestContract::counter() - .abi .function("incrementWithRevert") - .expect("no `incrementWithRevert` function") .encode_input(&[Token::Uint(increment), Token::Bool(revert)]) .expect("failed encoding `incrementWithRevert` input"); L2Tx::new_signed( @@ -458,9 +450,7 @@ impl TestAccount for K256PrivateKey { fn query_counter_value(&self) -> CallRequest { let calldata = TestContract::counter() - .abi .function("get") - .expect("no `get` function") .encode_input(&[]) .expect("failed encoding `get` input"); CallRequest { @@ -473,9 +463,7 @@ impl TestAccount for K256PrivateKey { fn create_infinite_loop_tx(&self) -> L2Tx { let calldata = TestContract::infinite_loop() - .abi .function("infiniteLoop") - .expect("no `infiniteLoop` function") .encode_input(&[]) .expect("failed encoding `infiniteLoop` input"); L2Tx::new_signed( diff --git a/core/node/state_keeper/src/executor/tests/tester.rs b/core/node/state_keeper/src/executor/tests/tester.rs index e9b75feab83..a24e39107fd 100644 --- a/core/node/state_keeper/src/executor/tests/tester.rs +++ b/core/node/state_keeper/src/executor/tests/tester.rs @@ -467,10 +467,7 @@ impl AccountExt for Account { } fn test_transient_store(&mut self, address: Address) -> Transaction { - let test_fn = TestContract::storage_test() - .abi - .function("testTransientStore") - .unwrap(); + let test_fn = TestContract::storage_test().function("testTransientStore"); let calldata = test_fn.encode_input(&[]).unwrap(); self.get_l2_tx_for_execute( Execute { @@ -484,10 +481,7 @@ impl AccountExt for Account { } fn assert_transient_value(&mut self, address: Address, expected: U256) -> Transaction { - let assert_fn = TestContract::storage_test() - .abi - .function("assertTValue") - .unwrap(); + let assert_fn = TestContract::storage_test().function("assertTValue"); let calldata = assert_fn.encode_input(&[Token::Uint(expected)]).unwrap(); self.get_l2_tx_for_execute( Execute { @@ -510,10 +504,7 @@ impl AccountExt for Account { bytecode_hash: H256, expected_keccak_hash: H256, ) -> Transaction { - let assert_fn = TestContract::precompiles_test() - .abi - .function("callCodeOracle") - .unwrap(); + let assert_fn = TestContract::precompiles_test().function("callCodeOracle"); let calldata = assert_fn.encode_input(&[ Token::FixedBytes(bytecode_hash.0.to_vec()), Token::FixedBytes(expected_keccak_hash.0.to_vec()), @@ -531,7 +522,7 @@ impl AccountExt for Account { } pub fn mock_loadnext_gas_burn_calldata(gas: u32) -> Vec { - let contract_function = TestContract::load_test().abi.function("burnGas").unwrap(); + let contract_function = TestContract::load_test().function("burnGas"); let params = vec![Token::Uint(U256::from(gas))]; contract_function .encode_input(¶ms) From 8b420f445c37d4421f6b793fa0a4baa294176823 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 8 Oct 2024 15:00:27 +0300 Subject: [PATCH 15/32] Remove obsolete contract compilation --- .github/workflows/ci-core-reusable.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index d03e44f8bca..8cbcd46c2a7 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -128,7 +128,6 @@ jobs: --legacy-bridge ci_run zk_inception ecosystem init --dev --verbose - ci_run zk_supervisor contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server From 647a657d299aa9a90009715164fad31602b4f88d Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 8 Oct 2024 15:22:12 +0300 Subject: [PATCH 16/32] Add `typescript` dependency --- core/lib/test_contracts/package.json | 3 ++- core/lib/test_contracts/yarn.lock | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/lib/test_contracts/package.json b/core/lib/test_contracts/package.json index 2531a1b56b5..76f0c375342 100644 --- a/core/lib/test_contracts/package.json +++ b/core/lib/test_contracts/package.json @@ -5,7 +5,8 @@ "license": "MIT OR Apache-2.0", "dependencies": { "@openzeppelin/contracts": "^4.8.0", - "hardhat": "=2.22.2" + "hardhat": "=2.22.2", + "typescript": "^4.3.5" }, "devDependencies": { "@matterlabs/hardhat-zksync-solc": "^0.3.15" diff --git a/core/lib/test_contracts/yarn.lock b/core/lib/test_contracts/yarn.lock index e1febd26aa6..6c4c39fc834 100644 --- a/core/lib/test_contracts/yarn.lock +++ b/core/lib/test_contracts/yarn.lock @@ -2185,6 +2185,11 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== +typescript@^4.3.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + undici-types@~5.26.4: version "5.26.5" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" From c7711cff67bb1f29f5641eed6adfe670c264ffe1 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 8 Oct 2024 15:31:28 +0300 Subject: [PATCH 17/32] Update readmes --- core/lib/test_contracts/README.md | 8 ++++++++ core/tests/loadnext/README.md | 29 ++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/core/lib/test_contracts/README.md b/core/lib/test_contracts/README.md index 9beb069832c..4e8cb91f83f 100644 --- a/core/lib/test_contracts/README.md +++ b/core/lib/test_contracts/README.md @@ -2,6 +2,14 @@ This library exposes contracts used in ZKsync Era codebase for unit testing. +## Contents + +Some of the commonly used contracts included into this crate are: + +- [`LoadnextContract`](contracts/loadnext/loadnext_contract.sol): Emulates various kinds of load (storage reads / writes, hashing, emitting events + deploying contracts etc.). Used in load testing. +- [`Counter`](contracts/counter/counter.sol): Simple stateful counter. Can be used to test "cheap" transactions and reverts. + ## Building Building the library requires `yarn` installed globally. If there are any issues during build, it could be useful diff --git a/core/tests/loadnext/README.md b/core/tests/loadnext/README.md index 59288a7160e..d55c1c0633d 100644 --- a/core/tests/loadnext/README.md +++ b/core/tests/loadnext/README.md @@ -1,4 +1,4 @@ -# Loadnext: loadtest for ZKsync +# Loadnext: load test for ZKsync Loadnext is a utility for random stress-testing the ZKsync server. It is capable of simulating the behavior of many independent users of ZKsync network, who are sending quasi-random requests to the server. @@ -27,18 +27,27 @@ It: ## Transactions Parameters -The smart contract that is used for every l2 transaction can be found here: -`etc/contracts-test-data/contracts/loadnext/loadnext_contract.sol`. +The smart contract that is used for every l2 transaction can be found in the [`zksync_test_contracts`] crate. The `execute` function of the contract has the following parameters: -``` - function execute(uint reads, uint writes, uint hashes, uint events, uint max_recursion, uint deploys) external returns(uint) { +```solidity +function execute( + uint256 reads, + uint256 writes, + uint256 hashes, + uint256 events, + uint256 max_recursion, + uint256 deploys +) external returns (uint256) { + // snipped +} + ``` which correspond to the following configuration options: -``` +```rust pub struct LoadnextContractExecutionParams { pub reads: usize, pub writes: usize, @@ -51,7 +60,7 @@ pub struct LoadnextContractExecutionParams { For example, to simulate an average transaction on mainnet, one could do: -``` +```shell CONTRACT_EXECUTION_PARAMS_WRITES=2 CONTRACT_EXECUTION_PARAMS_READS=6 CONTRACT_EXECUTION_PARAMS_EVENTS=2 @@ -62,7 +71,7 @@ CONTRACT_EXECUTION_PARAMS_DEPLOYS=0 Similarly, to simulate a lightweight transaction: -``` +```shell CONTRACT_EXECUTION_PARAMS_WRITES=0 CONTRACT_EXECUTION_PARAMS_READS=0 CONTRACT_EXECUTION_PARAMS_EVENTS=0 @@ -86,7 +95,7 @@ Example invocation: - `MASTER_WALLET_PK` needs to be set to the private key of the master account. - `MAIN_TOKEN` needs to be set to the address of the token to be used for the loadtest. -``` +```shell cargo build CONTRACT_EXECUTION_PARAMS_WRITES=2 \ @@ -110,3 +119,5 @@ MASTER_WALLET_PK="..." \ MAIN_TOKEN="..." \ cargo run --bin loadnext ``` + +[`zksync_test_contracts`]: ../../lib/test_contracts From 2623ee84ca3baf956c9aa2684711d2aa8071b2c7 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 8 Oct 2024 16:06:54 +0300 Subject: [PATCH 18/32] Make test contracts dev dependency --- core/lib/types/src/tx/execute.rs | 10 ++++++ core/node/consensus/src/testonly.rs | 23 ++++++------- core/node/state_keeper/Cargo.toml | 4 +-- .../state_keeper/src/executor/tests/tester.rs | 7 ++-- core/node/state_keeper/src/testonly/mod.rs | 33 ++----------------- 5 files changed, 31 insertions(+), 46 deletions(-) diff --git a/core/lib/types/src/tx/execute.rs b/core/lib/types/src/tx/execute.rs index 1cbbe5abf71..93e2a004d94 100644 --- a/core/lib/types/src/tx/execute.rs +++ b/core/lib/types/src/tx/execute.rs @@ -136,4 +136,14 @@ impl Execute { factory_deps: vec![contract_bytecode], } } + + /// Creates an instance for transferring base token to the specified recipient. + pub fn transfer(to: Address, value: U256) -> Self { + Self { + contract_address: Some(to), + calldata: vec![], + value, + factory_deps: vec![], + } + } } diff --git a/core/node/consensus/src/testonly.rs b/core/node/consensus/src/testonly.rs index f40516672dc..9523e395d58 100644 --- a/core/node/consensus/src/testonly.rs +++ b/core/node/consensus/src/testonly.rs @@ -33,10 +33,7 @@ use zksync_state_keeper::{ executor::MainBatchExecutorFactory, io::{IoCursor, L1BatchParams, L2BlockParams}, seal_criteria::NoopSealer, - testonly::{ - fund, l1_transaction, l2_transaction, test_batch_executor::MockReadStorageFactory, - MockBatchExecutor, - }, + testonly::{fee, fund, test_batch_executor::MockReadStorageFactory, MockBatchExecutor}, AsyncRocksdbCache, OutputHandler, StateKeeperPersistence, TreeWritesPersistence, ZkSyncStateKeeper, }; @@ -44,7 +41,8 @@ use zksync_test_contracts::Account; use zksync_types::{ ethabi, fee_model::{BatchFeeInput, L1PeggedBatchFeeModelInput}, - L1BatchNumber, L2BlockNumber, L2ChainId, PriorityOpId, ProtocolVersionId, Transaction, + Address, Execute, L1BatchNumber, L2BlockNumber, L2ChainId, PriorityOpId, ProtocolVersionId, + Transaction, }; use zksync_web3_decl::client::{Client, DynClient, L2}; @@ -323,12 +321,15 @@ impl StateKeeper { /// Pushes a new L2 block with `transactions` transactions to the `StateKeeper`. pub async fn push_random_block(&mut self, rng: &mut impl Rng, account: &mut Account) { let txs: Vec<_> = (0..rng.gen_range(3..8)) - .map(|_| match rng.gen() { - true => l2_transaction(account, 1_000_000), - false => { - let tx = l1_transaction(account, self.next_priority_op); - self.next_priority_op += 1; - tx + .map(|_| { + let execute = Execute::transfer(Address::random(), 0.into()); + match rng.gen() { + true => account.get_l2_tx_for_execute(execute, Some(fee(1_000_000))), + false => { + let tx = account.get_l1_tx(execute, self.next_priority_op.0); + self.next_priority_op += 1; + tx + } } }) .collect(); diff --git a/core/node/state_keeper/Cargo.toml b/core/node/state_keeper/Cargo.toml index 0721ae8ef25..cffc2ad7963 100644 --- a/core/node/state_keeper/Cargo.toml +++ b/core/node/state_keeper/Cargo.toml @@ -25,7 +25,6 @@ zksync_node_fee_model.workspace = true zksync_utils.workspace = true zksync_contracts.workspace = true zksync_protobuf.workspace = true -zksync_test_contracts.workspace = true zksync_node_genesis.workspace = true zksync_node_test_utils.workspace = true zksync_vm_executor.workspace = true @@ -47,7 +46,6 @@ assert_matches.workspace = true rand.workspace = true tempfile.workspace = true test-casing.workspace = true -futures.workspace = true zksync_eth_client.workspace = true -zksync_system_constants.workspace = true +zksync_test_contracts.workspace = true diff --git a/core/node/state_keeper/src/executor/tests/tester.rs b/core/node/state_keeper/src/executor/tests/tester.rs index a24e39107fd..d8d3f617e2b 100644 --- a/core/node/state_keeper/src/executor/tests/tester.rs +++ b/core/node/state_keeper/src/executor/tests/tester.rs @@ -373,7 +373,7 @@ impl AccountExt for Account { ) } fn l1_execute(&mut self, serial_id: PriorityOpId) -> Transaction { - testonly::l1_transaction(self, serial_id) + self.get_l1_tx(Execute::transfer(Address::random(), 0.into()), serial_id.0) } /// Returns a valid `execute` transaction. @@ -433,7 +433,10 @@ impl AccountExt for Account { /// Returns a valid `execute` transaction. /// Automatically increments nonce of the account. fn execute_with_gas_limit(&mut self, gas_limit: u32) -> Transaction { - testonly::l2_transaction(self, gas_limit) + self.get_l2_tx_for_execute( + Execute::transfer(Address::random(), 0.into()), + Some(testonly::fee(gas_limit)), + ) } /// Returns a transaction to the loadnext contract with custom gas limit and expected burned gas amount. diff --git a/core/node/state_keeper/src/testonly/mod.rs b/core/node/state_keeper/src/testonly/mod.rs index f8f8bc53db6..758fe6a3d59 100644 --- a/core/node/state_keeper/src/testonly/mod.rs +++ b/core/node/state_keeper/src/testonly/mod.rs @@ -12,11 +12,10 @@ use zksync_multivm::interface::{ SystemEnv, VmExecutionResultAndLogs, }; use zksync_state::OwnedStorage; -use zksync_test_contracts::Account; use zksync_types::{ - fee::Fee, utils::storage_key_for_standard_token_balance, AccountTreeId, Address, Execute, - L1BatchNumber, L2BlockNumber, PriorityOpId, StorageLog, Transaction, L2_BASE_TOKEN_ADDRESS, - SYSTEM_CONTEXT_MINIMAL_BASE_FEE, U256, + fee::Fee, utils::storage_key_for_standard_token_balance, AccountTreeId, Address, L1BatchNumber, + L2BlockNumber, StorageLog, Transaction, L2_BASE_TOKEN_ADDRESS, SYSTEM_CONTEXT_MINIMAL_BASE_FEE, + U256, }; use zksync_utils::u256_to_h256; @@ -125,29 +124,3 @@ pub fn fee(gas_limit: u32) -> Fee { gas_per_pubdata_limit: U256::from(DEFAULT_GAS_PER_PUBDATA), } } - -/// Returns a valid L2 transaction. -/// Automatically increments nonce of the account. -pub fn l2_transaction(account: &mut Account, gas_limit: u32) -> Transaction { - account.get_l2_tx_for_execute( - Execute { - contract_address: Some(Address::random()), - calldata: vec![], - value: Default::default(), - factory_deps: vec![], - }, - Some(fee(gas_limit)), - ) -} - -pub fn l1_transaction(account: &mut Account, serial_id: PriorityOpId) -> Transaction { - account.get_l1_tx( - Execute { - contract_address: Some(Address::random()), - value: Default::default(), - calldata: vec![], - factory_deps: vec![], - }, - serial_id.0, - ) -} From b4f39a089c7ef1bb868daf0c523d02290beafa51 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 8 Oct 2024 16:24:04 +0300 Subject: [PATCH 19/32] Add `ts-node` dependency --- core/lib/test_contracts/package.json | 1 + core/lib/test_contracts/yarn.lock | 106 +++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/core/lib/test_contracts/package.json b/core/lib/test_contracts/package.json index 76f0c375342..7e09fd9e089 100644 --- a/core/lib/test_contracts/package.json +++ b/core/lib/test_contracts/package.json @@ -6,6 +6,7 @@ "dependencies": { "@openzeppelin/contracts": "^4.8.0", "hardhat": "=2.22.2", + "ts-node": "^10.1.0", "typescript": "^4.3.5" }, "devDependencies": { diff --git a/core/lib/test_contracts/yarn.lock b/core/lib/test_contracts/yarn.lock index 6c4c39fc834..c1afeb348dc 100644 --- a/core/lib/test_contracts/yarn.lock +++ b/core/lib/test_contracts/yarn.lock @@ -7,6 +7,13 @@ resolved "https://registry.yarnpkg.com/@balena/dockerignore/-/dockerignore-1.0.2.tgz#9ffe4726915251e8eb69f44ef3547e0da2c03e0d" integrity sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@ethersproject/abi@^5.1.2": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" @@ -189,6 +196,24 @@ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.0.0.tgz#f22824caff3ae506b18207bad4126dbc6ccdb6b8" integrity sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ== +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@matterlabs/hardhat-zksync-solc@^0.3.15": version "0.3.17" resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.3.17.tgz#72f199544dc89b268d7bfc06d022a311042752fd" @@ -467,6 +492,26 @@ "@sentry/types" "5.30.0" tslib "^1.9.3" +"@tsconfig/node10@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@types/bn.js@^4.11.3": version "4.11.6" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" @@ -515,6 +560,18 @@ JSONStream@1.3.2: jsonparse "^1.2.0" through ">=2.2.7 <3" +acorn-walk@^8.1.1: + version "8.3.4" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" + +acorn@^8.11.0, acorn@^8.4.1: + version "8.12.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + adm-zip@^0.4.16: version "0.4.16" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" @@ -586,6 +643,11 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -943,6 +1005,11 @@ create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + debug@4, debug@4.3.4, debug@^4.1.1: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -972,6 +1039,11 @@ diff@5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + docker-modem@^1.0.8: version "1.0.9" resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-1.0.9.tgz#a1f13e50e6afb6cf3431b2d5e7aac589db6aaba8" @@ -1534,6 +1606,11 @@ lru_map@^0.3.3: resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -2140,6 +2217,25 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== +ts-node@^10.1.0: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -2222,6 +2318,11 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -2309,6 +2410,11 @@ yargs@16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From e6e8ea519e1e537ad8bf3ddce9e3e23e89bc8e3a Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 8 Oct 2024 17:39:05 +0300 Subject: [PATCH 20/32] Build specific binaries in Docker images --- docker/contract-verifier/Dockerfile | 2 +- docker/external-node/Dockerfile | 2 +- docker/server-v2/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/contract-verifier/Dockerfile b/docker/contract-verifier/Dockerfile index 7943dae835a..9a7eed0d98b 100644 --- a/docker/contract-verifier/Dockerfile +++ b/docker/contract-verifier/Dockerfile @@ -17,7 +17,7 @@ ENV RUSTC_WRAPPER=${RUSTC_WRAPPER} WORKDIR /usr/src/zksync COPY . . -RUN cargo build --release +RUN cargo build --release --bin zksync_contract_verifier FROM ghcr.io/matter-labs/zksync-runtime-base:latest diff --git a/docker/external-node/Dockerfile b/docker/external-node/Dockerfile index 1012eecfc16..56caed9e32f 100644 --- a/docker/external-node/Dockerfile +++ b/docker/external-node/Dockerfile @@ -15,7 +15,7 @@ ENV RUSTC_WRAPPER=${RUSTC_WRAPPER} WORKDIR /usr/src/zksync COPY . . -RUN cargo build --release +RUN cargo build --release --bin zksync_external_node --bin block_reverter FROM ghcr.io/matter-labs/zksync-runtime-base:latest diff --git a/docker/server-v2/Dockerfile b/docker/server-v2/Dockerfile index 13a39133327..5f25e0289b8 100644 --- a/docker/server-v2/Dockerfile +++ b/docker/server-v2/Dockerfile @@ -17,7 +17,7 @@ WORKDIR /usr/src/zksync COPY . . -RUN cargo build --release --features=rocksdb/io-uring +RUN cargo build --release --features=rocksdb/io-uring --bin zksync_server --bin block_reverter --bin merkle_tree_consistency_checker FROM ghcr.io/matter-labs/zksync-runtime-base:latest From 944cd0c8f85e7cefb82a666e14080c08c611a919 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Tue, 8 Oct 2024 17:40:42 +0300 Subject: [PATCH 21/32] Fix `get_deploy_tx*()` functions --- core/tests/vm-benchmark/src/lib.rs | 30 ++++++++++++++++++++++ core/tests/vm-benchmark/src/transaction.rs | 4 ++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/core/tests/vm-benchmark/src/lib.rs b/core/tests/vm-benchmark/src/lib.rs index 4bd008d3319..c32e7bf2729 100644 --- a/core/tests/vm-benchmark/src/lib.rs +++ b/core/tests/vm-benchmark/src/lib.rs @@ -70,3 +70,33 @@ pub const BYTECODES: &[Bytecode] = &[ include_bytecode!(slot_hash_collision), include_bytecode!(write_and_decode), ]; + +#[cfg(test)] +mod tests { + use zksync_multivm::interface::{ExecutionResult, VmRevertReason}; + + use super::*; + + #[test] + fn deploy_transactions_are_valid() { + for bytecode in BYTECODES { + println!("Testing bytecode {}", bytecode.name); + + let mut vm = BenchmarkingVm::new(); + let res = vm.run_transaction(&bytecode.deploy_tx()); + match &res.result { + ExecutionResult::Success { .. } => { /* OK */ } + ExecutionResult::Revert { + output: + VmRevertReason::Unknown { + function_selector, + data, + }, + } if function_selector.is_empty() && data.is_empty() => { + // out of gas; this is expected for most fuzzed bytecodes + } + _ => panic!("Unexpected execution result: {:?}", res.result), + } + } + } +} diff --git a/core/tests/vm-benchmark/src/transaction.rs b/core/tests/vm-benchmark/src/transaction.rs index 5a108d6aca4..4252ee2cdf5 100644 --- a/core/tests/vm-benchmark/src/transaction.rs +++ b/core/tests/vm-benchmark/src/transaction.rs @@ -22,7 +22,9 @@ pub fn get_deploy_tx_with_gas_limit(code: &[u8], gas_limit: u32, nonce: u32) -> let mut salt = H256::zero(); salt.0[28..32].copy_from_slice(&nonce.to_be_bytes()); let execute = Execute::for_deploy(salt, code.to_vec(), &[]); - Account::new(PRIVATE_KEY.clone()).get_l2_tx_for_execute(execute, Some(tx_fee(gas_limit))) + let mut account = Account::new(PRIVATE_KEY.clone()); + account.nonce = Nonce(nonce); + account.get_l2_tx_for_execute(execute, Some(tx_fee(gas_limit))) } fn tx_fee(gas_limit: u32) -> Fee { From e87c0499ce60c41c389d2355bcc4c5e1b62e935b Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 10 Oct 2024 11:39:49 +0300 Subject: [PATCH 22/32] Sketch build based on `foundry-compilers` --- Cargo.lock | 920 ++++++++++++++++++++++- Cargo.toml | 2 + core/lib/test_contracts/Cargo.toml | 4 + core/lib/test_contracts/build.rs | 198 ++--- core/lib/test_contracts/src/contracts.rs | 111 +-- 5 files changed, 1038 insertions(+), 197 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a561972000e..831b079af5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,6 +101,67 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy-json-abi" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c66eec1acdd96b39b995b8f5ee5239bc0c871d62c527ae1ac9fd1d7fecd455" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb848c43f6b06ae3de2e4a67496cbbabd78ae87db0f1248934f15d76192c6a" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 1.0.0", + "foldhash", + "getrandom", + "hashbrown 0.15.0", + "hex-literal", + "indexmap 2.5.0", + "itoa", + "k256 0.13.4", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.0.0", + "serde", + "sha3 0.10.8", + "tiny-keccak 2.0.2", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +dependencies = [ + "arrayvec 0.7.6", + "bytes", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07ebb0c1674ff8cbb08378d7c2e0e27919d2a2dae07ad3bca26174deda8d389" +dependencies = [ + "serde", + "winnow 0.6.20", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -186,6 +247,139 @@ version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint 0.4.6", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint 0.4.6", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote 1.0.37", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote 1.0.37", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "quote 1.0.37", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint 0.4.6", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "arr_macro" version = "0.1.3" @@ -528,6 +722,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -744,7 +949,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.77", ] @@ -766,7 +971,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.77", "which", @@ -1048,6 +1253,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "build_const" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" + [[package]] name = "build_html" version = "2.5.0" @@ -1105,6 +1316,9 @@ name = "bytes" version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +dependencies = [ + "serde", +] [[package]] name = "bytesize" @@ -1149,7 +1363,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.23", "serde", "serde_json", ] @@ -1539,6 +1753,19 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "const-hex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -1824,7 +2051,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version", + "rustc_version 0.4.1", "subtle", "zeroize", ] @@ -2010,6 +2237,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -2019,7 +2257,7 @@ dependencies = [ "convert_case 0.4.0", "proc-macro2 1.0.86", "quote 1.0.37", - "rustc_version", + "rustc_version 0.4.1", "syn 2.0.77", ] @@ -2071,6 +2309,15 @@ dependencies = [ "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" @@ -2081,6 +2328,18 @@ dependencies = [ "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" @@ -2092,6 +2351,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -2116,6 +2386,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "ecdsa" version = "0.14.8" @@ -2429,6 +2705,17 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec 0.7.6", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.12.1" @@ -2518,6 +2805,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -2542,6 +2835,137 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "foundry-compilers" +version = "0.11.1" +source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "auto_impl", + "derivative", + "dirs", + "dyn-clone", + "foundry-compilers-artifacts", + "foundry-compilers-core", + "fs4 0.8.4", + "fs_extra", + "futures-util", + "home", + "itertools 0.13.0", + "md-5", + "once_cell", + "path-slash", + "rand 0.8.5", + "rayon", + "reqwest 0.12.7", + "semver 1.0.23", + "serde", + "serde_json", + "sha2 0.10.8", + "solang-parser", + "svm-rs", + "svm-rs-builds", + "tempfile", + "thiserror", + "tokio", + "tracing", + "walkdir", + "winnow 0.6.20", + "yansi", +] + +[[package]] +name = "foundry-compilers-artifacts" +version = "0.11.1" +source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +dependencies = [ + "foundry-compilers-artifacts-solc", + "foundry-compilers-artifacts-vyper", + "foundry-compilers-artifacts-zksolc", +] + +[[package]] +name = "foundry-compilers-artifacts-solc" +version = "0.11.1" +source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "foundry-compilers-core", + "futures-util", + "md-5", + "path-slash", + "rayon", + "semver 1.0.23", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "tokio", + "tracing", + "walkdir", + "yansi", +] + +[[package]] +name = "foundry-compilers-artifacts-vyper" +version = "0.11.1" +source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "foundry-compilers-artifacts-solc", + "foundry-compilers-core", + "path-slash", + "semver 1.0.23", + "serde", +] + +[[package]] +name = "foundry-compilers-artifacts-zksolc" +version = "0.11.1" +source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "foundry-compilers-artifacts-solc", + "foundry-compilers-core", + "md-5", + "path-slash", + "rayon", + "semver 1.0.23", + "serde", + "serde_json", + "thiserror", + "tracing", + "walkdir", + "yansi", +] + +[[package]] +name = "foundry-compilers-core" +version = "0.11.1" +source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +dependencies = [ + "alloy-primitives", + "cfg-if", + "dunce", + "fs_extra", + "memmap2", + "once_cell", + "path-slash", + "regex", + "semver 1.0.23", + "serde", + "serde_json", + "svm-rs", + "tempfile", + "thiserror", + "tokio", + "walkdir", +] + [[package]] name = "fraction" version = "0.15.3" @@ -2608,6 +3032,26 @@ dependencies = [ "zksync_bellman", ] +[[package]] +name = "fs4" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" +dependencies = [ + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "fs4" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c6b3bd49c37d2aa3f3f2220233b29a7cd23f79d1fe70e5337d25fb390793de" +dependencies = [ + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "fs_extra" version = "1.3.0" @@ -3066,7 +3510,7 @@ dependencies = [ "log", "pest", "pest_derive", - "quick-error", + "quick-error 2.0.1", "serde", "serde_json", ] @@ -3091,6 +3535,16 @@ dependencies = [ "serde", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "foldhash", + "serde", +] + [[package]] name = "hashlink" version = "0.9.1" @@ -3147,6 +3601,15 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" @@ -3376,10 +3839,12 @@ dependencies = [ "hyper-util", "log", "rustls 0.23.13", + "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", + "webpki-roots", ] [[package]] @@ -3558,6 +4023,7 @@ checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", + "serde", ] [[package]] @@ -3789,7 +4255,7 @@ dependencies = [ "hyper 0.14.30", "jsonrpsee-types 0.21.0", "pin-project", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "thiserror", @@ -3817,7 +4283,7 @@ dependencies = [ "parking_lot", "pin-project", "rand 0.8.5", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "thiserror", @@ -4013,6 +4479,16 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + [[package]] name = "kv-log-macro" version = "1.0.7" @@ -4252,6 +4728,12 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "lockfree-object-pool" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" + [[package]] name = "log" version = "0.4.22" @@ -4358,6 +4840,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "merkle_tree_consistency_checker" version = "0.1.0" @@ -4927,6 +5418,12 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "ordered-float" version = "2.10.1" @@ -5032,6 +5529,12 @@ 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" + [[package]] name = "pbkdf2" version = "0.12.2" @@ -5107,24 +5610,57 @@ dependencies = [ ] [[package]] -name = "pest_meta" -version = "2.7.13" +name = "pest_meta" +version = "2.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.8", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.5.0", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "once_cell", - "pest", - "sha2 0.10.8", + "phf_shared 0.11.2", + "rand 0.8.5", ] [[package]] -name = "petgraph" -version = "0.6.5" +name = "phf_macros" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ - "fixedbitset", - "indexmap 2.5.0", + "phf_generator", + "phf_shared 0.11.2", + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -5136,6 +5672,15 @@ dependencies = [ "siphasher 0.3.11", ] +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher 0.3.11", +] + [[package]] name = "pico-args" version = "0.5.0" @@ -5442,6 +5987,26 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "proptest" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.6.0", + "lazy_static", + "num-traits", + "rand 0.8.5", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.4", + "rusty-fork", + "tempfile", + "unarray", +] + [[package]] name = "prost" version = "0.12.6" @@ -5608,6 +6173,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quick-error" version = "2.0.1" @@ -5623,6 +6194,54 @@ dependencies = [ "byteorder", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.0.0", + "rustls 0.23.13", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring", + "rustc-hash 2.0.0", + "rustls 0.23.13", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "quote" version = "0.6.13" @@ -5669,6 +6288,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core 0.6.4", + "serde", ] [[package]] @@ -5705,6 +6325,15 @@ 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 = "rand_xoshiro" version = "0.6.0" @@ -5894,7 +6523,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls 0.23.13", + "rustls-native-certs 0.7.3", "rustls-pemfile 2.1.3", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", @@ -5902,6 +6535,8 @@ dependencies = [ "system-configuration 0.6.1", "tokio", "tokio-native-tls", + "tokio-rustls 0.26.0", + "tokio-socks", "tokio-util", "tower-service", "url", @@ -5909,6 +6544,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots", "windows-registry", ] @@ -6063,6 +6699,36 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ruint" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp", + "num-bigint 0.4.6", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand 0.8.5", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + [[package]] name = "rust_decimal" version = "1.36.0" @@ -6091,19 +6757,37 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +dependencies = [ + "rand 0.8.5", +] + [[package]] name = "rustc-hex" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver", + "semver 1.0.23", ] [[package]] @@ -6186,6 +6870,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.3", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -6266,6 +6963,18 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error 1.2.3", + "tempfile", + "wait-timeout", +] + [[package]] name = "ruzstd" version = "0.5.0" @@ -6562,6 +7271,15 @@ dependencies = [ "tokio", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.23" @@ -6571,6 +7289,15 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "send_wrapper" version = "0.4.0" @@ -6617,7 +7344,7 @@ dependencies = [ "hostname", "libc", "os_info", - "rustc_version", + "rustc_version 0.4.1", "sentry-core", "uname", ] @@ -6762,6 +7489,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + [[package]] name = "serde_spanned" version = "0.6.8" @@ -6901,6 +7639,16 @@ dependencies = [ "keccak", ] +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + [[package]] name = "sha3_ce" version = "0.10.6" @@ -6955,6 +7703,12 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simdutf8" version = "0.1.5" @@ -7174,7 +7928,7 @@ dependencies = [ "chacha20poly1305", "curve25519-dalek", "rand_core 0.6.4", - "rustc_version", + "rustc_version 0.4.1", "sha2 0.10.8", "subtle", ] @@ -7220,6 +7974,20 @@ dependencies = [ "sha1", ] +[[package]] +name = "solang-parser" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" +dependencies = [ + "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "phf", + "thiserror", + "unicode-xid 0.2.6", +] + [[package]] name = "sp-core-hashing" version = "15.0.0" @@ -7508,7 +8276,7 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot", - "phf_shared", + "phf_shared 0.10.0", "precomputed-hash", ] @@ -7716,6 +8484,39 @@ dependencies = [ "zeroize", ] +[[package]] +name = "svm-rs" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aebac1b1ef2b46e2e2bdf3c09db304800f2a77c1fa902bd5231490203042be8" +dependencies = [ + "const-hex", + "dirs", + "fs4 0.9.1", + "reqwest 0.12.7", + "semver 1.0.23", + "serde", + "serde_json", + "sha2 0.10.8", + "tempfile", + "thiserror", + "url", + "zip", +] + +[[package]] +name = "svm-rs-builds" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fa0f145894cb4d1c14446f08098ee5f21fc37ccbd1a7dd9dd355bbc806de3b" +dependencies = [ + "build_const", + "const-hex", + "semver 1.0.23", + "serde_json", + "svm-rs", +] + [[package]] name = "syn" version = "0.15.44" @@ -8151,6 +8952,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-socks" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" +dependencies = [ + "either", + "futures-util", + "thiserror", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.16" @@ -8487,6 +9300,12 @@ 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" @@ -8731,6 +9550,15 @@ dependencies = [ "zksync_vlog", ] +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "walkdir" version = "2.5.0" @@ -9259,6 +10087,23 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "zip" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "flate2", + "indexmap 2.5.0", + "memchr", + "thiserror", + "zopfli", +] + [[package]] name = "zk_evm" version = "0.131.0-rc.2" @@ -9728,7 +10573,7 @@ dependencies = [ "anyhow", "async-trait", "rand 0.8.5", - "semver", + "semver 1.0.23", "tracing", "vise", "zksync_concurrency", @@ -9760,7 +10605,7 @@ dependencies = [ "pin-project", "prost 0.12.6", "rand 0.8.5", - "semver", + "semver 1.0.23", "snow", "thiserror", "tls-listener", @@ -9903,7 +10748,7 @@ dependencies = [ "hex", "lazy_static", "regex", - "semver", + "semver 1.0.23", "serde", "serde_json", "tempfile", @@ -10187,7 +11032,7 @@ dependencies = [ "clap 4.5.18", "envy", "futures 0.3.30", - "rustc_version", + "rustc_version 0.4.1", "serde", "serde_json", "tempfile", @@ -10553,7 +11398,7 @@ dependencies = [ "async-trait", "rand 0.8.5", "secrecy", - "semver", + "semver 1.0.23", "tempfile", "test-casing", "thiserror", @@ -10640,7 +11485,7 @@ dependencies = [ "ctrlc", "futures 0.3.30", "pin-project-lite", - "semver", + "semver 1.0.23", "thiserror", "tokio", "tracing", @@ -10994,7 +11839,7 @@ dependencies = [ name = "zksync_shared_metrics" version = "0.1.0" dependencies = [ - "rustc_version", + "rustc_version 0.4.1", "tracing", "vise", "zksync_dal", @@ -11195,6 +12040,7 @@ name = "zksync_test_contracts" version = "0.1.0" dependencies = [ "ethabi", + "foundry-compilers", "hex", "once_cell", "rand 0.8.5", @@ -11406,6 +12252,20 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zopfli" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946" +dependencies = [ + "bumpalo", + "crc32fast", + "lockfree-object-pool", + "log", + "once_cell", + "simd-adler32", +] + [[package]] name = "zstd-sys" version = "2.0.13+zstd.1.5.6" diff --git a/Cargo.toml b/Cargo.toml index a4008a5fc79..1a627045027 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -200,6 +200,8 @@ trybuild = "1.0" vise = "0.2.0" vise-exporter = "0.2.0" +foundry-compilers = { version = "0.11.1", git = "https://github.com/Moonsong-Labs/compilers.git", rev = "b2aca7f87e0484d1e202d77a4ada8b46b059da6d" } + # DA clients' dependencies # Avail base58 = "0.2.0" diff --git a/core/lib/test_contracts/Cargo.toml b/core/lib/test_contracts/Cargo.toml index d9571e3400e..f11ae8d7d3f 100644 --- a/core/lib/test_contracts/Cargo.toml +++ b/core/lib/test_contracts/Cargo.toml @@ -22,3 +22,7 @@ ethabi.workspace = true rand.workspace = true serde.workspace = true serde_json.workspace = true + +[build-dependencies] +serde_json.workspace = true +foundry-compilers.workspace = true diff --git a/core/lib/test_contracts/build.rs b/core/lib/test_contracts/build.rs index 239c01ecd1d..fc8aeb98688 100644 --- a/core/lib/test_contracts/build.rs +++ b/core/lib/test_contracts/build.rs @@ -1,118 +1,126 @@ use std::{ - env, fs, - path::Path, - process::{Command, Output}, + collections::{HashMap, HashSet}, + env, + fs::File, + io::{BufWriter, Write}, + path::{Path, PathBuf}, }; -fn assert_output_success(output: &Output, cmd: &str) { - if !output.status.success() { - let stdout = String::from_utf8_lossy(&output.stdout); - let stderr = String::from_utf8_lossy(&output.stderr); - panic!( - "`{cmd}` failed with {status}\n---- stdout ---- \n{stdout}\n---- stderr ----\n{stderr}", - status = output.status - ); - } -} +use foundry_compilers::{ + artifacts::zksolc::output_selection::{ + FileOutputSelection, OutputSelection, OutputSelectionFlag, + }, + solc, + zksolc::{settings::Optimizer, ZkSettings, ZkSolcCompiler, ZkSolcSettings}, + zksync, + zksync::artifact_output::zk::{ZkArtifactOutput, ZkContractArtifact}, + ArtifactId, ProjectBuilder, ProjectPathsConfig, +}; -fn check_yarn() { - let output = Command::new("yarn") - .arg("--version") - .output() - .expect("failed running `yarn --version`"); - assert_output_success(&output, "yarn --version"); - let yarn_version = output.stdout; - let yarn_version = String::from_utf8(yarn_version).expect("yarn version is not UFT-8"); - assert!( - yarn_version.starts_with("1."), - "Unsupported yarn version: {yarn_version}" - ); +#[derive(Debug)] +struct ContractEntry { + abi: String, + bytecode: Vec, } -fn copy_recursively(src_dir: &Path, dest_dir: &Path) { - fs::create_dir_all(dest_dir).unwrap_or_else(|err| { - panic!( - "failed creating destination dir `{}`: {err}", - dest_dir.display() - ); - }); - for entry in fs::read_dir(src_dir).expect("failed reading source dir") { - let entry = entry.unwrap(); - let dest_path = dest_dir.join(entry.file_name()); - if entry.file_type().unwrap().is_dir() { - copy_recursively(&entry.path(), &dest_path); - } else { - fs::copy(entry.path(), &dest_path).unwrap_or_else(|err| { - panic!( - "failed copying `{}` to `{}`: {err}", - entry.path().display(), - dest_path.display() - ); - }); - } +impl ContractEntry { + fn new(artifact: ZkContractArtifact) -> Option { + let abi = artifact.abi.expect("no ABI"); + let abi = serde_json::to_string(&abi).expect("cannot serialize ABI to string"); + let bytecode = artifact.bytecode?; // Bytecode is `None` for interfaces + let bytecode = bytecode + .object + .into_bytes() + .expect("bytecode is not fully compiled") + .into(); + Some(Self { abi, bytecode }) } } -fn copy_contract_files(out_dir: &str) { - const COPIED_FILES: &[&str] = &["package.json", "yarn.lock", "hardhat.config.ts"]; - const COPIED_DIRS: &[&str] = &["contracts"]; - - let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("no `CARGO_MANIFEST_DIR` provided"); +fn save_artifacts( + output: &mut impl Write, + artifacts: impl Iterator, +) { + let source_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("contracts"); + let mut modules = HashMap::<_, HashMap<_, _>>::new(); - for &copied_file in COPIED_FILES { - let src = Path::new(&crate_dir).join(copied_file); - let dest = Path::new(&out_dir).join(copied_file); - - if fs::exists(&dest).unwrap_or(false) { - fs::remove_file(&dest).unwrap_or_else(|err| { - panic!("failed removing `{}`: {err}", dest.display()); - }); + for (id, artifact) in artifacts { + let Ok(path_in_sources) = id.source.strip_prefix(&source_dir) else { + continue; // The artifact doesn't correspond to a source contract + }; + let contract_dir = path_in_sources.iter().next().expect("no dir"); + let module_name = contract_dir + .to_str() + .expect("contract dir is not UTF-8") + .replace('-', "_"); + if let Some(entry) = ContractEntry::new(artifact) { + modules + .entry(module_name) + .or_default() + .insert(id.name, entry); } - fs::copy(&src, &dest).unwrap_or_else(|err| { - panic!("failed copying `{copied_file}`: {err}"); - }); } - for &copied_dir in COPIED_DIRS { - let src = Path::new(&crate_dir).join(copied_dir); - let dest = Path::new(&out_dir).join(copied_dir); - if fs::exists(&dest).unwrap_or(false) { - fs::remove_dir_all(&dest).unwrap_or_else(|err| { - panic!("failed removing `{}`: {err}", dest.display()); - }); + for (module_name, module_entries) in modules { + writeln!(output, "pub(crate) mod {module_name} {{").unwrap(); + for (contract_name, entry) in module_entries { + writeln!( + output, + " pub(crate) const {contract_name}: crate::contracts::RawContract = crate::contracts::RawContract {{" + ) + .unwrap(); + writeln!(output, " abi: r#\"{}\"#,", entry.abi).unwrap(); // ABI shouldn't include '"#' combinations for this to work + writeln!(output, " bytecode: &{:?},", entry.bytecode).unwrap(); + writeln!(output, " }};").unwrap(); } - copy_recursively(&src, &dest); + writeln!(output, "}}").unwrap(); } } -fn install_yarn_deps(working_dir: &str) { - let output = Command::new("yarn") - .current_dir(working_dir) - .args(["--non-interactive", "install"]) - .output() - .expect("failed running `yarn install`"); - assert_output_success(&output, "yarn install"); -} - -fn compile_contracts(working_dir: &str) { - let output = Command::new("yarn") - .current_dir(working_dir) - .args(["--non-interactive", "run", "build"]) - .output() - .expect("failed running `yarn run build`"); - assert_output_success(&output, "yarn run build"); +fn compiler_settings() -> ZkSolcSettings { + ZkSolcSettings { + cli_settings: solc::CliSettings::default(), + settings: ZkSettings { + via_ir: Some(true), + optimizer: Optimizer { + enabled: Some(true), + ..Optimizer::default() + }, + output_selection: OutputSelection { + all: Some(FileOutputSelection { + per_file: None, + per_contract: Some(HashSet::from([OutputSelectionFlag::ABI])), + }), + }, + enable_eravm_extensions: true, + ..ZkSettings::default() + }, + } } fn main() { - check_yarn(); + let settings = compiler_settings(); + let temp_dir = PathBuf::from(env::var("OUT_DIR").expect("no `OUT_DIR` provided")); + let paths = ProjectPathsConfig::builder() + .sources(Path::new(env!("CARGO_MANIFEST_DIR")).join("contracts")) + .artifacts(temp_dir.join("artifacts")) + .cache(temp_dir.join("cache")) + .build() + .unwrap(); + + let project = ProjectBuilder::::new(ZkArtifactOutput::default()) + .paths(paths) + .settings(settings) + .build(ZkSolcCompiler::default()) + .unwrap(); + let output = zksync::project_compile(&project).unwrap(); + output.assert_success(); - println!("cargo::rerun-if-changed=package.json"); - println!("cargo::rerun-if-changed=yarn.lock"); - println!("cargo::rerun-if-changed=hardhat.config.ts"); - println!("cargo::rerun-if-changed=contracts"); + let module_path = temp_dir.join("raw_contracts.rs"); + let module = File::create(&module_path).expect("failed creating output Rust module"); + let mut module = BufWriter::new(module); + save_artifacts(&mut module, output.into_artifacts()); - let temp_dir = env::var("OUT_DIR").expect("no `OUT_DIR` provided"); - copy_contract_files(&temp_dir); - install_yarn_deps(&temp_dir); - compile_contracts(&temp_dir); + // Tell Cargo that if a source file changes, to rerun this build script. + project.rerun_if_sources_changed(); } diff --git a/core/lib/test_contracts/src/contracts.rs b/core/lib/test_contracts/src/contracts.rs index 00742420454..10d26cd4269 100644 --- a/core/lib/test_contracts/src/contracts.rs +++ b/core/lib/test_contracts/src/contracts.rs @@ -5,44 +5,16 @@ use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use zksync_types::{Execute, H256, U256}; -macro_rules! include_contract { - ($file_name:tt :: $contract_name:tt) => { - include_str!(concat!( - env!("OUT_DIR"), - "/artifacts-zk/contracts/", - $file_name, - ".sol/", - stringify!($contract_name), - ".json" - )) - }; +mod raw { + #![allow(unused, non_upper_case_globals)] + include!(concat!(env!("OUT_DIR"), "/raw_contracts.rs")); } -const COMPLEX_UPGRADE_CONTRACT: &str = - include_contract!("complex-upgrade/complex-upgrade"::ComplexUpgrade); -const CONTEXT_CONTRACT: &str = include_contract!("context/context"::Context); -const COUNTER_CONTRACT: &str = include_contract!("counter/counter"::Counter); -const EXPENSIVE_CONTRACT: &str = include_contract!("expensive/expensive"::Expensive); -const FAILED_CALL_CONTRACT: &str = include_contract!("failed-call/failed_call"::FailedCall); -const INFINITE_LOOP_CONTRACT: &str = include_contract!("infinite/infinite"::InfiniteLoop); -const LOAD_TEST_CONTRACT: &str = include_contract!("loadnext/loadnext_contract"::LoadnextContract); -const LOAD_TEST_DEPLOYED_CONTRACT: &str = include_contract!("loadnext/loadnext_contract"::Foo); -const MANY_OWNERS_CONTRACT: &str = - include_contract!("custom-account/many-owners-custom-account"::ManyOwnersCustomAccount); -const MSG_SENDER_TEST_CONTRACT: &str = - include_contract!("complex-upgrade/msg-sender"::MsgSenderTest); -const NONCE_HOLDER_CONTRACT: &str = - include_contract!("custom-account/nonce-holder-test"::NonceHolderTest); -const PRECOMPILES_CONTRACT: &str = include_contract!("precompiles/precompiles"::Precompiles); -const PROXY_COUNTER_CONTRACT: &str = include_contract!("counter/proxy_counter"::ProxyCounter); -const SIMPLE_TRANSFER_CONTRACT: &str = - include_contract!("simple-transfer/simple-transfer"::SimpleTransfer); -const REENTRANT_RECIPIENT_CONTRACT: &str = - include_contract!("transfer/transfer"::ReentrantRecipient); -const REVERTS_TEST_CONTRACT: &str = include_contract!("error/error"::SimpleRequire); -const STORAGE_TEST_CONTRACT: &str = include_contract!("storage/storage"::StorageTester); -const TRANSFER_RECIPIENT_CONTRACT: &str = include_contract!("transfer/transfer"::Recipient); -const TRANSFER_TEST_CONTRACT: &str = include_contract!("transfer/transfer"::TransferTest); +#[derive(Debug, Clone, Copy)] +pub(crate) struct RawContract { + pub abi: &'static str, + pub bytecode: &'static [u8], +} /// Test contract consisting of deployable EraVM bytecode and Web3 ABI. #[derive(Debug, Clone)] @@ -51,28 +23,17 @@ pub struct TestContract { /// Web3 ABI of this contract. pub abi: ethabi::Contract, /// EraVM bytecode of this contract. - pub bytecode: Vec, + pub bytecode: Vec, // FIXME: change to &[u8]? /// Contract dependencies (i.e., potential factory deps to be included in the contract deployment / transactions). pub dependencies: Vec, } impl TestContract { - fn new(full_abi: &str) -> Self { - let mut raw: serde_json::Value = - serde_json::from_str(full_abi).expect("failed reading contract ABI"); - let raw = raw.as_object_mut().expect("contract is not an object"); - let abi = raw.remove("abi").expect("contract doesn't contain ABI"); - let abi = serde_json::from_value(abi).expect("failed parsing contract ABI"); - let bytecode = raw - .get("bytecode") - .expect("contract doesn't contain bytecode") - .as_str() - .expect("bytecode is not a string"); - let bytecode = bytecode.strip_prefix("0x").unwrap_or(bytecode); - let bytecode = hex::decode(bytecode).expect("invalid bytecode"); + fn new(raw: RawContract) -> Self { + let abi = serde_json::from_str(raw.abi).expect("failed parsing contract ABI"); Self { abi, - bytecode, + bytecode: raw.bytecode.to_vec(), dependencies: vec![], } } @@ -80,19 +41,21 @@ impl TestContract { /// Returns a contract used to test complex system contract upgrades. pub fn complex_upgrade() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(COMPLEX_UPGRADE_CONTRACT)); + Lazy::new(|| TestContract::new(raw::complex_upgrade::ComplexUpgrade)); &CONTRACT } /// Returns a contract used to test context methods. pub fn context_test() -> &'static Self { - static CONTRACT: Lazy = Lazy::new(|| TestContract::new(CONTEXT_CONTRACT)); + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::context::Context)); &CONTRACT } /// Returns a simple counter contract. pub fn counter() -> &'static Self { - static CONTRACT: Lazy = Lazy::new(|| TestContract::new(COUNTER_CONTRACT)); + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::counter::Counter)); &CONTRACT } @@ -100,8 +63,8 @@ impl TestContract { /// (storage reads / writes, hashing, recursion via far calls etc.). pub fn load_test() -> &'static Self { static CONTRACT: Lazy = Lazy::new(|| { - let mut contract = TestContract::new(LOAD_TEST_CONTRACT); - contract.dependencies = vec![TestContract::new(LOAD_TEST_DEPLOYED_CONTRACT)]; + let mut contract = TestContract::new(raw::loadnext::LoadnextContract); + contract.dependencies = vec![TestContract::new(raw::loadnext::Foo)]; contract }); &CONTRACT @@ -109,93 +72,97 @@ impl TestContract { /// Returns a contract with expensive storage operations. pub fn expensive() -> &'static Self { - static CONTRACT: Lazy = Lazy::new(|| TestContract::new(EXPENSIVE_CONTRACT)); + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::expensive::Expensive)); &CONTRACT } pub fn failed_call() -> &'static Self { - static CONTRACT: Lazy = Lazy::new(|| TestContract::new(FAILED_CALL_CONTRACT)); + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::failed_call::FailedCall)); &CONTRACT } /// Returns a contract with an infinite loop (useful for testing out-of-gas reverts). pub fn infinite_loop() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(INFINITE_LOOP_CONTRACT)); + Lazy::new(|| TestContract::new(raw::infinite::InfiniteLoop)); &CONTRACT } /// Returns a custom account with multiple owners. pub fn many_owners() -> &'static Self { - static CONTRACT: Lazy = Lazy::new(|| TestContract::new(MANY_OWNERS_CONTRACT)); + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::custom_account::ManyOwnersCustomAccount)); &CONTRACT } /// Returns a contract testing `msg.sender` value. pub fn msg_sender_test() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(MSG_SENDER_TEST_CONTRACT)); + Lazy::new(|| TestContract::new(raw::complex_upgrade::MsgSenderTest)); &CONTRACT } pub fn nonce_holder() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(NONCE_HOLDER_CONTRACT)); + Lazy::new(|| TestContract::new(raw::custom_account::NonceHolderTest)); &CONTRACT } /// Returns a contract testing precompiles. pub fn precompiles_test() -> &'static Self { - static CONTRACT: Lazy = Lazy::new(|| TestContract::new(PRECOMPILES_CONTRACT)); + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::precompiles::Precompiles)); &CONTRACT } /// Returns a contract proxying calls to a [counter](Self::counter()). pub fn proxy_counter() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(PROXY_COUNTER_CONTRACT)); + Lazy::new(|| TestContract::new(raw::counter::ProxyCounter)); &CONTRACT } /// Returns a reentrant recipient for transfers. pub fn reentrant_recipient() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(REENTRANT_RECIPIENT_CONTRACT)); + Lazy::new(|| TestContract::new(raw::transfer::ReentrantRecipient)); &CONTRACT } /// Returns a contract testing reverts. pub fn reverts_test() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(REVERTS_TEST_CONTRACT)); + Lazy::new(|| TestContract::new(raw::error::SimpleRequire)); &CONTRACT } /// Returns a simple fungible token contract. pub fn simple_transfer() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(SIMPLE_TRANSFER_CONTRACT)); + Lazy::new(|| TestContract::new(raw::simple_transfer::SimpleTransfer)); &CONTRACT } /// Returns a contract testing storage operations. pub fn storage_test() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(STORAGE_TEST_CONTRACT)); + Lazy::new(|| TestContract::new(raw::storage::StorageTester)); &CONTRACT } /// Returns a contract for testing base token transfers. pub fn transfer_test() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(TRANSFER_TEST_CONTRACT)); + Lazy::new(|| TestContract::new(raw::transfer::TransferTest)); &CONTRACT } /// Returns a test recipient for the [transfer test](Self::transfer_test()) contract. pub fn transfer_recipient() -> &'static Self { static CONTRACT: Lazy = - Lazy::new(|| TestContract::new(TRANSFER_RECIPIENT_CONTRACT)); + Lazy::new(|| TestContract::new(raw::transfer::Recipient)); &CONTRACT } @@ -208,7 +175,7 @@ impl TestContract { fn insert_factory_deps(&self, dest: &mut Vec>) { for deployed in &self.dependencies { - dest.push(deployed.bytecode.clone()); + dest.push(deployed.bytecode.to_vec()); deployed.insert_factory_deps(dest); } } @@ -220,7 +187,7 @@ impl TestContract { /// Generates the `Execute` payload for deploying this contract with custom salt. pub fn deploy_payload_with_salt(&self, salt: H256, args: &[Token]) -> Execute { - let mut execute = Execute::for_deploy(salt, self.bytecode.clone(), args); + let mut execute = Execute::for_deploy(salt, self.bytecode.to_vec(), args); execute.factory_deps.extend(self.factory_deps()); execute } From 900218cc3957a273b1028b2121e3ee4ea10c1d22 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 10 Oct 2024 11:40:14 +0300 Subject: [PATCH 23/32] Temporarily change transfer contracts --- core/lib/multivm/src/versions/vm_fast/tests/transfer.rs | 2 ++ core/lib/multivm/src/versions/vm_latest/tests/transfer.rs | 2 ++ .../contracts/simple-transfer/simple-transfer.sol | 6 ++++-- core/lib/test_contracts/contracts/transfer/transfer.sol | 8 ++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs index 189ac978758..de369e21393 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs @@ -94,6 +94,7 @@ fn test_send_or_transfer(test_option: TestOptions) { assert_eq!(new_recipient_balance, value); } +#[ignore] // FIXME: re-enable once zksolc errors can be suppressed #[test] fn test_send_and_transfer() { test_send_or_transfer(TestOptions::Send(U256::zero())); @@ -191,6 +192,7 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { assert!(!batch_result.result.is_failed(), "Batch wasn't successful"); } +#[ignore] // FIXME: re-enable once zksolc errors can be suppressed #[test] fn test_reentrancy_protection_send_and_transfer() { test_reentrancy_protection_send_or_transfer(TestOptions::Send(U256::zero())); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs index 51a43ad0c64..e93705ddb09 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs @@ -97,6 +97,7 @@ fn test_send_or_transfer(test_option: TestOptions) { assert_eq!(new_recipient_balance, value); } +#[ignore] // FIXME: re-enable once zksolc errors can be suppressed #[test] fn test_send_and_transfer() { test_send_or_transfer(TestOptions::Send(U256::zero())); @@ -196,6 +197,7 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { assert!(!batch_result.result.is_failed(), "Batch wasn't successful"); } +#[ignore] // FIXME: re-enable once zksolc errors can be suppressed #[test] fn test_reentrancy_protection_send_and_transfer() { test_reentrancy_protection_send_or_transfer(TestOptions::Send(U256::zero())); diff --git a/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol b/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol index 591e97cc1ae..3aa294056a0 100644 --- a/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol +++ b/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol @@ -19,13 +19,15 @@ contract SimpleTransfer { // Function to withdraw Ether to the owner's address function withdraw(uint _amount) public onlyOwner { require(address(this).balance >= _amount, "Insufficient balance in contract"); - payable(owner).transfer(_amount); + (bool success, ) = owner.call{value: _amount}(""); + require(success, "transfer reverted"); } // Function to transfer Ether from this contract to any address function transfer(address _to, uint _amount) public onlyOwner { require(address(this).balance >= _amount, "Insufficient balance in contract"); - payable(_to).transfer(_amount); + (bool success, ) = _to.call{value: _amount}(""); + require(success, "transfer reverted"); } // Function to check the contract's balance diff --git a/core/lib/test_contracts/contracts/transfer/transfer.sol b/core/lib/test_contracts/contracts/transfer/transfer.sol index 4c63a2e9c7d..4911c4cef09 100644 --- a/core/lib/test_contracts/contracts/transfer/transfer.sol +++ b/core/lib/test_contracts/contracts/transfer/transfer.sol @@ -4,17 +4,17 @@ pragma solidity ^0.8.0; contract TransferTest { function transfer(address payable to, uint256 amount) public payable { - to.transfer(amount); + (bool success, ) = to.call{value: amount}(""); // FIXME: revert; required because it's impossible to suppress errors + require(success, "transfer reverted"); } function send(address payable to, uint256 amount) public payable { - bool success = to.send(amount); - + (bool success, ) = to.call{value: amount}(""); // FIXME: revert; required because it's impossible to suppress errors require(success, "Transaction failed"); } receive() external payable { - + // Do nothing } } From 8025544814e2b2c1b145cceaafb7d236737d3f6b Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 10 Oct 2024 12:32:15 +0300 Subject: [PATCH 24/32] Remove `yarn` dependency --- core/lib/test_contracts/README.md | 2 +- core/lib/test_contracts/build.rs | 19 +- .../contract-libs/openzeppelin-contracts | 1 + .../custom-account/interfaces/IERC20.sol | 82 - core/lib/test_contracts/hardhat.config.ts | 36 - core/lib/test_contracts/package.json | 19 - core/lib/test_contracts/src/contracts.rs | 5 + core/lib/test_contracts/yarn.lock | 2421 ----------------- 8 files changed, 23 insertions(+), 2562 deletions(-) create mode 120000 core/lib/test_contracts/contract-libs/openzeppelin-contracts delete mode 100644 core/lib/test_contracts/contracts/custom-account/interfaces/IERC20.sol delete mode 100644 core/lib/test_contracts/hardhat.config.ts delete mode 100644 core/lib/test_contracts/package.json delete mode 100644 core/lib/test_contracts/yarn.lock diff --git a/core/lib/test_contracts/README.md b/core/lib/test_contracts/README.md index 4e8cb91f83f..2c5515269d4 100644 --- a/core/lib/test_contracts/README.md +++ b/core/lib/test_contracts/README.md @@ -12,5 +12,5 @@ Some of the commonly used contracts included into this crate are: ## Building -Building the library requires `yarn` installed globally. If there are any issues during build, it could be useful +Building the library relies on `foundry-compilers`; it doesn't require any external tools. If there are any issues during build, it may be useful to inspect build artifacts, which are located in one of `target/{debug,release}/build/zksync_test_contracts-$random_numbers` directories. diff --git a/core/lib/test_contracts/build.rs b/core/lib/test_contracts/build.rs index fc8aeb98688..4df672c1b98 100644 --- a/core/lib/test_contracts/build.rs +++ b/core/lib/test_contracts/build.rs @@ -7,8 +7,9 @@ use std::{ }; use foundry_compilers::{ - artifacts::zksolc::output_selection::{ - FileOutputSelection, OutputSelection, OutputSelectionFlag, + artifacts::{ + zksolc::output_selection::{FileOutputSelection, OutputSelection, OutputSelectionFlag}, + Remapping, }, solc, zksolc::{settings::Optimizer, ZkSettings, ZkSolcCompiler, ZkSolcSettings}, @@ -77,15 +78,19 @@ fn save_artifacts( } } +/// `zksolc` compiler settings. +/// fn compiler_settings() -> ZkSolcSettings { ZkSolcSettings { cli_settings: solc::CliSettings::default(), settings: ZkSettings { - via_ir: Some(true), + // Optimizer must be enabled; otherwise, system calls work incorrectly for whatever reason optimizer: Optimizer { enabled: Some(true), ..Optimizer::default() }, + // Required by optimizer + via_ir: Some(true), output_selection: OutputSelection { all: Some(FileOutputSelection { per_file: None, @@ -103,6 +108,14 @@ fn main() { let temp_dir = PathBuf::from(env::var("OUT_DIR").expect("no `OUT_DIR` provided")); let paths = ProjectPathsConfig::builder() .sources(Path::new(env!("CARGO_MANIFEST_DIR")).join("contracts")) + .remapping(Remapping { + context: None, + name: "@openzeppelin/contracts".into(), + path: format!( + "{}/contract-libs/openzeppelin-contracts/contracts", + env!("CARGO_MANIFEST_DIR") + ), + }) .artifacts(temp_dir.join("artifacts")) .cache(temp_dir.join("cache")) .build() diff --git a/core/lib/test_contracts/contract-libs/openzeppelin-contracts b/core/lib/test_contracts/contract-libs/openzeppelin-contracts new file mode 120000 index 00000000000..a601fb05eb6 --- /dev/null +++ b/core/lib/test_contracts/contract-libs/openzeppelin-contracts @@ -0,0 +1 @@ +../../../../contracts/l1-contracts/lib/openzeppelin-contracts \ No newline at end of file diff --git a/core/lib/test_contracts/contracts/custom-account/interfaces/IERC20.sol b/core/lib/test_contracts/contracts/custom-account/interfaces/IERC20.sol deleted file mode 100644 index b816bfed086..00000000000 --- a/core/lib/test_contracts/contracts/custom-account/interfaces/IERC20.sol +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) - -pragma solidity ^0.8.0; - -/** - * @dev Interface of the ERC20 standard as defined in the EIP. - */ -interface IERC20 { - /** - * @dev Emitted when `value` tokens are moved from one account (`from`) to - * another (`to`). - * - * Note that `value` may be zero. - */ - event Transfer(address indexed from, address indexed to, uint256 value); - - /** - * @dev Emitted when the allowance of a `spender` for an `owner` is set by - * a call to {approve}. `value` is the new allowance. - */ - event Approval(address indexed owner, address indexed spender, uint256 value); - - /** - * @dev Returns the amount of tokens in existence. - */ - function totalSupply() external view returns (uint256); - - /** - * @dev Returns the amount of tokens owned by `account`. - */ - function balanceOf(address account) external view returns (uint256); - - /** - * @dev Moves `amount` tokens from the caller's account to `to`. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transfer(address to, uint256 amount) external returns (bool); - - /** - * @dev Returns the remaining number of tokens that `spender` will be - * allowed to spend on behalf of `owner` through {transferFrom}. This is - * zero by default. - * - * This value changes when {approve} or {transferFrom} are called. - */ - function allowance(address owner, address spender) external view returns (uint256); - - /** - * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * IMPORTANT: Beware that changing an allowance with this method brings the risk - * that someone may use both the old and the new allowance by unfortunate - * transaction ordering. One possible solution to mitigate this race - * condition is to first reduce the spender's allowance to 0 and set the - * desired value afterwards: - * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - * - * Emits an {Approval} event. - */ - function approve(address spender, uint256 amount) external returns (bool); - - /** - * @dev Moves `amount` tokens from `from` to `to` using the - * allowance mechanism. `amount` is then deducted from the caller's - * allowance. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transferFrom( - address from, - address to, - uint256 amount - ) external returns (bool); -} diff --git a/core/lib/test_contracts/hardhat.config.ts b/core/lib/test_contracts/hardhat.config.ts deleted file mode 100644 index 584b804026c..00000000000 --- a/core/lib/test_contracts/hardhat.config.ts +++ /dev/null @@ -1,36 +0,0 @@ -import '@matterlabs/hardhat-zksync-solc'; - -const COMPILER_VERSION = '1.5.0'; -const PRE_RELEASE_VERSION = 'prerelease-a167aa3-code4rena'; - -function getZksolcUrl(): string { - // @ts-ignore - const platform = { darwin: 'macosx', linux: 'linux', win32: 'windows' }[process.platform]; - // @ts-ignore - const toolchain = { linux: '-musl', win32: '-gnu', darwin: '' }[process.platform]; - const arch = process.arch === 'x64' ? 'amd64' : process.arch; - const ext = process.platform === 'win32' ? '.exe' : ''; - - return `https://github.com/matter-labs/era-compiler-solidity/releases/download/${PRE_RELEASE_VERSION}/zksolc-${platform}-${arch}${toolchain}-v${COMPILER_VERSION}${ext}`; -} - -export default { - zksolc: { - compilerSource: 'binary', - settings: { - compilerPath: getZksolcUrl(), - isSystem: true - } - }, - networks: { - hardhat: { - zksync: true - } - }, - solidity: { - version: '0.8.24', - settings: { - evmVersion: 'cancun' - } - }, -}; diff --git a/core/lib/test_contracts/package.json b/core/lib/test_contracts/package.json deleted file mode 100644 index 7e09fd9e089..00000000000 --- a/core/lib/test_contracts/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "@zksync/test-contracts", - "version": "0.1.0", - "private": true, - "license": "MIT OR Apache-2.0", - "dependencies": { - "@openzeppelin/contracts": "^4.8.0", - "hardhat": "=2.22.2", - "ts-node": "^10.1.0", - "typescript": "^4.3.5" - }, - "devDependencies": { - "@matterlabs/hardhat-zksync-solc": "^0.3.15" - }, - "scripts": { - "build": "hardhat compile", - "clean": "hardhat clean" - } -} diff --git a/core/lib/test_contracts/src/contracts.rs b/core/lib/test_contracts/src/contracts.rs index 10d26cd4269..c7c70c1137f 100644 --- a/core/lib/test_contracts/src/contracts.rs +++ b/core/lib/test_contracts/src/contracts.rs @@ -5,11 +5,16 @@ use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use zksync_types::{Execute, H256, U256}; +/// The structure of produced modules is as follows: +/// +/// - Each dir in `/contracts` translates into a module with the same name (just with `-` chars replaced with `_`). +/// - Each contract in all files in this dir produces a `RawContract` constant with the same name as the contract. mod raw { #![allow(unused, non_upper_case_globals)] include!(concat!(env!("OUT_DIR"), "/raw_contracts.rs")); } +/// Raw contracts produced by the build script. #[derive(Debug, Clone, Copy)] pub(crate) struct RawContract { pub abi: &'static str, diff --git a/core/lib/test_contracts/yarn.lock b/core/lib/test_contracts/yarn.lock deleted file mode 100644 index c1afeb348dc..00000000000 --- a/core/lib/test_contracts/yarn.lock +++ /dev/null @@ -1,2421 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@balena/dockerignore@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@balena/dockerignore/-/dockerignore-1.0.2.tgz#9ffe4726915251e8eb69f44ef3547e0da2c03e0d" - integrity sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q== - -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - -"@ethersproject/abi@^5.1.2": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" - integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/abstract-provider@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" - integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - -"@ethersproject/abstract-signer@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" - integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - -"@ethersproject/address@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" - integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - -"@ethersproject/base64@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" - integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== - dependencies: - "@ethersproject/bytes" "^5.7.0" - -"@ethersproject/bignumber@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" - integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - bn.js "^5.2.1" - -"@ethersproject/bytes@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" - integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/constants@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" - integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - -"@ethersproject/hash@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" - integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/keccak256@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" - integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" - integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== - -"@ethersproject/networks@^5.7.0": - version "5.7.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" - integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/properties@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" - integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/rlp@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" - integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/signing-key@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" - integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - bn.js "^5.2.1" - elliptic "6.5.4" - hash.js "1.1.7" - -"@ethersproject/strings@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" - integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/transactions@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" - integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - -"@ethersproject/web@^5.7.0": - version "5.7.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" - integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== - dependencies: - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@fastify/busboy@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.0.0.tgz#f22824caff3ae506b18207bad4126dbc6ccdb6b8" - integrity sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ== - -"@jridgewell/resolve-uri@^3.0.3": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" - integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== - -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" - integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== - -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@matterlabs/hardhat-zksync-solc@^0.3.15": - version "0.3.17" - resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.3.17.tgz#72f199544dc89b268d7bfc06d022a311042752fd" - integrity sha512-aZgQ0yfXW5xPkfuEH1d44ncWV4T2LzKZd0VVPo4PL5cUrYs2/II1FaEDp5zsf3FxOR1xT3mBsjuSrtJkk4AL8Q== - dependencies: - "@nomiclabs/hardhat-docker" "^2.0.0" - chalk "4.1.2" - dockerode "^3.3.4" - -"@metamask/eth-sig-util@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" - integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== - dependencies: - ethereumjs-abi "^0.6.8" - ethereumjs-util "^6.2.1" - ethjs-util "^0.1.6" - tweetnacl "^1.0.3" - tweetnacl-util "^0.15.1" - -"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" - integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== - -"@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" - integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== - -"@nomicfoundation/edr-darwin-arm64@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.8.tgz#09de1f03c0336670fce959f376f0fe9137545836" - integrity sha512-eB0leCexS8sQEmfyD72cdvLj9djkBzQGP4wSQw6SNf2I4Sw4Cnzb3d45caG2FqFFjbvfqL0t+badUUIceqQuMw== - -"@nomicfoundation/edr-darwin-x64@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.8.tgz#c3ca237c74ed3b6fb800fd7f1de7174f4ad24f72" - integrity sha512-JksVCS1N5ClwVF14EvO25HCQ+Laljh/KRfHERMVAC9ZwPbTuAd/9BtKvToCBi29uCHWqsXMI4lxCApYQv2nznw== - -"@nomicfoundation/edr-linux-arm64-gnu@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.8.tgz#08bd367789e745f4e78a8a87368fc470eea8a7de" - integrity sha512-raCE+fOeNXhVBLUo87cgsHSGvYYRB6arih4eG6B9KGACWK5Veebtm9xtKeiD8YCsdUlUfat6F7ibpeNm91fpsA== - -"@nomicfoundation/edr-linux-arm64-musl@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.8.tgz#9cab5cbec0052cb5812c6c66c463d28a756cd916" - integrity sha512-PwiDp4wBZWMCIy29eKkv8moTKRrpiSDlrc+GQMSZLhOAm8T33JKKXPwD/2EbplbhCygJDGXZdtEKl9x9PaH66A== - -"@nomicfoundation/edr-linux-x64-gnu@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.8.tgz#d4a11b6ebcd1b29d7431d185c6df3e65a2cd4bde" - integrity sha512-6AcvA/XKoipGap5jJmQ9Y6yT7Uf39D9lu2hBcDCXnXbMcXaDGw4mn1/L4R63D+9VGZyu1PqlcJixCUZlGGIWlg== - -"@nomicfoundation/edr-linux-x64-musl@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.8.tgz#b8eef960d06380a365866ddd1e97ecb7fbf6bd70" - integrity sha512-cxb0sEmZjlwhYWO28sPsV64VDx31ekskhC1IsDXU1p9ntjHSJRmW4KEIqJ2O3QwJap/kLKfMS6TckvY10gjc6w== - -"@nomicfoundation/edr-win32-x64-msvc@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.8.tgz#ac7061aeb07cc847c429513080b76bb05297a869" - integrity sha512-yVuVPqRRNLZk7TbBMkKw7lzCvI8XO8fNTPTYxymGadjr9rEGRuNTU1yBXjfJ59I1jJU/X2TSkRk1OFX0P5tpZQ== - -"@nomicfoundation/edr@^0.3.1": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.8.tgz#28fe7ae4f462ae74a16cd1a714ff7b1cd9c22b4c" - integrity sha512-u2UJ5QpznSHVkZRh6ePWoeVb6kmPrrqh08gCnZ9FHlJV9CITqlrTQHJkacd+INH31jx88pTAJnxePE4XAiH5qg== - dependencies: - "@nomicfoundation/edr-darwin-arm64" "0.3.8" - "@nomicfoundation/edr-darwin-x64" "0.3.8" - "@nomicfoundation/edr-linux-arm64-gnu" "0.3.8" - "@nomicfoundation/edr-linux-arm64-musl" "0.3.8" - "@nomicfoundation/edr-linux-x64-gnu" "0.3.8" - "@nomicfoundation/edr-linux-x64-musl" "0.3.8" - "@nomicfoundation/edr-win32-x64-msvc" "0.3.8" - -"@nomicfoundation/ethereumjs-common@4.0.4": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz#9901f513af2d4802da87c66d6f255b510bef5acb" - integrity sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg== - dependencies: - "@nomicfoundation/ethereumjs-util" "9.0.4" - -"@nomicfoundation/ethereumjs-rlp@5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz#66c95256fc3c909f6fb18f6a586475fc9762fa30" - integrity sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw== - -"@nomicfoundation/ethereumjs-tx@5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz#b0ceb58c98cc34367d40a30d255d6315b2f456da" - integrity sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - ethereum-cryptography "0.1.3" - -"@nomicfoundation/ethereumjs-util@9.0.4": - version "9.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz#84c5274e82018b154244c877b76bc049a4ed7b38" - integrity sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q== - dependencies: - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - ethereum-cryptography "0.1.3" - -"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" - integrity sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w== - -"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz#6e25ccdf6e2d22389c35553b64fe6f3fdaec432c" - integrity sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA== - -"@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz#0a224ea50317139caeebcdedd435c28a039d169c" - integrity sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA== - -"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz#dfa085d9ffab9efb2e7b383aed3f557f7687ac2b" - integrity sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg== - -"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz#c9e06b5d513dd3ab02a7ac069c160051675889a4" - integrity sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w== - -"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz#8d328d16839e52571f72f2998c81e46bf320f893" - integrity sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA== - -"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz#9b49d0634b5976bb5ed1604a1e1b736f390959bb" - integrity sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w== - -"@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz#e2867af7264ebbcc3131ef837878955dd6a3676f" - integrity sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg== - -"@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz#0685f78608dd516c8cdfb4896ed451317e559585" - integrity sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ== - -"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz#c9a44f7108646f083b82e851486e0f6aeb785836" - integrity sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw== - -"@nomicfoundation/solidity-analyzer@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz#f5f4d36d3f66752f59a57e7208cd856f3ddf6f2d" - integrity sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg== - optionalDependencies: - "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.1" - "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.1" - "@nomicfoundation/solidity-analyzer-freebsd-x64" "0.1.1" - "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.1" - "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.1" - "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.1" - "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.1" - "@nomicfoundation/solidity-analyzer-win32-arm64-msvc" "0.1.1" - "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" - "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" - -"@nomiclabs/hardhat-docker@^2.0.0": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-docker/-/hardhat-docker-2.0.2.tgz#ae964be17951275a55859ff7358e9e7c77448846" - integrity sha512-XgGEpRT3wlA1VslyB57zyAHV+oll8KnV1TjwnxxC1tpAL04/lbdwpdO5KxInVN8irMSepqFpsiSkqlcnvbE7Ng== - dependencies: - dockerode "^2.5.8" - fs-extra "^7.0.1" - node-fetch "^2.6.0" - -"@openzeppelin/contracts@^4.8.0": - version "4.9.3" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" - integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== - -"@scure/base@~1.1.0": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" - integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== - -"@scure/bip32@1.1.5": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" - integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== - dependencies: - "@noble/hashes" "~1.2.0" - "@noble/secp256k1" "~1.7.0" - "@scure/base" "~1.1.0" - -"@scure/bip39@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" - integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== - dependencies: - "@noble/hashes" "~1.2.0" - "@scure/base" "~1.1.0" - -"@sentry/core@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" - integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/minimal" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/hub@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" - integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== - dependencies: - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/minimal@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" - integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/types" "5.30.0" - tslib "^1.9.3" - -"@sentry/node@^5.18.1": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" - integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== - dependencies: - "@sentry/core" "5.30.0" - "@sentry/hub" "5.30.0" - "@sentry/tracing" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - cookie "^0.4.1" - https-proxy-agent "^5.0.0" - lru_map "^0.3.3" - tslib "^1.9.3" - -"@sentry/tracing@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" - integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== - dependencies: - "@sentry/hub" "5.30.0" - "@sentry/minimal" "5.30.0" - "@sentry/types" "5.30.0" - "@sentry/utils" "5.30.0" - tslib "^1.9.3" - -"@sentry/types@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" - integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== - -"@sentry/utils@5.30.0": - version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" - integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== - dependencies: - "@sentry/types" "5.30.0" - tslib "^1.9.3" - -"@tsconfig/node10@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" - integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - -"@types/bn.js@^4.11.3": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" - -"@types/bn.js@^5.1.0": - version "5.1.5" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" - integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== - dependencies: - "@types/node" "*" - -"@types/lru-cache@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" - integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== - -"@types/node@*": - version "20.9.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298" - integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw== - dependencies: - undici-types "~5.26.4" - -"@types/pbkdf2@^3.0.0": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.2.tgz#2dc43808e9985a2c69ff02e2d2027bd4fe33e8dc" - integrity sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew== - dependencies: - "@types/node" "*" - -"@types/secp256k1@^4.0.1": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.6.tgz#d60ba2349a51c2cbc5e816dcd831a42029d376bf" - integrity sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ== - dependencies: - "@types/node" "*" - -JSONStream@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" - integrity sha512-mn0KSip7N4e0UDPZHnqDsHECo5uGQrixQKnAskOM1BIB8hd7QKbd6il8IPRPudPHOeHiECoCFqhyMaRO9+nWyA== - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -acorn-walk@^8.1.1: - version "8.3.4" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" - integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== - dependencies: - acorn "^8.11.0" - -acorn@^8.11.0, acorn@^8.4.1: - version "8.12.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" - integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== - -adm-zip@^0.4.16: - version "0.4.16" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" - integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -aggregate-error@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" - integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== - dependencies: - clean-stack "^2.0.0" - indent-string "^4.0.0" - -ansi-align@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" - integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== - dependencies: - string-width "^4.1.0" - -ansi-colors@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-colors@^4.1.1: - version "4.1.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" - integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== - -ansi-escapes@^4.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -asn1@^0.2.6: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base-x@^3.0.2: - version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== - dependencies: - safe-buffer "^5.0.1" - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bcrypt-pbkdf@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== - dependencies: - tweetnacl "^0.14.3" - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -bl@^1.0.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" - integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - -bl@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -blakejs@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" - integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== - -bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.2.0, bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - -boxen@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" - integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^6.2.0" - chalk "^4.1.0" - cli-boxes "^2.2.1" - string-width "^4.2.2" - type-fest "^0.20.2" - widest-line "^3.1.0" - wrap-ansi "^7.0.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -bs58@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== - dependencies: - base-x "^3.0.2" - -bs58check@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== - dependencies: - bs58 "^4.0.0" - create-hash "^1.1.0" - safe-buffer "^5.1.2" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ== - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== - -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -buildcheck@~0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/buildcheck/-/buildcheck-0.0.6.tgz#89aa6e417cfd1e2196e3f8fe915eb709d2fe4238" - integrity sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A== - -bytes@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== - -camelcase@^6.0.0, camelcase@^6.2.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -chalk@4.1.2, chalk@^4.1.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chokidar@3.5.3, chokidar@^3.4.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -chownr@^1.0.1, chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - -cli-boxes@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" - integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -command-exists@^1.2.8: - version "1.2.9" - resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" - integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== - -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -concat-stream@~1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -cookie@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" - integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cpu-features@~0.0.8: - version "0.0.9" - resolved "https://registry.yarnpkg.com/cpu-features/-/cpu-features-0.0.9.tgz#5226b92f0f1c63122b0a3eb84cb8335a4de499fc" - integrity sha512-AKjgn2rP2yJyfbepsmLfiYcmtNn/2eUvocUyM/09yB0YDiz39HteK/5/T4Onf0pmdYDMgkBoGvRLvEguzyL7wQ== - dependencies: - buildcheck "~0.0.6" - nan "^2.17.0" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - -debug@4, debug@4.3.4, debug@^4.1.1: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -debug@^3.2.6: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -decamelize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== - -depd@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -diff@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -docker-modem@^1.0.8: - version "1.0.9" - resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-1.0.9.tgz#a1f13e50e6afb6cf3431b2d5e7aac589db6aaba8" - integrity sha512-lVjqCSCIAUDZPAZIeyM125HXfNvOmYYInciphNrLrylUtKyW66meAjSPXWchKVzoIYZx69TPnAepVSSkeawoIw== - dependencies: - JSONStream "1.3.2" - debug "^3.2.6" - readable-stream "~1.0.26-4" - split-ca "^1.0.0" - -docker-modem@^3.0.0: - version "3.0.8" - resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-3.0.8.tgz#ef62c8bdff6e8a7d12f0160988c295ea8705e77a" - integrity sha512-f0ReSURdM3pcKPNS30mxOHSbaFLcknGmQjwSfmbcdOw1XWKXVhukM3NJHhr7NpY9BIyyWQb0EBo3KQvvuU5egQ== - dependencies: - debug "^4.1.1" - readable-stream "^3.5.0" - split-ca "^1.0.1" - ssh2 "^1.11.0" - -dockerode@^2.5.8: - version "2.5.8" - resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-2.5.8.tgz#1b661e36e1e4f860e25f56e0deabe9f87f1d0acc" - integrity sha512-+7iOUYBeDTScmOmQqpUYQaE7F4vvIt6+gIZNHWhqAQEI887tiPFB9OvXI/HzQYqfUNvukMK+9myLW63oTJPZpw== - dependencies: - concat-stream "~1.6.2" - docker-modem "^1.0.8" - tar-fs "~1.16.3" - -dockerode@^3.3.4: - version "3.3.5" - resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.5.tgz#7ae3f40f2bec53ae5e9a741ce655fff459745629" - integrity sha512-/0YNa3ZDNeLr/tSckmD69+Gq+qVNhvKfAHNeZJBnp7EOP6RGKV8ORrJHkUn20So5wU+xxT7+1n5u8PjHbfjbSA== - dependencies: - "@balena/dockerignore" "^1.0.2" - docker-modem "^3.0.0" - tar-fs "~2.0.1" - -elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -enquirer@^2.3.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" - integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== - dependencies: - ansi-colors "^4.1.1" - strip-ansi "^6.0.1" - -env-paths@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" - integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== - dependencies: - "@types/pbkdf2" "^3.0.0" - "@types/secp256k1" "^4.0.1" - blakejs "^1.1.0" - browserify-aes "^1.2.0" - bs58check "^2.1.2" - create-hash "^1.2.0" - create-hmac "^1.1.7" - hash.js "^1.1.7" - keccak "^3.0.0" - pbkdf2 "^3.0.17" - randombytes "^2.1.0" - safe-buffer "^5.1.2" - scrypt-js "^3.0.0" - secp256k1 "^4.0.1" - setimmediate "^1.0.5" - -ethereum-cryptography@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" - integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== - dependencies: - "@noble/hashes" "1.2.0" - "@noble/secp256k1" "1.7.1" - "@scure/bip32" "1.1.5" - "@scure/bip39" "1.1.1" - -ethereumjs-abi@^0.6.8: - version "0.6.8" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" - integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" - integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.3" - -ethjs-util@0.1.6, ethjs-util@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" - integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== - dependencies: - is-hex-prefixed "1.0.0" - strip-hex-prefix "1.0.0" - -evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== - dependencies: - locate-path "^2.0.0" - -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - -follow-redirects@^1.12.1: - version "1.15.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" - integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== - -fp-ts@1.19.3: - version "1.19.3" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" - integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== - -fp-ts@^1.0.0: - version "1.19.5" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" - integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - -fs-extra@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -hardhat@=2.22.2: - version "2.22.2" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.2.tgz#0cadd7ec93bf39bab09f81603e75bc5e92acea3d" - integrity sha512-0xZ7MdCZ5sJem4MrvpQWLR3R3zGDoHw5lsR+pBFimqwagimIOn3bWuZv69KA+veXClwI1s/zpqgwPwiFrd4Dxw== - dependencies: - "@ethersproject/abi" "^5.1.2" - "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/edr" "^0.3.1" - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - "@nomicfoundation/solidity-analyzer" "^0.1.0" - "@sentry/node" "^5.18.1" - "@types/bn.js" "^5.1.0" - "@types/lru-cache" "^5.1.0" - adm-zip "^0.4.16" - aggregate-error "^3.0.0" - ansi-escapes "^4.3.0" - boxen "^5.1.2" - chalk "^2.4.2" - chokidar "^3.4.0" - ci-info "^2.0.0" - debug "^4.1.1" - enquirer "^2.3.0" - env-paths "^2.2.0" - ethereum-cryptography "^1.0.3" - ethereumjs-abi "^0.6.8" - find-up "^2.1.0" - fp-ts "1.19.3" - fs-extra "^7.0.1" - glob "7.2.0" - immutable "^4.0.0-rc.12" - io-ts "1.10.4" - keccak "^3.0.2" - lodash "^4.17.11" - mnemonist "^0.38.0" - mocha "^10.0.0" - p-map "^4.0.0" - raw-body "^2.4.1" - resolve "1.17.0" - semver "^6.3.0" - solc "0.7.3" - source-map-support "^0.5.13" - stacktrace-parser "^0.1.10" - tsort "0.0.1" - undici "^5.14.0" - uuid "^8.3.2" - ws "^7.4.6" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== - dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" - -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -immutable@^4.0.0-rc.12: - version "4.3.4" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f" - integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA== - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -io-ts@1.10.4: - version "1.10.4" - resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" - integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== - dependencies: - fp-ts "^1.0.0" - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-hex-prefixed@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -js-sha3@0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -js-yaml@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== - optionalDependencies: - graceful-fs "^4.1.6" - -jsonparse@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== - -keccak@^3.0.0, keccak@^3.0.2: - version "3.0.4" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" - integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.0" - -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== - optionalDependencies: - graceful-fs "^4.1.9" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash@^4.17.11: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - -lru_map@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" - integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== - -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -memorystream@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" - integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== - -minimatch@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" - integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== - dependencies: - brace-expansion "^2.0.1" - -minimatch@^3.0.4, minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.6: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -mkdirp-classic@^0.5.2: - version "0.5.3" - resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" - integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== - -mkdirp@^0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - -mnemonist@^0.38.0: - version "0.38.5" - resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" - integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== - dependencies: - obliterator "^2.0.0" - -mocha@^10.0.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" - integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== - dependencies: - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.5.3" - debug "4.3.4" - diff "5.0.0" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.2.0" - he "1.2.0" - js-yaml "4.1.0" - log-symbols "4.1.0" - minimatch "5.0.1" - ms "2.1.3" - nanoid "3.3.3" - serialize-javascript "6.0.0" - strip-json-comments "3.1.1" - supports-color "8.1.1" - workerpool "6.2.1" - yargs "16.2.0" - yargs-parser "20.2.4" - yargs-unparser "2.0.0" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@2.1.3, ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -nan@^2.17.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" - integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== - -nanoid@3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" - integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== - -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-fetch@^2.6.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - -node-gyp-build@^4.2.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" - integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -obliterator@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" - integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== - dependencies: - p-limit "^1.1.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -pbkdf2@^3.0.17: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -pump@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" - integrity sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -raw-body@^2.4.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" - integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - -readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5: - version "2.3.8" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" - integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@~1.0.26-4: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -require-from-string@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -resolve@1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - -rimraf@^2.2.8: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rlp@^2.2.3: - version "2.2.7" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" - integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== - dependencies: - bn.js "^5.2.0" - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -scrypt-js@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - -secp256k1@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" - integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== - dependencies: - elliptic "^6.5.4" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -semver@^5.5.0: - version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@^6.3.0: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -serialize-javascript@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -solc@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" - integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - follow-redirects "^1.12.1" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -source-map-support@^0.5.13: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -split-ca@^1.0.0, split-ca@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/split-ca/-/split-ca-1.0.1.tgz#6c83aff3692fa61256e0cd197e05e9de157691a6" - integrity sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ== - -ssh2@^1.11.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/ssh2/-/ssh2-1.14.0.tgz#8f68440e1b768b66942c9e4e4620b2725b3555bb" - integrity sha512-AqzD1UCqit8tbOKoj6ztDDi1ffJZ2rV2SwlgrVVrHPkV5vWqGJOVp5pmtj18PunkPJAuKQsnInyKV+/Nb2bUnA== - dependencies: - asn1 "^0.2.6" - bcrypt-pbkdf "^1.0.2" - optionalDependencies: - cpu-features "~0.0.8" - nan "^2.17.0" - -stacktrace-parser@^0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" - integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== - dependencies: - type-fest "^0.7.1" - -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-hex-prefix@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== - dependencies: - is-hex-prefixed "1.0.0" - -strip-json-comments@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -tar-fs@~1.16.3: - version "1.16.3" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" - integrity sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw== - dependencies: - chownr "^1.0.1" - mkdirp "^0.5.1" - pump "^1.0.0" - tar-stream "^1.1.2" - -tar-fs@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.1.tgz#e44086c1c60d31a4f0cf893b1c4e155dabfae9e2" - integrity sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA== - dependencies: - chownr "^1.1.1" - mkdirp-classic "^0.5.2" - pump "^3.0.0" - tar-stream "^2.0.0" - -tar-stream@^1.1.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== - dependencies: - bl "^1.0.0" - buffer-alloc "^1.2.0" - end-of-stream "^1.0.0" - fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.1" - xtend "^4.0.0" - -tar-stream@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" - integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - -"through@>=2.2.7 <3": - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - -tmp@0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -to-buffer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - -ts-node@^10.1.0: - version "10.9.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" - integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - -tslib@^1.9.3: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsort@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" - integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== - -tweetnacl-util@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" - integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== - -tweetnacl@^0.14.3: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== - -tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" - integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== - -typescript@^4.3.5: - version "4.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" - integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -undici@^5.14.0: - version "5.27.2" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.27.2.tgz#a270c563aea5b46cc0df2550523638c95c5d4411" - integrity sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ== - dependencies: - "@fastify/busboy" "^2.0.0" - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -unpipe@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -widest-line@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" - integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== - dependencies: - string-width "^4.0.0" - -workerpool@6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" - integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -ws@^7.4.6: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== - -xtend@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yargs-parser@20.2.4: - version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-unparser@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== - dependencies: - camelcase "^6.0.0" - decamelize "^4.0.0" - flat "^5.0.2" - is-plain-obj "^2.1.0" - -yargs@16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From ccdb2da8edec18a418c3e71b8027afa6543c3ecf Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 10 Oct 2024 12:43:07 +0300 Subject: [PATCH 25/32] Change `TestContract.bytecode` type --- core/lib/multivm/src/versions/tests.rs | 4 ++-- .../src/versions/vm_fast/tests/block_tip.rs | 2 +- .../versions/vm_fast/tests/bytecode_publishing.rs | 4 ++-- .../src/versions/vm_fast/tests/code_oracle.rs | 14 +++++++------- .../versions/vm_fast/tests/get_used_contracts.rs | 4 ++-- .../src/versions/vm_fast/tests/is_write_initial.rs | 2 +- .../src/versions/vm_fast/tests/l1_tx_execution.rs | 2 +- .../src/versions/vm_fast/tests/nonce_holder.rs | 2 +- .../src/versions/vm_fast/tests/precompiles.rs | 4 ++-- .../multivm/src/versions/vm_fast/tests/refunds.rs | 4 ++-- .../src/versions/vm_fast/tests/require_eip712.rs | 2 +- .../src/versions/vm_fast/tests/rollbacks.rs | 4 ++-- .../multivm/src/versions/vm_fast/tests/storage.rs | 2 +- .../vm_fast/tests/tracing_execution_error.rs | 2 +- .../multivm/src/versions/vm_fast/tests/transfer.rs | 8 ++++---- .../multivm/src/versions/vm_fast/tests/upgrade.rs | 12 ++++++------ .../src/versions/vm_latest/tests/block_tip.rs | 2 +- .../vm_latest/tests/bytecode_publishing.rs | 4 ++-- .../src/versions/vm_latest/tests/call_tracer.rs | 2 +- .../src/versions/vm_latest/tests/code_oracle.rs | 14 +++++++------- .../versions/vm_latest/tests/get_used_contracts.rs | 4 ++-- .../versions/vm_latest/tests/is_write_initial.rs | 2 +- .../versions/vm_latest/tests/l1_tx_execution.rs | 2 +- .../src/versions/vm_latest/tests/migration.rs | 2 +- .../src/versions/vm_latest/tests/nonce_holder.rs | 2 +- .../src/versions/vm_latest/tests/precompiles.rs | 4 ++-- .../src/versions/vm_latest/tests/refunds.rs | 4 ++-- .../src/versions/vm_latest/tests/require_eip712.rs | 2 +- .../src/versions/vm_latest/tests/rollbacks.rs | 6 +++--- .../src/versions/vm_latest/tests/storage.rs | 2 +- .../versions/vm_latest/tests/tester/vm_tester.rs | 2 +- .../vm_latest/tests/tracing_execution_error.rs | 2 +- .../src/versions/vm_latest/tests/transfer.rs | 8 ++++---- .../src/versions/vm_latest/tests/upgrade.rs | 12 ++++++------ core/lib/test_contracts/src/contracts.rs | 4 ++-- core/node/api_server/src/testonly.rs | 10 +++++----- core/node/state_keeper/src/executor/tests/mod.rs | 2 +- .../node/state_keeper/src/executor/tests/tester.rs | 8 ++++---- .../loadnext/src/account/tx_command_executor.rs | 2 +- 39 files changed, 87 insertions(+), 87 deletions(-) diff --git a/core/lib/multivm/src/versions/tests.rs b/core/lib/multivm/src/versions/tests.rs index 0a62fc52613..2339b3d6c32 100644 --- a/core/lib/multivm/src/versions/tests.rs +++ b/core/lib/multivm/src/versions/tests.rs @@ -66,7 +66,7 @@ impl Harness { alice: Account::random(), bob: Account::random(), storage_contract: ContractToDeploy::new( - TestContract::storage_test().bytecode.clone(), + TestContract::storage_test().bytecode.to_vec(), Self::STORAGE_CONTRACT_ADDRESS, ), storage_contract_abi: &TestContract::storage_test().abi, @@ -169,7 +169,7 @@ impl Harness { self.new_block(vm, &[out_of_gas_transfer.hash(), simple_write_tx.hash()]); let deploy_tx = self.alice.get_deploy_tx( - &TestContract::load_test().bytecode, + TestContract::load_test().bytecode, Some(&[ethabi::Token::Uint(100.into())]), TxType::L2, ); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs index a5826f6f44b..372d1e3f2f9 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs @@ -111,7 +111,7 @@ struct StatisticsTagged { fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { let mut storage = get_empty_storage(); - let complex_upgrade_code = TestContract::complex_upgrade().bytecode.clone(); + let complex_upgrade_code = TestContract::complex_upgrade().bytecode.to_vec(); // For this test we'll just put the bytecode onto the force deployer address storage.borrow_mut().set_value( diff --git a/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs b/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs index a9c3bdf2877..b1d4a9a5c8d 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/bytecode_publishing.rs @@ -16,10 +16,10 @@ fn test_bytecode_publishing() { .with_random_rich_accounts(1) .build(); - let counter = &TestContract::counter().bytecode; + let counter = TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; - let compressed_bytecode = bytecode::compress(counter.clone()).unwrap().compressed; + let compressed_bytecode = bytecode::compress(counter.to_vec()).unwrap().compressed; let DeployContractsTx { tx, .. } = account.get_deploy_tx(counter, None, TxType::L2); vm.vm.push_transaction(tx); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs index ae82b0afea3..996a765dcf4 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs @@ -22,10 +22,10 @@ fn generate_large_bytecode() -> Vec { #[test] fn test_code_oracle() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.clone(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.to_vec(); // Filling the zkevm bytecode - let normal_zkevm_bytecode = &TestContract::counter().bytecode; + let normal_zkevm_bytecode = TestContract::counter().bytecode; let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); let mut storage = get_empty_storage(); @@ -50,7 +50,7 @@ fn test_code_oracle() { let precompile_contract = TestContract::precompiles_test(); let call_code_oracle_function = precompile_contract.function("callCodeOracle"); - vm.vm.insert_bytecodes([normal_zkevm_bytecode.as_slice()]); + vm.vm.insert_bytecodes([normal_zkevm_bytecode]); let account = &mut vm.rich_accounts[0]; // Firstly, let's ensure that the contract works. @@ -114,7 +114,7 @@ fn find_code_oracle_cost_log( #[test] fn test_code_oracle_big_bytecode() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.clone(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.to_vec(); let big_zkevm_bytecode = generate_large_bytecode(); let big_zkevm_bytecode_hash = hash_bytecode(&big_zkevm_bytecode); @@ -174,7 +174,7 @@ fn test_code_oracle_big_bytecode() { fn refunds_in_code_oracle() { let precompiles_contract_address = Address::random(); - let normal_zkevm_bytecode = &TestContract::counter().bytecode; + let normal_zkevm_bytecode = TestContract::counter().bytecode; let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); let mut storage = get_empty_storage(); @@ -195,13 +195,13 @@ fn refunds_in_code_oracle() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![ContractToDeploy::new( - TestContract::precompiles_test().bytecode.clone(), + TestContract::precompiles_test().bytecode.to_vec(), precompiles_contract_address, )]) .with_storage(storage.clone()) .build(); - vm.vm.insert_bytecodes([normal_zkevm_bytecode.as_slice()]); + vm.vm.insert_bytecodes([normal_zkevm_bytecode]); let account = &mut vm.rich_accounts[0]; if decommit { diff --git a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs index d8f3e104985..ba9f0b56406 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs @@ -108,7 +108,7 @@ fn known_bytecodes_without_base_system_contracts(vm: &Vm) -> /// Counter test contract bytecode inflated by appending lots of `NOP` opcodes at the end. This leads to non-trivial /// decommitment cost (>10,000 gas). fn inflated_counter_bytecode() -> Vec { - let mut counter_bytecode = TestContract::counter().bytecode.clone(); + let mut counter_bytecode = TestContract::counter().bytecode.to_vec(); counter_bytecode.extend( iter::repeat(EncodingModeProduction::nop_encoding().to_be_bytes()) .take(10_000) @@ -140,7 +140,7 @@ fn execute_proxy_counter(gas: u32) -> (VmTester<()>, ProxyCounterData, VmExecuti let account = &mut vm.rich_accounts[0]; let deploy_tx = account.get_deploy_tx( - &TestContract::proxy_counter().bytecode, + TestContract::proxy_counter().bytecode, Some(&[Token::Address(counter_address)]), TxType::L2, ); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs b/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs index c68857e927b..5a9fdb96a29 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/is_write_initial.rs @@ -30,7 +30,7 @@ fn test_is_write_initial_behaviour() { .is_write_initial(&nonce_key)); let tx = account - .get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2) + .get_deploy_tx(TestContract::counter().bytecode, None, TxType::L2) .tx; vm.vm.push_transaction(tx); vm.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs b/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs index cfa29b782ac..1dddd2020d3 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/l1_tx_execution.rs @@ -50,7 +50,7 @@ fn test_l1_tx_execution() { let account = &mut vm.rich_accounts[0]; let deploy_tx = account.get_deploy_tx( - &TestContract::counter().bytecode, + TestContract::counter().bytecode, None, TxType::L1 { serial_id: 1 }, ); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs b/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs index a7180ae2355..91170469a31 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/nonce_holder.rs @@ -41,7 +41,7 @@ fn test_nonce_holder() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_deployer() .with_custom_contracts(vec![ContractToDeploy::account( - TestContract::nonce_holder().bytecode.clone(), + TestContract::nonce_holder().bytecode.to_vec(), account.address, )]) .with_rich_accounts(vec![account.clone()]) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs index 8a341965681..4bcbeb3564c 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs @@ -12,7 +12,7 @@ use crate::{ #[test] fn test_keccak() { // Execute special transaction and check that at least 1000 keccak calls were made. - let contract = TestContract::precompiles_test().bytecode.clone(); + let contract = TestContract::precompiles_test().bytecode.to_vec(); let address = Address::random(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() @@ -50,7 +50,7 @@ fn test_keccak() { #[test] fn test_sha256() { // Execute special transaction and check that at least 1000 `sha256` calls were made. - let contract = TestContract::precompiles_test().bytecode.clone(); + let contract = TestContract::precompiles_test().bytecode.to_vec(); let address = Address::random(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs b/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs index 5fcdaac5ada..8d7f64967e0 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/refunds.rs @@ -26,7 +26,7 @@ fn test_predetermined_refunded_gas() { tx, bytecode_hash: _, address: _, - } = account.get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2); + } = account.get_deploy_tx(TestContract::counter().bytecode, None, TxType::L2); vm.vm.push_transaction(tx.clone()); let result = vm.vm.execute(VmExecutionMode::OneTx); @@ -171,7 +171,7 @@ fn negative_pubdata_for_transaction() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![ContractToDeploy::new( - TestContract::expensive().bytecode.clone(), + TestContract::expensive().bytecode.to_vec(), expensive_contract_address, )]) .build(); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs index 3c2f33ce1fe..d78526d390f 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/require_eip712.rs @@ -46,7 +46,7 @@ fn test_require_eip712() { let mut private_account = Account::random(); let beneficiary = Account::random(); - let bytecode = TestContract::many_owners().bytecode.clone(); + let bytecode = TestContract::many_owners().bytecode.to_vec(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_custom_contracts(vec![ContractToDeploy::account( diff --git a/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs index 234ee537f4e..79ee754b664 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/rollbacks.rs @@ -77,7 +77,7 @@ fn test_vm_loadnext_rollbacks() { address, .. } = account.get_deploy_tx_with_factory_deps( - &loadnext_contract.bytecode, + loadnext_contract.bytecode, Some(loadnext_constructor_data), loadnext_contract.factory_deps(), TxType::L2, @@ -147,7 +147,7 @@ fn test_vm_loadnext_rollbacks() { #[test] fn rollback_in_call_mode() { - let counter_bytecode = TestContract::counter().bytecode.clone(); + let counter_bytecode = TestContract::counter().bytecode.to_vec(); let counter_address = Address::repeat_byte(1); let mut vm = VmTesterBuilder::new() diff --git a/core/lib/multivm/src/versions/vm_fast/tests/storage.rs b/core/lib/multivm/src/versions/vm_fast/tests/storage.rs index e0ae0e47d4d..3ca0e82f182 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/storage.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/storage.rs @@ -11,7 +11,7 @@ use crate::{ }; fn test_storage(first_tx_calldata: Vec, second_tx_calldata: Vec) -> u32 { - let bytecode = TestContract::storage_test().bytecode.clone(); + let bytecode = TestContract::storage_test().bytecode.to_vec(); let test_contract_address = Address::random(); diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs index c39aa99edf6..7b065df9bff 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tracing_execution_error.rs @@ -13,7 +13,7 @@ use crate::{ #[test] fn test_tracing_of_execution_errors() { let contract_address = H160::random(); - let bytecode = TestContract::reverts_test().bytecode.clone(); + let bytecode = TestContract::reverts_test().bytecode.to_vec(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_base_system_smart_contracts(BASE_SYSTEM_CONTRACTS.clone()) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs index de369e21393..749148a05a6 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/transfer.rs @@ -53,11 +53,11 @@ fn test_send_or_transfer(test_option: TestOptions) { .with_random_rich_accounts(1) .with_custom_contracts(vec![ ContractToDeploy::new( - TestContract::transfer_test().bytecode.clone(), + TestContract::transfer_test().bytecode.to_vec(), test_contract_address, ), ContractToDeploy::new( - TestContract::transfer_recipient().bytecode.clone(), + TestContract::transfer_recipient().bytecode.to_vec(), recipient_address, ), ]) @@ -139,11 +139,11 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { .with_random_rich_accounts(1) .with_custom_contracts(vec![ ContractToDeploy::new( - TestContract::transfer_test().bytecode.clone(), + TestContract::transfer_test().bytecode.to_vec(), test_contract_address, ), ContractToDeploy::new( - TestContract::reentrant_recipient().bytecode.clone(), + TestContract::reentrant_recipient().bytecode.to_vec(), reentrant_recipient_address, ), ]) diff --git a/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs index 37d6c890eb7..d32fcb7e288 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/upgrade.rs @@ -29,7 +29,7 @@ fn test_protocol_upgrade_is_first() { .with_random_rich_accounts(1) .build(); - let bytecode_hash = hash_bytecode(&TestContract::counter().bytecode); + let bytecode_hash = hash_bytecode(TestContract::counter().bytecode); vm.storage .borrow_mut() .set_value(get_known_code_key(&bytecode_hash), u256_to_h256(1.into())); @@ -64,7 +64,7 @@ fn test_protocol_upgrade_is_first() { let normal_l1_transaction = vm.rich_accounts[0] .get_deploy_tx( - &TestContract::counter().bytecode, + TestContract::counter().bytecode, None, TxType::L1 { serial_id: 0 }, ) @@ -124,7 +124,7 @@ fn test_force_deploy_upgrade() { .build(); let storage_view = vm.storage.clone(); - let bytecode_hash = hash_bytecode(&TestContract::counter().bytecode); + let bytecode_hash = hash_bytecode(TestContract::counter().bytecode); let known_code_key = get_known_code_key(&bytecode_hash); // It is generally expected that all the keys will be set as known prior to the protocol upgrade. @@ -175,9 +175,9 @@ fn test_complex_upgrader() { .with_random_rich_accounts(1) .build(); - let upgrade_bytecode = TestContract::complex_upgrade().bytecode.clone(); + let upgrade_bytecode = TestContract::complex_upgrade().bytecode.to_vec(); let bytecode_hash = hash_bytecode(&upgrade_bytecode); - let msg_sender_test_hash = hash_bytecode(&TestContract::msg_sender_test().bytecode); + let msg_sender_test_hash = hash_bytecode(TestContract::msg_sender_test().bytecode); // Let's assume that the bytecode for the implementation of the complex upgrade // is already deployed in some address in user space @@ -195,7 +195,7 @@ fn test_complex_upgrader() { storage.store_factory_dep(bytecode_hash, upgrade_bytecode); storage.store_factory_dep( msg_sender_test_hash, - TestContract::msg_sender_test().bytecode.clone(), + TestContract::msg_sender_test().bytecode.to_vec(), ); } diff --git a/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs index 316ada2be66..19cd37e1153 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/block_tip.rs @@ -117,7 +117,7 @@ struct StatisticsTagged { fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { let mut storage = get_empty_storage(); - let complex_upgrade_code = TestContract::complex_upgrade().bytecode.clone(); + let complex_upgrade_code = TestContract::complex_upgrade().bytecode.to_vec(); // For this test we'll just put the bytecode onto the force deployer address storage.borrow_mut().set_value( diff --git a/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs b/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs index 5ffb65430c8..4793c0c7c0c 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/bytecode_publishing.rs @@ -19,10 +19,10 @@ fn test_bytecode_publishing() { .with_random_rich_accounts(1) .build(); - let counter = &TestContract::counter().bytecode; + let counter = TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; - let compressed_bytecode = bytecode::compress(counter.clone()).unwrap().compressed; + let compressed_bytecode = bytecode::compress(counter.to_vec()).unwrap().compressed; let DeployContractsTx { tx, .. } = account.get_deploy_tx(counter, None, TxType::L2); vm.vm.push_transaction(tx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs index c449394b098..11af109bb4d 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs @@ -52,7 +52,7 @@ fn test_max_depth() { #[test] fn test_basic_behavior() { - let contract = TestContract::counter().bytecode.clone(); + let contract = TestContract::counter().bytecode.to_vec(); let address = Address::random(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs index 010ed3c6314..e56f0744837 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/code_oracle.rs @@ -25,10 +25,10 @@ fn generate_large_bytecode() -> Vec { #[test] fn test_code_oracle() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.clone(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.to_vec(); // Filling the zkevm bytecode - let normal_zkevm_bytecode = &TestContract::counter().bytecode; + let normal_zkevm_bytecode = TestContract::counter().bytecode; let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); let mut storage = get_empty_storage(); @@ -57,7 +57,7 @@ fn test_code_oracle() { vm.vm.state.decommittment_processor.populate( vec![( h256_to_u256(normal_zkevm_bytecode_hash), - bytes_to_be_words(normal_zkevm_bytecode.clone()), + bytes_to_be_words(normal_zkevm_bytecode.to_vec()), )], Timestamp(0), ); @@ -125,7 +125,7 @@ fn find_code_oracle_cost_log( #[test] fn test_code_oracle_big_bytecode() { let precompiles_contract_address = Address::random(); - let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.clone(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.to_vec(); let big_zkevm_bytecode = generate_large_bytecode(); let big_zkevm_bytecode_hash = hash_bytecode(&big_zkevm_bytecode); @@ -189,10 +189,10 @@ fn test_code_oracle_big_bytecode() { fn refunds_in_code_oracle() { let precompiles_contract_address = Address::random(); - let normal_zkevm_bytecode = &TestContract::counter().bytecode; + let normal_zkevm_bytecode = TestContract::counter().bytecode; let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); - let normal_zkevm_bytecode_words = bytes_to_be_words(normal_zkevm_bytecode.clone()); + let normal_zkevm_bytecode_words = bytes_to_be_words(normal_zkevm_bytecode.to_vec()); let mut storage = get_empty_storage(); storage.set_value( get_known_code_key(&normal_zkevm_bytecode_hash), @@ -211,7 +211,7 @@ fn refunds_in_code_oracle() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![( - TestContract::precompiles_test().bytecode.clone(), + TestContract::precompiles_test().bytecode.to_vec(), precompiles_contract_address, false, )]) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs index e2d6528617e..31783fda25d 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/get_used_contracts.rs @@ -170,7 +170,7 @@ fn known_bytecodes_without_base_system_contracts10,000 gas). fn inflated_counter_bytecode() -> Vec { - let mut counter_bytecode = TestContract::counter().bytecode.clone(); + let mut counter_bytecode = TestContract::counter().bytecode.to_vec(); counter_bytecode.extend( iter::repeat(EncodingModeProduction::nop_encoding().to_be_bytes()) .take(10_000) @@ -193,7 +193,7 @@ fn execute_proxy_counter(gas: u32) -> (VmTester, U256, VmExecut let account = &mut vm.rich_accounts[0]; let deploy_tx = account.get_deploy_tx( - &TestContract::proxy_counter().bytecode, + TestContract::proxy_counter().bytecode, Some(&[Token::Address(counter_address)]), TxType::L2, ); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs b/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs index 093355b1a98..206fd089d9c 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/is_write_initial.rs @@ -33,7 +33,7 @@ fn test_is_write_initial_behaviour() { .is_write_initial(&nonce_key)); let tx = account - .get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2) + .get_deploy_tx(TestContract::counter().bytecode, None, TxType::L2) .tx; vm.vm.push_transaction(tx); vm.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs b/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs index 1fce18b6774..e2c3f30747b 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/l1_tx_execution.rs @@ -51,7 +51,7 @@ fn test_l1_tx_execution() { let account = &mut vm.rich_accounts[0]; let deploy_tx = account.get_deploy_tx( - &TestContract::counter().bytecode, + TestContract::counter().bytecode, None, TxType::L1 { serial_id: 1 }, ); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/migration.rs b/core/lib/multivm/src/versions/vm_latest/tests/migration.rs index 9345a07ce3e..13cb9f36d41 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/migration.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/migration.rs @@ -30,7 +30,7 @@ fn test_migration_for_system_context_aa_interaction() { // the upgrade transaction is there or not. let account = &mut vm.rich_accounts[0]; let DeployContractsTx { tx, .. } = - account.get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2); + account.get_deploy_tx(TestContract::counter().bytecode, None, TxType::L2); vm.vm.push_transaction(tx); let result = vm.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs b/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs index b36fa001beb..e2444de7a85 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/nonce_holder.rs @@ -44,7 +44,7 @@ fn test_nonce_holder() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_deployer() .with_custom_contracts(vec![( - TestContract::nonce_holder().bytecode.clone(), + TestContract::nonce_holder().bytecode.to_vec(), account.address, true, )]) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs index 3384c185f8f..54e33b384fd 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs @@ -12,7 +12,7 @@ use crate::{ #[test] fn test_keccak() { // Execute special transaction and check that at least 1000 keccak calls were made. - let contract = TestContract::precompiles_test().bytecode.clone(); + let contract = TestContract::precompiles_test().bytecode.to_vec(); let address = Address::random(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() @@ -58,7 +58,7 @@ fn test_keccak() { #[test] fn test_sha256() { // Execute special transaction and check that at least 1000 `sha256` calls were made. - let contract = TestContract::precompiles_test().bytecode.clone(); + let contract = TestContract::precompiles_test().bytecode.to_vec(); let address = Address::random(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs b/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs index f53157baa3c..7e23f5b9d1f 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/refunds.rs @@ -29,7 +29,7 @@ fn test_predetermined_refunded_gas() { tx, bytecode_hash: _, address: _, - } = account.get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2); + } = account.get_deploy_tx(TestContract::counter().bytecode, None, TxType::L2); vm.vm.push_transaction(tx.clone()); let result = vm.vm.execute(VmExecutionMode::OneTx); @@ -177,7 +177,7 @@ fn negative_pubdata_for_transaction() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_random_rich_accounts(1) .with_custom_contracts(vec![( - TestContract::expensive().bytecode.clone(), + TestContract::expensive().bytecode.to_vec(), expensive_contract_address, false, )]) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs index e2e4bb8c74d..69841b5b24b 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/require_eip712.rs @@ -39,7 +39,7 @@ fn test_require_eip712() { let mut private_account = Account::random(); let beneficiary = Account::random(); - let bytecode = TestContract::many_owners().bytecode.clone(); + let bytecode = TestContract::many_owners().bytecode.to_vec(); let mut vm = VmTesterBuilder::new(HistoryDisabled) .with_empty_in_memory_storage() .with_custom_contracts(vec![(bytecode, account_abstraction.address, true)]) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs index cb7ccef82c8..b09efc6d1f5 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs @@ -85,7 +85,7 @@ fn test_vm_loadnext_rollbacks() { address, .. } = account.get_deploy_tx_with_factory_deps( - &loadnext_contract.bytecode, + loadnext_contract.bytecode, Some(loadnext_constructor_data), loadnext_contract.factory_deps(), TxType::L2, @@ -196,7 +196,7 @@ fn test_layered_rollback() { address, .. } = account.get_deploy_tx( - &TestContract::load_test().bytecode, + TestContract::load_test().bytecode, Some(&[Token::Uint(0.into())]), TxType::L2, ); @@ -261,7 +261,7 @@ fn test_layered_rollback() { #[test] fn rollback_in_call_mode() { - let counter_bytecode = TestContract::counter().bytecode.clone(); + let counter_bytecode = TestContract::counter().bytecode.to_vec(); let counter_address = Address::repeat_byte(1); let mut vm = VmTesterBuilder::new(HistoryEnabled) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/storage.rs b/core/lib/multivm/src/versions/vm_latest/tests/storage.rs index 5fb22c5eaeb..cfbe1590e53 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/storage.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/storage.rs @@ -18,7 +18,7 @@ struct TestTxInfo { } fn test_storage(txs: Vec) -> u32 { - let bytecode = TestContract::storage_test().bytecode.clone(); + let bytecode = TestContract::storage_test().bytecode.to_vec(); let test_contract_address = Address::random(); // In this test, we aim to test whether a simple account interaction (without any fee logic) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs b/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs index c19d354d2ab..682b0df9b28 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tester/vm_tester.rs @@ -46,7 +46,7 @@ impl VmTester { .deployer .as_mut() .expect("You have to initialize builder with deployer") - .get_deploy_tx(&TestContract::counter().bytecode, None, TxType::L2) + .get_deploy_tx(TestContract::counter().bytecode, None, TxType::L2) .tx; let nonce = tx.nonce().unwrap().0.into(); self.vm.push_transaction(tx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs index f2c3d5f65fa..262da117afd 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tracing_execution_error.rs @@ -15,7 +15,7 @@ use crate::{ #[test] fn test_tracing_of_execution_errors() { let contract_address = H160::random(); - let bytecode = TestContract::reverts_test().bytecode.clone(); + let bytecode = TestContract::reverts_test().bytecode.to_vec(); let mut vm = VmTesterBuilder::new(HistoryEnabled) .with_empty_in_memory_storage() .with_base_system_smart_contracts(BASE_SYSTEM_CONTRACTS.clone()) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs index e93705ddb09..0012ece76c4 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/transfer.rs @@ -55,12 +55,12 @@ fn test_send_or_transfer(test_option: TestOptions) { .with_random_rich_accounts(1) .with_custom_contracts(vec![ ( - TestContract::transfer_test().bytecode.clone(), + TestContract::transfer_test().bytecode.to_vec(), test_contract_address, false, ), ( - TestContract::transfer_recipient().bytecode.clone(), + TestContract::transfer_recipient().bytecode.to_vec(), recipient_address, false, ), @@ -142,12 +142,12 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { .with_random_rich_accounts(1) .with_custom_contracts(vec![ ( - TestContract::transfer_test().bytecode.clone(), + TestContract::transfer_test().bytecode.to_vec(), test_contract_address, false, ), ( - TestContract::reentrant_recipient().bytecode.clone(), + TestContract::reentrant_recipient().bytecode.to_vec(), reentrant_recipeint_address, false, ), diff --git a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs index 72d44b15f93..24bb7c1d51b 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/upgrade.rs @@ -33,7 +33,7 @@ fn test_protocol_upgrade_is_first() { .with_random_rich_accounts(1) .build(); - let bytecode_hash = hash_bytecode(&TestContract::counter().bytecode); + let bytecode_hash = hash_bytecode(TestContract::counter().bytecode); vm.vm .storage .borrow_mut() @@ -69,7 +69,7 @@ fn test_protocol_upgrade_is_first() { let normal_l1_transaction = vm.rich_accounts[0] .get_deploy_tx( - &TestContract::counter().bytecode, + TestContract::counter().bytecode, None, TxType::L1 { serial_id: 0 }, ) @@ -129,7 +129,7 @@ fn test_force_deploy_upgrade() { .build(); let storage_view = vm.storage.clone(); - let bytecode_hash = hash_bytecode(&TestContract::counter().bytecode); + let bytecode_hash = hash_bytecode(TestContract::counter().bytecode); let known_code_key = get_known_code_key(&bytecode_hash); // It is generally expected that all the keys will be set as known prior to the protocol upgrade. @@ -177,9 +177,9 @@ fn test_complex_upgrader() { .build(); let storage_view = vm.storage.clone(); - let upgrade_bytecode = TestContract::complex_upgrade().bytecode.clone(); + let upgrade_bytecode = TestContract::complex_upgrade().bytecode.to_vec(); let bytecode_hash = hash_bytecode(&upgrade_bytecode); - let msg_sender_test_hash = hash_bytecode(&TestContract::msg_sender_test().bytecode); + let msg_sender_test_hash = hash_bytecode(TestContract::msg_sender_test().bytecode); // Let's assume that the bytecode for the implementation of the complex upgrade // is already deployed in some address in user space @@ -206,7 +206,7 @@ fn test_complex_upgrader() { ), ( h256_to_u256(msg_sender_test_hash), - bytes_to_be_words(TestContract::msg_sender_test().bytecode.clone()), + bytes_to_be_words(TestContract::msg_sender_test().bytecode.to_vec()), ), ], Timestamp(0), diff --git a/core/lib/test_contracts/src/contracts.rs b/core/lib/test_contracts/src/contracts.rs index c7c70c1137f..921be1f88be 100644 --- a/core/lib/test_contracts/src/contracts.rs +++ b/core/lib/test_contracts/src/contracts.rs @@ -28,7 +28,7 @@ pub struct TestContract { /// Web3 ABI of this contract. pub abi: ethabi::Contract, /// EraVM bytecode of this contract. - pub bytecode: Vec, // FIXME: change to &[u8]? + pub bytecode: &'static [u8], /// Contract dependencies (i.e., potential factory deps to be included in the contract deployment / transactions). pub dependencies: Vec, } @@ -38,7 +38,7 @@ impl TestContract { let abi = serde_json::from_str(raw.abi).expect("failed parsing contract ABI"); Self { abi, - bytecode: raw.bytecode.to_vec(), + bytecode: raw.bytecode, dependencies: vec![], } } diff --git a/core/node/api_server/src/testonly.rs b/core/node/api_server/src/testonly.rs index 85ec1d40d28..7b8ddfec007 100644 --- a/core/node/api_server/src/testonly.rs +++ b/core/node/api_server/src/testonly.rs @@ -91,7 +91,7 @@ impl StateBuilder { self.inner.insert( Self::LOAD_TEST_ADDRESS, OverrideAccount { - code: Some(Bytecode::new(TestContract::load_test().bytecode.clone()).unwrap()), + code: Some(Bytecode::new(TestContract::load_test().bytecode.to_vec()).unwrap()), state: Some(OverrideState::State(state)), ..OverrideAccount::default() }, @@ -107,21 +107,21 @@ impl StateBuilder { pub fn with_expensive_contract(self) -> Self { self.with_contract( Self::EXPENSIVE_CONTRACT_ADDRESS, - TestContract::expensive().bytecode.clone(), + TestContract::expensive().bytecode.to_vec(), ) } pub fn with_precompiles_contract(self) -> Self { self.with_contract( Self::PRECOMPILES_CONTRACT_ADDRESS, - TestContract::precompiles_test().bytecode.clone(), + TestContract::precompiles_test().bytecode.to_vec(), ) } pub fn with_counter_contract(self, initial_value: u64) -> Self { let mut this = self.with_contract( Self::COUNTER_CONTRACT_ADDRESS, - TestContract::counter().bytecode.clone(), + TestContract::counter().bytecode.to_vec(), ); if initial_value != 0 { let state = HashMap::from([(H256::zero(), H256::from_low_u64_be(initial_value))]); @@ -136,7 +136,7 @@ impl StateBuilder { pub fn with_infinite_loop_contract(self) -> Self { self.with_contract( Self::INFINITE_LOOP_CONTRACT_ADDRESS, - TestContract::infinite_loop().bytecode.clone(), + TestContract::infinite_loop().bytecode.to_vec(), ) } diff --git a/core/node/state_keeper/src/executor/tests/mod.rs b/core/node/state_keeper/src/executor/tests/mod.rs index 141c5ffb884..f7dcff9b8f0 100644 --- a/core/node/state_keeper/src/executor/tests/mod.rs +++ b/core/node/state_keeper/src/executor/tests/mod.rs @@ -220,7 +220,7 @@ async fn decommitting_contract() { let res = executor.execute_tx(deploy_tx.tx).await.unwrap(); assert_succeeded(&res); - let keccak_bytecode_hash = web3::keccak256(&TestContract::precompiles_test().bytecode); + let keccak_bytecode_hash = web3::keccak256(TestContract::precompiles_test().bytecode); let test_tx = alice.test_decommit( deploy_tx.address, deploy_tx.bytecode_hash, diff --git a/core/node/state_keeper/src/executor/tests/tester.rs b/core/node/state_keeper/src/executor/tests/tester.rs index fa62783f675..5f0cdd4dd92 100644 --- a/core/node/state_keeper/src/executor/tests/tester.rs +++ b/core/node/state_keeper/src/executor/tests/tester.rs @@ -366,7 +366,7 @@ impl AccountExt for Account { let loadnext_contract = TestContract::load_test(); let loadnext_constructor_data = &[Token::Uint(U256::from(100))]; self.get_deploy_tx_with_factory_deps( - &loadnext_contract.bytecode, + loadnext_contract.bytecode, Some(loadnext_constructor_data), loadnext_contract.factory_deps(), TxType::L2, @@ -462,11 +462,11 @@ impl AccountExt for Account { } fn deploy_failed_call_tx(&mut self) -> DeployContractsTx { - self.get_deploy_tx(&TestContract::failed_call().bytecode, None, TxType::L2) + self.get_deploy_tx(TestContract::failed_call().bytecode, None, TxType::L2) } fn deploy_storage_tester(&mut self) -> DeployContractsTx { - self.get_deploy_tx(&TestContract::storage_test().bytecode, None, TxType::L2) + self.get_deploy_tx(TestContract::storage_test().bytecode, None, TxType::L2) } fn test_transient_store(&mut self, address: Address) -> Transaction { @@ -498,7 +498,7 @@ impl AccountExt for Account { } fn deploy_precompiles_test(&mut self) -> DeployContractsTx { - self.get_deploy_tx(&TestContract::precompiles_test().bytecode, None, TxType::L2) + self.get_deploy_tx(TestContract::precompiles_test().bytecode, None, TxType::L2) } fn test_decommit( diff --git a/core/tests/loadnext/src/account/tx_command_executor.rs b/core/tests/loadnext/src/account/tx_command_executor.rs index da3da867ac8..6fbe40c2b6c 100644 --- a/core/tests/loadnext/src/account/tx_command_executor.rs +++ b/core/tests/loadnext/src/account/tx_command_executor.rs @@ -272,7 +272,7 @@ impl AccountLifespan { let mut builder = wallet .start_deploy_contract() - .bytecode(self.wallet.test_contract.bytecode.clone()) + .bytecode(self.wallet.test_contract.bytecode.to_vec()) .constructor_calldata(constructor_calldata); let fee = builder From 4d21b49250d8ea2a761156a2902b54065387b4f6 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 10 Oct 2024 12:57:59 +0300 Subject: [PATCH 26/32] Move mock EVM contracts --- .../src/versions/vm_latest/tests/evm_emulator.rs | 9 +++------ .../contracts/mock-evm/mock-evm.sol | 0 core/lib/test_contracts/src/contracts.rs | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) rename {etc/contracts-test-data => core/lib/test_contracts}/contracts/mock-evm/mock-evm.sol (100%) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/evm_emulator.rs b/core/lib/multivm/src/versions/vm_latest/tests/evm_emulator.rs index ca8157b170d..20d9c7270f8 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/evm_emulator.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/evm_emulator.rs @@ -1,6 +1,6 @@ use ethabi::Token; -use zksync_contracts::read_bytecode; use zksync_system_constants::{CONTRACT_DEPLOYER_ADDRESS, KNOWN_CODES_STORAGE_ADDRESS}; +use zksync_test_contracts::TestContract; use zksync_types::{get_code_key, get_known_code_key, Execute, H256}; use zksync_utils::{be_words_to_bytes, bytecode::hash_bytecode, h256_to_u256}; use zksync_vm_interface::VmInterfaceExt; @@ -11,14 +11,11 @@ use crate::{ vm_latest::{tests::tester::VmTesterBuilder, utils::hash_evm_bytecode, HistoryEnabled}, }; -const MOCK_DEPLOYER_PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/mock-evm/mock-evm.sol/MockContractDeployer.json"; -const MOCK_KNOWN_CODE_STORAGE_PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/mock-evm/mock-evm.sol/MockKnownCodeStorage.json"; - #[test] fn tracing_evm_contract_deployment() { - let mock_deployer = read_bytecode(MOCK_DEPLOYER_PATH); + let mock_deployer = TestContract::mock_deployer().bytecode.to_vec(); let mock_deployer_hash = hash_bytecode(&mock_deployer); - let mock_known_code_storage = read_bytecode(MOCK_KNOWN_CODE_STORAGE_PATH); + let mock_known_code_storage = TestContract::mock_known_code_storage().bytecode.to_vec(); let mock_known_code_storage_hash = hash_bytecode(&mock_known_code_storage); // Override diff --git a/etc/contracts-test-data/contracts/mock-evm/mock-evm.sol b/core/lib/test_contracts/contracts/mock-evm/mock-evm.sol similarity index 100% rename from etc/contracts-test-data/contracts/mock-evm/mock-evm.sol rename to core/lib/test_contracts/contracts/mock-evm/mock-evm.sol diff --git a/core/lib/test_contracts/src/contracts.rs b/core/lib/test_contracts/src/contracts.rs index 921be1f88be..196531d7ae7 100644 --- a/core/lib/test_contracts/src/contracts.rs +++ b/core/lib/test_contracts/src/contracts.rs @@ -171,6 +171,20 @@ impl TestContract { &CONTRACT } + /// Returns a mock version of `ContractDeployer`. + pub fn mock_deployer() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::mock_evm::MockContractDeployer)); + &CONTRACT + } + + /// Returns a mock version of `KnownCodeStorage`. + pub fn mock_known_code_storage() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::mock_evm::MockKnownCodeStorage)); + &CONTRACT + } + /// Returns all factory deps for this contract deployment (including its own bytecode). pub fn factory_deps(&self) -> Vec> { let mut deps = vec![]; From b43da7cbfeaede5e4959767b7b6c4c7a7bdbdf72 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 10 Oct 2024 14:48:54 +0300 Subject: [PATCH 27/32] Checkout git submodules --- .github/workflows/protobuf.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index 9c2c3418670..c9541167b46 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -23,7 +23,7 @@ env: RUSTC_WRAPPER: "sccache" SCCACHE_GHA_ENABLED: "true" RUST_BACKTRACE: "1" - SQLX_OFFLINE: true, + SQLX_OFFLINE: true # github.base_ref -> github.head_ref for pull_request BASE: ${{ github.event.pull_request.base.sha || github.event.before }} # github.event.before -> github.event.after for push @@ -43,7 +43,7 @@ jobs: fetch-depth: 0 # fetches all branches and tags, which is needed to compute the LCA. - name: checkout LCA run: - git checkout $(git merge-base $BASE $HEAD) + git checkout $(git merge-base $BASE $HEAD) --recurse-submodules working-directory: ./before - name: compile before run: cargo check --all-targets @@ -59,6 +59,7 @@ jobs: with: ref: ${{ env.HEAD }} path: after + submodules: recursive - name: compile after run: cargo check --all-targets working-directory: ./after From 0b0cf92b6530f69a6fe01c41131c82e0814006d4 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Thu, 10 Oct 2024 14:52:35 +0300 Subject: [PATCH 28/32] Allow Boost software license --- deny.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deny.toml b/deny.toml index dc5a32c2c07..96ef81f5acd 100644 --- a/deny.toml +++ b/deny.toml @@ -9,14 +9,12 @@ feature-depth = 1 [advisories] ignore = [ "RUSTSEC-2024-0375", # atty dependency being unmaintained, dependency of clap and criterion, we would need to update to newer major of dependencies - "RUSTSEC-2024-0320", # yaml_rust dependency being unmaintained, dependency in core, we should consider moving to yaml_rust2 fork "RUSTSEC-2020-0168", # mach dependency being unmaintained, dependency in consensus, we should consider moving to mach2 fork "RUSTSEC-2024-0370", # `cs_derive` needs to be updated to not rely on `proc-macro-error` - # all below caused by StructOpt which we still use and we should move to clap v3 instead + # all below caused by StructOpt which we still use and we should move to clap v4 instead "RUSTSEC-2024-0375", "RUSTSEC-2021-0145", "RUSTSEC-2021-0139", - "RUSTSEC-2024-0375", ] [licenses] @@ -34,6 +32,7 @@ allow = [ "OpenSSL", "Apache-2.0 WITH LLVM-exception", "0BSD", + "BSL-1.0", ] confidence-threshold = 0.8 From 831c630fa2e59766bbe870623f0630a42596b884 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 18 Oct 2024 16:36:02 +0300 Subject: [PATCH 29/32] Fix multivm unit tests --- .../src/versions/testonly/block_tip.rs | 8 +-- .../versions/testonly/bytecode_publishing.rs | 10 +-- .../src/versions/testonly/code_oracle.rs | 41 ++++++------ .../src/versions/testonly/default_aa.rs | 9 ++- .../versions/testonly/get_used_contracts.rs | 17 +++-- .../src/versions/testonly/is_write_initial.rs | 9 +-- .../src/versions/testonly/l1_tx_execution.rs | 11 ++-- core/lib/multivm/src/versions/testonly/mod.rs | 62 +----------------- .../src/versions/testonly/nonce_holder.rs | 6 +- .../src/versions/testonly/precompiles.rs | 7 ++- .../multivm/src/versions/testonly/refunds.rs | 20 +++--- .../src/versions/testonly/require_eip712.rs | 9 ++- .../src/versions/testonly/rollbacks.rs | 21 ++++--- .../multivm/src/versions/testonly/storage.rs | 28 ++------- .../src/versions/testonly/tester/mod.rs | 8 +-- .../testonly/tracing_execution_error.rs | 25 ++------ .../multivm/src/versions/testonly/transfer.rs | 63 ++++++++----------- .../multivm/src/versions/testonly/upgrade.rs | 40 ++++++------ .../versions/vm_latest/tests/call_tracer.rs | 9 ++- .../versions/vm_latest/tests/evm_emulator.rs | 46 +++++--------- .../vm_latest/tests/prestate_tracer.rs | 10 +-- .../src/versions/vm_latest/tests/rollbacks.rs | 9 +-- 22 files changed, 174 insertions(+), 294 deletions(-) diff --git a/core/lib/multivm/src/versions/testonly/block_tip.rs b/core/lib/multivm/src/versions/testonly/block_tip.rs index 7700f347ca6..7cd34b6f1e7 100644 --- a/core/lib/multivm/src/versions/testonly/block_tip.rs +++ b/core/lib/multivm/src/versions/testonly/block_tip.rs @@ -4,6 +4,7 @@ use zksync_contracts::load_sys_contract; use zksync_system_constants::{ CONTRACT_FORCE_DEPLOYER_ADDRESS, KNOWN_CODES_STORAGE_ADDRESS, L1_MESSENGER_ADDRESS, }; +use zksync_test_contracts::TestContract; use zksync_types::{ commitment::SerializeCommitment, fee_model::BatchFeeInput, get_code_key, l2_to_l1_log::L2ToL1Log, writes::StateDiffRecord, Address, Execute, H256, U256, @@ -11,7 +12,7 @@ use zksync_types::{ use zksync_utils::{bytecode::hash_bytecode, u256_to_h256}; use super::{ - get_complex_upgrade_abi, get_empty_storage, read_complex_upgrade, + get_empty_storage, tester::{TestedVm, VmTesterBuilder}, }; use crate::{ @@ -41,7 +42,7 @@ struct MimicCallInfo { const CALLS_PER_TX: usize = 1_000; fn populate_mimic_calls(data: L1MessengerTestData) -> Vec> { - let complex_upgrade = get_complex_upgrade_abi(); + let complex_upgrade = TestContract::complex_upgrade(); let l1_messenger = load_sys_contract("L1Messenger"); let logs_mimic_calls = (0..data.l2_to_l1_logs).map(|i| MimicCallInfo { @@ -91,7 +92,6 @@ fn populate_mimic_calls(data: L1MessengerTestData) -> Vec> { .map(|chunk| { complex_upgrade .function("mimicCalls") - .unwrap() .encode_input(&[Token::Array(chunk.collect_vec())]) .unwrap() }) @@ -113,7 +113,7 @@ struct StatisticsTagged { fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { let mut storage = get_empty_storage(); - let complex_upgrade_code = read_complex_upgrade(); + let complex_upgrade_code = TestContract::complex_upgrade().bytecode.to_vec(); // For this test we'll just put the bytecode onto the force deployer address storage.set_value( diff --git a/core/lib/multivm/src/versions/testonly/bytecode_publishing.rs b/core/lib/multivm/src/versions/testonly/bytecode_publishing.rs index ee126bb66ca..68c5001f0f8 100644 --- a/core/lib/multivm/src/versions/testonly/bytecode_publishing.rs +++ b/core/lib/multivm/src/versions/testonly/bytecode_publishing.rs @@ -1,6 +1,6 @@ -use zksync_test_contracts::{DeployContractsTx, TxType}; +use zksync_test_contracts::{DeployContractsTx, TestContract, TxType}; -use super::{read_test_contract, tester::VmTesterBuilder, TestedVm}; +use super::{tester::VmTesterBuilder, TestedVm}; use crate::{ interface::{TxExecutionMode, VmEvent, VmExecutionMode, VmInterfaceExt}, utils::bytecode, @@ -15,12 +15,12 @@ pub(crate) fn test_bytecode_publishing() { .with_rich_accounts(1) .build::(); - let counter = read_test_contract(); + let counter = TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; - let compressed_bytecode = bytecode::compress(counter.clone()).unwrap().compressed; + let compressed_bytecode = bytecode::compress(counter.to_vec()).unwrap().compressed; - let DeployContractsTx { tx, .. } = account.get_deploy_tx(&counter, None, TxType::L2); + let DeployContractsTx { tx, .. } = account.get_deploy_tx(counter, None, TxType::L2); vm.vm.push_transaction(tx); let result = vm.vm.execute(VmExecutionMode::OneTx); assert!(!result.result.is_failed(), "Transaction wasn't successful"); diff --git a/core/lib/multivm/src/versions/testonly/code_oracle.rs b/core/lib/multivm/src/versions/testonly/code_oracle.rs index b786539329b..a27038d2a6c 100644 --- a/core/lib/multivm/src/versions/testonly/code_oracle.rs +++ b/core/lib/multivm/src/versions/testonly/code_oracle.rs @@ -1,13 +1,11 @@ use ethabi::Token; +use zksync_test_contracts::TestContract; use zksync_types::{ get_known_code_key, web3::keccak256, Address, Execute, StorageLogWithPreviousValue, U256, }; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256, u256_to_h256}; -use super::{ - get_empty_storage, load_precompiles_contract, read_precompiles_contract, read_test_contract, - tester::VmTesterBuilder, TestedVm, -}; +use super::{get_empty_storage, tester::VmTesterBuilder, TestedVm}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterfaceExt}, versions::testonly::ContractToDeploy, @@ -20,12 +18,12 @@ fn generate_large_bytecode() -> Vec { pub(crate) fn test_code_oracle() { let precompiles_contract_address = Address::repeat_byte(1); - let precompile_contract_bytecode = read_precompiles_contract(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.to_vec(); // Filling the zkevm bytecode - let normal_zkevm_bytecode = read_test_contract(); - let normal_zkevm_bytecode_hash = hash_bytecode(&normal_zkevm_bytecode); - let normal_zkevm_bytecode_keccak_hash = keccak256(&normal_zkevm_bytecode); + let normal_zkevm_bytecode = TestContract::counter().bytecode; + let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); + let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); let mut storage = get_empty_storage(); storage.set_value( get_known_code_key(&normal_zkevm_bytecode_hash), @@ -45,10 +43,10 @@ pub(crate) fn test_code_oracle() { .with_storage(storage) .build::(); - let precompile_contract = load_precompiles_contract(); - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); - vm.vm.insert_bytecodes(&[normal_zkevm_bytecode.as_slice()]); + vm.vm.insert_bytecodes(&[normal_zkevm_bytecode]); let account = &mut vm.rich_accounts[0]; // Firstly, let's ensure that the contract works. @@ -111,7 +109,7 @@ fn find_code_oracle_cost_log( pub(crate) fn test_code_oracle_big_bytecode() { let precompiles_contract_address = Address::repeat_byte(1); - let precompile_contract_bytecode = read_precompiles_contract(); + let precompile_contract_bytecode = TestContract::precompiles_test().bytecode.to_vec(); let big_zkevm_bytecode = generate_large_bytecode(); let big_zkevm_bytecode_hash = hash_bytecode(&big_zkevm_bytecode); @@ -136,8 +134,8 @@ pub(crate) fn test_code_oracle_big_bytecode() { .with_storage(storage) .build::(); - let precompile_contract = load_precompiles_contract(); - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); vm.vm.insert_bytecodes(&[big_zkevm_bytecode.as_slice()]); @@ -169,19 +167,18 @@ pub(crate) fn test_code_oracle_big_bytecode() { pub(crate) fn test_refunds_in_code_oracle() { let precompiles_contract_address = Address::repeat_byte(1); - let precompile_contract_bytecode = read_precompiles_contract(); - let normal_zkevm_bytecode = read_test_contract(); - let normal_zkevm_bytecode_hash = hash_bytecode(&normal_zkevm_bytecode); - let normal_zkevm_bytecode_keccak_hash = keccak256(&normal_zkevm_bytecode); + let normal_zkevm_bytecode = TestContract::counter().bytecode; + let normal_zkevm_bytecode_hash = hash_bytecode(normal_zkevm_bytecode); + let normal_zkevm_bytecode_keccak_hash = keccak256(normal_zkevm_bytecode); let mut storage = get_empty_storage(); storage.set_value( get_known_code_key(&normal_zkevm_bytecode_hash), u256_to_h256(U256::one()), ); - let precompile_contract = load_precompiles_contract(); - let call_code_oracle_function = precompile_contract.function("callCodeOracle").unwrap(); + let precompile_contract = TestContract::precompiles_test(); + let call_code_oracle_function = precompile_contract.function("callCodeOracle"); // Execute code oracle twice with identical VM state that only differs in that the queried bytecode // is already decommitted the second time. The second call must consume less gas (`decommit` doesn't charge additional gas @@ -192,13 +189,13 @@ pub(crate) fn test_refunds_in_code_oracle() { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_rich_accounts(1) .with_custom_contracts(vec![ContractToDeploy::new( - precompile_contract_bytecode.clone(), + TestContract::precompiles_test().bytecode.to_vec(), precompiles_contract_address, )]) .with_storage(storage.clone()) .build::(); - vm.vm.insert_bytecodes(&[normal_zkevm_bytecode.as_slice()]); + vm.vm.insert_bytecodes(&[normal_zkevm_bytecode]); let account = &mut vm.rich_accounts[0]; if decommit { diff --git a/core/lib/multivm/src/versions/testonly/default_aa.rs b/core/lib/multivm/src/versions/testonly/default_aa.rs index 5569f604b00..451cc7abffe 100644 --- a/core/lib/multivm/src/versions/testonly/default_aa.rs +++ b/core/lib/multivm/src/versions/testonly/default_aa.rs @@ -1,4 +1,4 @@ -use zksync_test_contracts::{DeployContractsTx, TxType}; +use zksync_test_contracts::{DeployContractsTx, TestContract, TxType}; use zksync_types::{ get_code_key, get_known_code_key, get_nonce_key, system_contracts::{DEPLOYMENT_NONCE_INCREMENT, TX_NONCE_INCREMENT}, @@ -7,7 +7,7 @@ use zksync_types::{ }; use zksync_utils::h256_to_u256; -use super::{read_test_contract, tester::VmTesterBuilder, TestedVm}; +use super::{tester::VmTesterBuilder, TestedVm}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterfaceExt}, vm_latest::utils::fee::get_batch_base_fee, @@ -22,13 +22,13 @@ pub(crate) fn test_default_aa_interaction() { .with_rich_accounts(1) .build::(); - let counter = read_test_contract(); + let counter = TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; let DeployContractsTx { tx, bytecode_hash, address, - } = account.get_deploy_tx(&counter, None, TxType::L2); + } = account.get_deploy_tx(counter, None, TxType::L2); let maximal_fee = tx.gas_limit() * get_batch_base_fee(&vm.l1_batch_env); vm.vm.push_transaction(tx); @@ -36,7 +36,6 @@ pub(crate) fn test_default_aa_interaction() { assert!(!result.result.is_failed(), "Transaction wasn't successful"); vm.vm.execute(VmExecutionMode::Batch); - vm.vm.get_current_execution_state(); // Both deployment and ordinary nonce should be incremented by one. diff --git a/core/lib/multivm/src/versions/testonly/get_used_contracts.rs b/core/lib/multivm/src/versions/testonly/get_used_contracts.rs index 63fcf7bfa00..10088b4d3f8 100644 --- a/core/lib/multivm/src/versions/testonly/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/testonly/get_used_contracts.rs @@ -4,12 +4,11 @@ use assert_matches::assert_matches; use ethabi::Token; use zk_evm_1_3_1::zkevm_opcode_defs::decoding::{EncodingModeProduction, VmEncodingMode}; use zksync_system_constants::CONTRACT_DEPLOYER_ADDRESS; -use zksync_test_contracts::{Account, TxType}; +use zksync_test_contracts::{Account, TestContract, TxType}; use zksync_types::{AccountTreeId, Address, Execute, StorageKey, H256, U256}; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; use super::{ - read_proxy_counter_contract, read_test_contract, tester::{VmTester, VmTesterBuilder}, TestedVm, BASE_SYSTEM_CONTRACTS, }; @@ -31,9 +30,9 @@ pub(crate) fn test_get_used_contracts() { // create and push and execute some not-empty factory deps transaction with success status // to check that `get_decommitted_hashes()` updates - let contract_code = read_test_contract(); + let contract_code = TestContract::counter().bytecode; let account = &mut vm.rich_accounts[0]; - let tx = account.get_deploy_tx(&contract_code, None, TxType::L1 { serial_id: 0 }); + let tx = account.get_deploy_tx(contract_code, None, TxType::L1 { serial_id: 0 }); vm.vm.push_transaction(tx.tx.clone()); let result = vm.vm.execute(VmExecutionMode::OneTx); assert!(!result.result.is_failed()); @@ -100,7 +99,7 @@ fn known_bytecodes_without_base_system_contracts(vm: &impl TestedVm) -> HashSet< /// Counter test contract bytecode inflated by appending lots of `NOP` opcodes at the end. This leads to non-trivial /// decommitment cost (>10,000 gas). fn inflated_counter_bytecode() -> Vec { - let mut counter_bytecode = read_test_contract(); + let mut counter_bytecode = TestContract::counter().bytecode.to_vec(); counter_bytecode.extend( iter::repeat(EncodingModeProduction::nop_encoding().to_be_bytes()) .take(10_000) @@ -132,10 +131,9 @@ fn execute_proxy_counter( .with_rich_accounts(1) .build::(); - let (proxy_counter_bytecode, proxy_counter_abi) = read_proxy_counter_contract(); let account = &mut vm.rich_accounts[0]; let deploy_tx = account.get_deploy_tx( - &proxy_counter_bytecode, + TestContract::proxy_counter().bytecode, Some(&[Token::Address(counter_address)]), TxType::L2, ); @@ -151,7 +149,7 @@ fn execute_proxy_counter( "{decommitted_hashes:?}" ); - let increment = proxy_counter_abi.function("increment").unwrap(); + let increment = TestContract::proxy_counter().function("increment"); let increment_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(deploy_tx.address), @@ -195,8 +193,7 @@ pub(crate) fn test_get_used_contracts_with_out_of_gas_far_call() { // Execute another transaction with a successful far call and check that it's still charged for decommitment. let account = &mut vm.rich_accounts[0]; - let (_, proxy_counter_abi) = read_proxy_counter_contract(); - let increment = proxy_counter_abi.function("increment").unwrap(); + let increment = TestContract::proxy_counter().function("increment"); let increment_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(data.proxy_counter_address), diff --git a/core/lib/multivm/src/versions/testonly/is_write_initial.rs b/core/lib/multivm/src/versions/testonly/is_write_initial.rs index 849074f106f..436741ac425 100644 --- a/core/lib/multivm/src/versions/testonly/is_write_initial.rs +++ b/core/lib/multivm/src/versions/testonly/is_write_initial.rs @@ -1,7 +1,7 @@ -use zksync_test_contracts::TxType; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::get_nonce_key; -use super::{read_test_contract, tester::VmTesterBuilder, TestedVm}; +use super::{tester::VmTesterBuilder, TestedVm}; use crate::interface::{storage::ReadStorage, TxExecutionMode, VmExecutionMode, VmInterfaceExt}; pub(crate) fn test_is_write_initial_behaviour() { @@ -23,8 +23,9 @@ pub(crate) fn test_is_write_initial_behaviour() { .borrow_mut() .is_write_initial(&nonce_key)); - let contract_code = read_test_contract(); - let tx = account.get_deploy_tx(&contract_code, None, TxType::L2).tx; + let tx = account + .get_deploy_tx(TestContract::counter().bytecode, None, TxType::L2) + .tx; vm.vm.push_transaction(tx); vm.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/testonly/l1_tx_execution.rs b/core/lib/multivm/src/versions/testonly/l1_tx_execution.rs index 8bd22d96225..5420d186df1 100644 --- a/core/lib/multivm/src/versions/testonly/l1_tx_execution.rs +++ b/core/lib/multivm/src/versions/testonly/l1_tx_execution.rs @@ -1,7 +1,7 @@ use ethabi::Token; use zksync_contracts::l1_messenger_contract; use zksync_system_constants::{BOOTLOADER_ADDRESS, L1_MESSENGER_ADDRESS}; -use zksync_test_contracts::TxType; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::{ get_code_key, get_known_code_key, l2_to_l1_log::{L2ToL1Log, UserL2ToL1Log}, @@ -9,7 +9,7 @@ use zksync_types::{ }; use zksync_utils::{h256_to_u256, u256_to_h256}; -use super::{read_test_contract, tester::VmTesterBuilder, TestedVm, BASE_SYSTEM_CONTRACTS}; +use super::{tester::VmTesterBuilder, TestedVm, BASE_SYSTEM_CONTRACTS}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterfaceExt}, utils::StorageWritesDeduplicator, @@ -41,9 +41,12 @@ pub(crate) fn test_l1_tx_execution() { .with_rich_accounts(1) .build::(); - let contract_code = read_test_contract(); let account = &mut vm.rich_accounts[0]; - let deploy_tx = account.get_deploy_tx(&contract_code, None, TxType::L1 { serial_id: 1 }); + let deploy_tx = account.get_deploy_tx( + TestContract::counter().bytecode, + None, + TxType::L1 { serial_id: 1 }, + ); let tx_hash = deploy_tx.tx.hash(); let required_l2_to_l1_logs: Vec<_> = vec![L2ToL1Log { diff --git a/core/lib/multivm/src/versions/testonly/mod.rs b/core/lib/multivm/src/versions/testonly/mod.rs index 838ba98a9aa..9e58dd18c84 100644 --- a/core/lib/multivm/src/versions/testonly/mod.rs +++ b/core/lib/multivm/src/versions/testonly/mod.rs @@ -9,11 +9,9 @@ //! - Tests use [`VmTester`] built using [`VmTesterBuilder`] to create a VM instance. This allows to set up storage for the VM, //! custom [`SystemEnv`] / [`L1BatchEnv`], deployed contracts, pre-funded accounts etc. -use ethabi::Contract; use once_cell::sync::Lazy; use zksync_contracts::{ - load_contract, read_bootloader_code, read_bytecode, read_zbin_bytecode, BaseSystemContracts, - SystemContractCode, + read_bootloader_code, read_zbin_bytecode, BaseSystemContracts, SystemContractCode, }; use zksync_types::{ block::L2BlockHasher, fee_model::BatchFeeInput, get_code_key, get_is_account_key, @@ -60,70 +58,12 @@ fn get_empty_storage() -> InMemoryStorage { InMemoryStorage::with_system_contracts(hash_bytecode) } -pub(crate) fn read_test_contract() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/counter/counter.sol/Counter.json") -} - -fn get_complex_upgrade_abi() -> Contract { - load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/complex-upgrade.sol/ComplexUpgrade.json" - ) -} - -fn read_complex_upgrade() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/complex-upgrade.sol/ComplexUpgrade.json") -} - -fn read_precompiles_contract() -> Vec { - read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json", - ) -} - -fn load_precompiles_contract() -> Contract { - load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json", - ) -} - -fn read_proxy_counter_contract() -> (Vec, Contract) { - const PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/counter/proxy_counter.sol/ProxyCounter.json"; - (read_bytecode(PATH), load_contract(PATH)) -} - -fn read_nonce_holder_tester() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/custom-account/nonce-holder-test.sol/NonceHolderTest.json") -} - -fn read_expensive_contract() -> (Vec, Contract) { - const PATH: &str = - "etc/contracts-test-data/artifacts-zk/contracts/expensive/expensive.sol/Expensive.json"; - (read_bytecode(PATH), load_contract(PATH)) -} - -fn read_many_owners_custom_account_contract() -> (Vec, Contract) { - let path = "etc/contracts-test-data/artifacts-zk/contracts/custom-account/many-owners-custom-account.sol/ManyOwnersCustomAccount.json"; - (read_bytecode(path), load_contract(path)) -} - -fn read_error_contract() -> Vec { - read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/error/error.sol/SimpleRequire.json", - ) -} - pub(crate) fn read_max_depth_contract() -> Vec { read_zbin_bytecode( "core/tests/ts-integration/contracts/zkasm/artifacts/deep_stak.zkasm/deep_stak.zkasm.zbin", ) } -pub(crate) fn read_simple_transfer_contract() -> Vec { - read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/simple-transfer/simple-transfer.sol/SimpleTransfer.json", - ) -} - pub(crate) fn get_bootloader(test: &str) -> SystemContractCode { let bootloader_code = read_bootloader_code(test); let bootloader_hash = hash_bytecode(&bootloader_code); diff --git a/core/lib/multivm/src/versions/testonly/nonce_holder.rs b/core/lib/multivm/src/versions/testonly/nonce_holder.rs index 204aefa6132..2f889f1327d 100644 --- a/core/lib/multivm/src/versions/testonly/nonce_holder.rs +++ b/core/lib/multivm/src/versions/testonly/nonce_holder.rs @@ -1,7 +1,7 @@ -use zksync_test_contracts::Account; +use zksync_test_contracts::{Account, TestContract}; use zksync_types::{Execute, ExecuteTransactionCommon, Nonce}; -use super::{read_nonce_holder_tester, tester::VmTesterBuilder, ContractToDeploy, TestedVm}; +use super::{tester::VmTesterBuilder, ContractToDeploy, TestedVm}; use crate::interface::{ ExecutionResult, Halt, TxExecutionMode, TxRevertReason, VmExecutionMode, VmInterfaceExt, VmRevertReason, @@ -80,7 +80,7 @@ pub(crate) fn test_nonce_holder() { let account_address = builder.rich_account(0).address; let mut vm = builder .with_custom_contracts(vec![ContractToDeploy::account( - read_nonce_holder_tester(), + TestContract::nonce_holder().bytecode.to_vec(), account_address, )]) .build::(); diff --git a/core/lib/multivm/src/versions/testonly/precompiles.rs b/core/lib/multivm/src/versions/testonly/precompiles.rs index 270afab0731..6a17053753b 100644 --- a/core/lib/multivm/src/versions/testonly/precompiles.rs +++ b/core/lib/multivm/src/versions/testonly/precompiles.rs @@ -1,7 +1,8 @@ use circuit_sequencer_api_1_5_0::geometry_config::get_geometry_config; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute}; -use super::{read_precompiles_contract, tester::VmTesterBuilder, TestedVm}; +use super::{tester::VmTesterBuilder, TestedVm}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterfaceExt}, versions::testonly::ContractToDeploy, @@ -10,7 +11,7 @@ use crate::{ pub(crate) fn test_keccak() { // Execute special transaction and check that at least 1000 keccak calls were made. - let contract = read_precompiles_contract(); + let contract = TestContract::precompiles_test().bytecode.to_vec(); let address = Address::repeat_byte(1); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() @@ -46,7 +47,7 @@ pub(crate) fn test_keccak() { pub(crate) fn test_sha256() { // Execute special transaction and check that at least 1000 `sha256` calls were made. - let contract = read_precompiles_contract(); + let contract = TestContract::precompiles_test().bytecode.to_vec(); let address = Address::repeat_byte(1); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() diff --git a/core/lib/multivm/src/versions/testonly/refunds.rs b/core/lib/multivm/src/versions/testonly/refunds.rs index 8f3f5d9a6ce..1896361c919 100644 --- a/core/lib/multivm/src/versions/testonly/refunds.rs +++ b/core/lib/multivm/src/versions/testonly/refunds.rs @@ -1,11 +1,8 @@ use ethabi::Token; -use zksync_test_contracts::TxType; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::{Address, Execute, U256}; -use super::{ - read_expensive_contract, read_test_contract, tester::VmTesterBuilder, ContractToDeploy, - TestedVm, -}; +use super::{tester::VmTesterBuilder, ContractToDeploy, TestedVm}; use crate::interface::{TxExecutionMode, VmExecutionMode, VmInterfaceExt}; pub(crate) fn test_predetermined_refunded_gas() { @@ -19,10 +16,11 @@ pub(crate) fn test_predetermined_refunded_gas() { .build::(); let l1_batch = vm.l1_batch_env.clone(); - let counter = read_test_contract(); let account = &mut vm.rich_accounts[0]; - let tx = account.get_deploy_tx(&counter, None, TxType::L2).tx; + let tx = account + .get_deploy_tx(TestContract::counter().bytecode, None, TxType::L2) + .tx; vm.vm.push_transaction(tx.clone()); let result = vm.vm.execute(VmExecutionMode::OneTx); @@ -159,16 +157,16 @@ pub(crate) fn test_predetermined_refunded_gas() { pub(crate) fn test_negative_pubdata_for_transaction() { let expensive_contract_address = Address::repeat_byte(1); - let (expensive_contract_bytecode, expensive_contract) = read_expensive_contract(); - let expensive_function = expensive_contract.function("expensive").unwrap(); - let cleanup_function = expensive_contract.function("cleanUp").unwrap(); + let expensive_contract = TestContract::expensive(); + let expensive_function = expensive_contract.function("expensive"); + let cleanup_function = expensive_contract.function("cleanUp"); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_execution_mode(TxExecutionMode::VerifyExecute) .with_rich_accounts(1) .with_custom_contracts(vec![ContractToDeploy::new( - expensive_contract_bytecode, + TestContract::expensive().bytecode.to_vec(), expensive_contract_address, )]) .build::(); diff --git a/core/lib/multivm/src/versions/testonly/require_eip712.rs b/core/lib/multivm/src/versions/testonly/require_eip712.rs index 1ea3964d7cd..8cfab77a7e8 100644 --- a/core/lib/multivm/src/versions/testonly/require_eip712.rs +++ b/core/lib/multivm/src/versions/testonly/require_eip712.rs @@ -1,13 +1,12 @@ use ethabi::Token; use zksync_eth_signer::TransactionParameters; +use zksync_test_contracts::TestContract; use zksync_types::{ fee::Fee, l2::L2Tx, transaction_request::TransactionRequest, Address, Eip712Domain, Execute, L2ChainId, Nonce, Transaction, U256, }; -use super::{ - read_many_owners_custom_account_contract, tester::VmTesterBuilder, ContractToDeploy, TestedVm, -}; +use super::{tester::VmTesterBuilder, ContractToDeploy, TestedVm}; use crate::interface::{TxExecutionMode, VmExecutionMode, VmInterfaceExt}; /// This test deploys 'buggy' account abstraction code, and then tries accessing it both with legacy @@ -21,7 +20,7 @@ pub(crate) fn test_require_eip712() { let aa_address = Address::repeat_byte(0x10); let beneficiary_address = Address::repeat_byte(0x20); - let (bytecode, contract) = read_many_owners_custom_account_contract(); + let bytecode = TestContract::many_owners().bytecode.to_vec(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_custom_contracts(vec![ @@ -36,7 +35,7 @@ pub(crate) fn test_require_eip712() { // First, let's set the owners of the AA account to the `private_address`. // (so that messages signed by `private_address`, are authorized to act on behalf of the AA account). - let set_owners_function = contract.function("setOwners").unwrap(); + let set_owners_function = TestContract::many_owners().function("setOwners"); let encoded_input = set_owners_function .encode_input(&[Token::Array(vec![Token::Address(private_account.address)])]) .unwrap(); diff --git a/core/lib/multivm/src/versions/testonly/rollbacks.rs b/core/lib/multivm/src/versions/testonly/rollbacks.rs index c00e2adf704..a5d97cb63dd 100644 --- a/core/lib/multivm/src/versions/testonly/rollbacks.rs +++ b/core/lib/multivm/src/versions/testonly/rollbacks.rs @@ -2,11 +2,12 @@ use std::collections::HashMap; use assert_matches::assert_matches; use ethabi::Token; -use zksync_test_contracts::{DeployContractsTx, LoadnextContractExecutionParams, TxType}; +use zksync_test_contracts::{ + DeployContractsTx, LoadnextContractExecutionParams, TestContract, TxType, +}; use zksync_types::{Address, Execute, Nonce, U256}; use super::{ - read_test_contract, tester::{TransactionTestInfo, TxModifier, VmTesterBuilder}, ContractToDeploy, TestedVm, }; @@ -20,10 +21,10 @@ pub(crate) fn test_vm_rollbacks() { .build::(); let mut account = vm.rich_accounts[0].clone(); - let counter = read_test_contract(); - let tx_0 = account.get_deploy_tx(&counter, None, TxType::L2).tx; - let tx_1 = account.get_deploy_tx(&counter, None, TxType::L2).tx; - let tx_2 = account.get_deploy_tx(&counter, None, TxType::L2).tx; + let counter = TestContract::counter().bytecode; + let tx_0 = account.get_deploy_tx(counter, None, TxType::L2).tx; + let tx_1 = account.get_deploy_tx(counter, None, TxType::L2).tx; + let tx_2 = account.get_deploy_tx(counter, None, TxType::L2).tx; let result_without_rollbacks = vm.execute_and_verify_txs(&vec![ TransactionTestInfo::new_processed(tx_0.clone(), false), @@ -86,16 +87,16 @@ pub(crate) fn test_vm_loadnext_rollbacks() { .build::(); let mut account = vm.rich_accounts[0].clone(); - let _loadnext_contract = (); // FIXME + let loadnext_contract = TestContract::load_test(); let loadnext_constructor_data = &[Token::Uint(U256::from(100))]; let DeployContractsTx { tx: loadnext_deploy_tx, address, .. } = account.get_deploy_tx_with_factory_deps( - &[], // &loadnext_contract.bytecode, + loadnext_contract.bytecode, Some(loadnext_constructor_data), - vec![], // loadnext_contract.factory_deps.clone(), + loadnext_contract.factory_deps(), TxType::L2, ); @@ -173,7 +174,7 @@ pub(crate) fn test_vm_loadnext_rollbacks() { } pub(crate) fn test_rollback_in_call_mode() { - let counter_bytecode = read_test_contract(); + let counter_bytecode = TestContract::counter().bytecode.to_vec(); let counter_address = Address::repeat_byte(1); let mut vm = VmTesterBuilder::new() diff --git a/core/lib/multivm/src/versions/testonly/storage.rs b/core/lib/multivm/src/versions/testonly/storage.rs index 4951272a60c..33fd3bc8709 100644 --- a/core/lib/multivm/src/versions/testonly/storage.rs +++ b/core/lib/multivm/src/versions/testonly/storage.rs @@ -1,15 +1,12 @@ use ethabi::Token; -use zksync_contracts::{load_contract, read_bytecode}; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute, U256}; use super::{tester::VmTesterBuilder, ContractToDeploy, TestedVm}; use crate::interface::{TxExecutionMode, VmExecutionMode, VmInterfaceExt}; fn test_storage(first_tx_calldata: Vec, second_tx_calldata: Vec) -> u32 { - let bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); - + let bytecode = TestContract::storage_test().bytecode.to_vec(); let test_contract_address = Address::repeat_byte(1); // In this test, we aim to test whether a simple account interaction (without any fee logic) @@ -69,32 +66,23 @@ fn test_storage_one_tx(second_tx_calldata: Vec) -> u32 { } pub(crate) fn test_storage_behavior() { - let contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); + let contract = TestContract::storage_test(); // In all of the tests below we provide the first tx to ensure that the tracers will not include // the statistics from the start of the bootloader and will only include those for the transaction itself. let base_pubdata = test_storage_one_tx::(vec![]); - let simple_test_pubdata = test_storage_one_tx::( - contract - .function("simpleWrite") - .unwrap() - .encode_input(&[]) - .unwrap(), - ); + let simple_test_pubdata = + test_storage_one_tx::(contract.function("simpleWrite").encode_input(&[]).unwrap()); let resetting_write_pubdata = test_storage_one_tx::( contract .function("resettingWrite") - .unwrap() .encode_input(&[]) .unwrap(), ); let resetting_write_via_revert_pubdata = test_storage_one_tx::( contract .function("resettingWriteViaRevert") - .unwrap() .encode_input(&[]) .unwrap(), ); @@ -105,19 +93,15 @@ pub(crate) fn test_storage_behavior() { } pub(crate) fn test_transient_storage_behavior() { - let contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/storage/storage.sol/StorageTester.json", - ); + let contract = TestContract::storage_test(); let first_tstore_test = contract .function("testTransientStore") - .unwrap() .encode_input(&[]) .unwrap(); // Second transaction checks that, as expected, the transient storage is cleared after the first transaction. let second_tstore_test = contract .function("assertTValue") - .unwrap() .encode_input(&[Token::Uint(U256::zero())]) .unwrap(); diff --git a/core/lib/multivm/src/versions/testonly/tester/mod.rs b/core/lib/multivm/src/versions/testonly/tester/mod.rs index b3b9026dd38..ae9346952d4 100644 --- a/core/lib/multivm/src/versions/testonly/tester/mod.rs +++ b/core/lib/multivm/src/versions/testonly/tester/mod.rs @@ -1,7 +1,7 @@ use std::{collections::HashSet, fmt}; use zksync_contracts::BaseSystemContracts; -use zksync_test_contracts::{Account, TxType}; +use zksync_test_contracts::{Account, TestContract, TxType}; use zksync_types::{ utils::{deployed_address_create, storage_key_for_eth_balance}, writes::StateDiffRecord, @@ -12,7 +12,7 @@ use zksync_vm_interface::{ }; pub(crate) use self::transaction_test_info::{ExpectedError, TransactionTestInfo, TxModifier}; -use super::{get_empty_storage, read_test_contract}; +use super::get_empty_storage; use crate::{ interface::{ storage::{InMemoryStorage, StoragePtr, StorageView}, @@ -39,9 +39,9 @@ pub(crate) struct VmTester { impl VmTester { pub(crate) fn deploy_test_contract(&mut self) { - let contract = read_test_contract(); + let contract = TestContract::counter().bytecode; let account = &mut self.rich_accounts[0]; - let tx = account.get_deploy_tx(&contract, None, TxType::L2).tx; + let tx = account.get_deploy_tx(contract, None, TxType::L2).tx; let nonce = tx.nonce().unwrap().0.into(); self.vm.push_transaction(tx); self.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/testonly/tracing_execution_error.rs b/core/lib/multivm/src/versions/testonly/tracing_execution_error.rs index e87e6eb7c06..14b4cb4873b 100644 --- a/core/lib/multivm/src/versions/testonly/tracing_execution_error.rs +++ b/core/lib/multivm/src/versions/testonly/tracing_execution_error.rs @@ -1,43 +1,30 @@ -use zksync_contracts::load_contract; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute}; -use super::{ - read_error_contract, tester::VmTesterBuilder, ContractToDeploy, TestedVm, BASE_SYSTEM_CONTRACTS, -}; +use super::{tester::VmTesterBuilder, ContractToDeploy, TestedVm, BASE_SYSTEM_CONTRACTS}; use crate::{ interface::{TxExecutionMode, TxRevertReason, VmRevertReason}, versions::testonly::tester::{ExpectedError, TransactionTestInfo}, }; -fn get_execute_error_calldata() -> Vec { - let test_contract = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/error/error.sol/SimpleRequire.json", - ); - let function = test_contract.function("require_short").unwrap(); - function - .encode_input(&[]) - .expect("failed to encode parameters") -} - pub(crate) fn test_tracing_of_execution_errors() { let contract_address = Address::repeat_byte(1); + let bytecode = TestContract::reverts_test().bytecode.to_vec(); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_base_system_smart_contracts(BASE_SYSTEM_CONTRACTS.clone()) - .with_custom_contracts(vec![ContractToDeploy::new( - read_error_contract(), - contract_address, - )]) + .with_custom_contracts(vec![ContractToDeploy::new(bytecode, contract_address)]) .with_execution_mode(TxExecutionMode::VerifyExecute) .with_rich_accounts(1) .build::(); let account = &mut vm.rich_accounts[0]; + let require_fn = TestContract::reverts_test().function("require_short"); let tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(contract_address), - calldata: get_execute_error_calldata(), + calldata: require_fn.encode_input(&[]).unwrap(), value: Default::default(), factory_deps: vec![], }, diff --git a/core/lib/multivm/src/versions/testonly/transfer.rs b/core/lib/multivm/src/versions/testonly/transfer.rs index 051826a64f2..e67e2ac4de8 100644 --- a/core/lib/multivm/src/versions/testonly/transfer.rs +++ b/core/lib/multivm/src/versions/testonly/transfer.rs @@ -1,5 +1,5 @@ use ethabi::Token; -use zksync_contracts::{load_contract, read_bytecode}; +use zksync_test_contracts::TestContract; use zksync_types::{utils::storage_key_for_eth_balance, Address, Execute, U256}; use zksync_utils::u256_to_h256; @@ -12,33 +12,22 @@ enum TestOptions { } fn test_send_or_transfer(test_option: TestOptions) { - let test_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let recipient_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/Recipient.json", - ); - let test_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - + let test_contract = TestContract::transfer_test(); let test_contract_address = Address::repeat_byte(1); let recipient_address = Address::repeat_byte(2); let (value, calldata) = match test_option { TestOptions::Send(value) => ( value, - test_abi + test_contract .function("send") - .unwrap() .encode_input(&[Token::Address(recipient_address), Token::Uint(value)]) .unwrap(), ), TestOptions::Transfer(value) => ( value, - test_abi + test_contract .function("transfer") - .unwrap() .encode_input(&[Token::Address(recipient_address), Token::Uint(value)]) .unwrap(), ), @@ -55,8 +44,14 @@ fn test_send_or_transfer(test_option: TestOptions) { .with_execution_mode(TxExecutionMode::VerifyExecute) .with_rich_accounts(1) .with_custom_contracts(vec![ - ContractToDeploy::new(test_bytecode, test_contract_address), - ContractToDeploy::new(recipient_bytecode, recipient_address), + ContractToDeploy::new( + TestContract::transfer_test().bytecode.to_vec(), + test_contract_address, + ), + ContractToDeploy::new( + TestContract::transfer_recipient().bytecode.to_vec(), + recipient_address, + ), ]) .build::(); @@ -93,28 +88,16 @@ pub(crate) fn test_send_and_transfer() { } fn test_reentrancy_protection_send_or_transfer(test_option: TestOptions) { - let test_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let reentrant_recipient_bytecode = read_bytecode( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/ReentrantRecipient.json", - ); - let test_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/TransferTest.json", - ); - let reentrant_recipient_abi = load_contract( - "etc/contracts-test-data/artifacts-zk/contracts/transfer/transfer.sol/ReentrantRecipient.json", - ); - + let test_contract = TestContract::transfer_test(); + let reentrant_recipient_contract = TestContract::reentrant_recipient(); let test_contract_address = Address::repeat_byte(1); let reentrant_recipient_address = Address::repeat_byte(2); let (value, calldata) = match test_option { TestOptions::Send(value) => ( value, - test_abi + test_contract .function("send") - .unwrap() .encode_input(&[ Token::Address(reentrant_recipient_address), Token::Uint(value), @@ -123,9 +106,8 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOp ), TestOptions::Transfer(value) => ( value, - test_abi + test_contract .function("transfer") - .unwrap() .encode_input(&[ Token::Address(reentrant_recipient_address), Token::Uint(value), @@ -139,8 +121,14 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOp .with_execution_mode(TxExecutionMode::VerifyExecute) .with_rich_accounts(1) .with_custom_contracts(vec![ - ContractToDeploy::new(test_bytecode, test_contract_address), - ContractToDeploy::new(reentrant_recipient_bytecode, reentrant_recipient_address), + ContractToDeploy::new( + TestContract::transfer_test().bytecode.to_vec(), + test_contract_address, + ), + ContractToDeploy::new( + TestContract::reentrant_recipient().bytecode.to_vec(), + reentrant_recipient_address, + ), ]) .build::(); @@ -149,9 +137,8 @@ fn test_reentrancy_protection_send_or_transfer(test_option: TestOp let tx1 = account.get_l2_tx_for_execute( Execute { contract_address: Some(reentrant_recipient_address), - calldata: reentrant_recipient_abi + calldata: reentrant_recipient_contract .function("setX") - .unwrap() .encode_input(&[]) .unwrap(), value: U256::from(1), diff --git a/core/lib/multivm/src/versions/testonly/upgrade.rs b/core/lib/multivm/src/versions/testonly/upgrade.rs index f17f21f38ec..45e0f4b7868 100644 --- a/core/lib/multivm/src/versions/testonly/upgrade.rs +++ b/core/lib/multivm/src/versions/testonly/upgrade.rs @@ -1,5 +1,5 @@ -use zksync_contracts::{deployer_contract, load_sys_contract, read_bytecode}; -use zksync_test_contracts::TxType; +use zksync_contracts::{deployer_contract, load_sys_contract}; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::{ ethabi::{Contract, Token}, get_code_key, get_known_code_key, @@ -10,10 +10,7 @@ use zksync_types::{ }; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256, u256_to_h256}; -use super::{ - get_complex_upgrade_abi, get_empty_storage, read_complex_upgrade, read_test_contract, - tester::VmTesterBuilder, TestedVm, -}; +use super::{get_empty_storage, tester::VmTesterBuilder, TestedVm}; use crate::interface::{ExecutionResult, Halt, TxExecutionMode, VmExecutionMode, VmInterfaceExt}; /// In this test we ensure that the requirements for protocol upgrade transactions are enforced by the bootloader: @@ -21,7 +18,7 @@ use crate::interface::{ExecutionResult, Halt, TxExecutionMode, VmExecutionMode, /// - If present, this transaction must be the first one in block pub(crate) fn test_protocol_upgrade_is_first() { let mut storage = get_empty_storage(); - let bytecode_hash = hash_bytecode(&read_test_contract()); + let bytecode_hash = hash_bytecode(TestContract::counter().bytecode); storage.set_value(get_known_code_key(&bytecode_hash), u256_to_h256(1.into())); let mut vm = VmTesterBuilder::new() @@ -59,7 +56,11 @@ pub(crate) fn test_protocol_upgrade_is_first() { }]); let normal_l1_transaction = vm.rich_accounts[0] - .get_deploy_tx(&read_test_contract(), None, TxType::L1 { serial_id: 0 }) + .get_deploy_tx( + TestContract::counter().bytecode, + None, + TxType::L1 { serial_id: 0 }, + ) .tx; let expected_error = @@ -109,7 +110,7 @@ pub(crate) fn test_protocol_upgrade_is_first() { /// In this test we try to test how force deployments could be done via protocol upgrade transactions. pub(crate) fn test_force_deploy_upgrade() { let mut storage = get_empty_storage(); - let bytecode_hash = hash_bytecode(&read_test_contract()); + let bytecode_hash = hash_bytecode(TestContract::counter().bytecode); let known_code_key = get_known_code_key(&bytecode_hash); // It is generally expected that all the keys will be set as known prior to the protocol upgrade. storage.set_value(known_code_key, u256_to_h256(1.into())); @@ -154,8 +155,10 @@ pub(crate) fn test_force_deploy_upgrade() { /// Here we show how the work with the complex upgrader could be done. pub(crate) fn test_complex_upgrader() { let mut storage = get_empty_storage(); - let bytecode_hash = hash_bytecode(&read_complex_upgrade()); - let msg_sender_test_hash = hash_bytecode(&read_msg_sender_test()); + let upgrade_bytecode = TestContract::complex_upgrade().bytecode.to_vec(); + let bytecode_hash = hash_bytecode(&upgrade_bytecode); + let msg_sender_test_bytecode = TestContract::msg_sender_test().bytecode.to_vec(); + let msg_sender_test_hash = hash_bytecode(&msg_sender_test_bytecode); // Let's assume that the bytecode for the implementation of the complex upgrade // is already deployed in some address in user space let upgrade_impl = Address::repeat_byte(1); @@ -166,8 +169,8 @@ pub(crate) fn test_complex_upgrader() { u256_to_h256(1.into()), ); storage.set_value(account_code_key, bytecode_hash); - storage.store_factory_dep(bytecode_hash, read_complex_upgrade()); - storage.store_factory_dep(msg_sender_test_hash, read_msg_sender_test()); + storage.store_factory_dep(bytecode_hash, upgrade_bytecode); + storage.store_factory_dep(msg_sender_test_hash, msg_sender_test_bytecode); let mut vm = VmTesterBuilder::new() .with_storage(storage) @@ -266,16 +269,15 @@ fn get_forced_deploy_tx(deployment: &[ForceDeployment]) -> Transaction { // Returns the transaction that performs a complex protocol upgrade. // The first param is the address of the implementation of the complex upgrade // in user-space, while the next 3 params are params of the implementation itself -// For the explanation for the parameters, please refer to: -// etc/contracts-test-data/complex-upgrade/complex-upgrade.sol +// For the explanation for the parameters, please refer to the contract source code. fn get_complex_upgrade_tx( implementation_address: Address, address1: Address, address2: Address, bytecode_hash: H256, ) -> Transaction { - let impl_contract = get_complex_upgrade_abi(); - let impl_function = impl_contract.function("someComplexUpgrade").unwrap(); + let impl_contract = TestContract::complex_upgrade(); + let impl_function = impl_contract.function("someComplexUpgrade"); let impl_calldata = impl_function .encode_input(&[ Token::Address(address1), @@ -313,10 +315,6 @@ fn get_complex_upgrade_tx( } } -fn read_msg_sender_test() -> Vec { - read_bytecode("etc/contracts-test-data/artifacts-zk/contracts/complex-upgrade/msg-sender.sol/MsgSenderTest.json") -} - fn get_complex_upgrader_abi() -> Contract { load_sys_contract("ComplexUpgrader") } diff --git a/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs index e1dfdc7e68c..75050bfb886 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/call_tracer.rs @@ -1,15 +1,14 @@ use std::sync::Arc; use once_cell::sync::OnceCell; +use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute}; use super::TestedLatestVm; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface}, tracers::CallTracer, - versions::testonly::{ - read_max_depth_contract, read_test_contract, ContractToDeploy, VmTesterBuilder, - }, + versions::testonly::{read_max_depth_contract, ContractToDeploy, VmTesterBuilder}, vm_latest::{constants::BATCH_COMPUTATIONAL_GAS_LIMIT, ToTracerPointer}, }; @@ -50,8 +49,8 @@ fn test_max_depth() { #[test] fn test_basic_behavior() { - let contract = read_test_contract(); - let address = Address::random(); + let contract = TestContract::counter().bytecode.to_vec(); + let address = Address::repeat_byte(1); let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_rich_accounts(1) diff --git a/core/lib/multivm/src/versions/vm_latest/tests/evm_emulator.rs b/core/lib/multivm/src/versions/vm_latest/tests/evm_emulator.rs index 41be8aeeee5..b54667ab598 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/evm_emulator.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/evm_emulator.rs @@ -2,11 +2,11 @@ use std::collections::HashMap; use ethabi::Token; use test_casing::{test_casing, Product}; -use zksync_contracts::{load_contract, read_bytecode, SystemContractCode}; +use zksync_contracts::SystemContractCode; use zksync_system_constants::{ CONTRACT_DEPLOYER_ADDRESS, KNOWN_CODES_STORAGE_ADDRESS, L2_BASE_TOKEN_ADDRESS, }; -use zksync_test_contracts::TxType; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::{ get_code_key, get_known_code_key, utils::{key_for_eth_balance, storage_key_for_eth_balance}, @@ -26,17 +26,10 @@ use crate::{ versions::testonly::{default_system_env, VmTester, VmTesterBuilder}, }; -const MOCK_DEPLOYER_PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/mock-evm/mock-evm.sol/MockContractDeployer.json"; -const MOCK_KNOWN_CODE_STORAGE_PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/mock-evm/mock-evm.sol/MockKnownCodeStorage.json"; -const MOCK_EMULATOR_PATH: &str = - "etc/contracts-test-data/artifacts-zk/contracts/mock-evm/mock-evm.sol/MockEvmEmulator.json"; -const RECURSIVE_CONTRACT_PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/mock-evm/mock-evm.sol/NativeRecursiveContract.json"; -const INCREMENTING_CONTRACT_PATH: &str = "etc/contracts-test-data/artifacts-zk/contracts/mock-evm/mock-evm.sol/IncrementingContract.json"; - fn override_system_contracts(storage: &mut InMemoryStorage) { - let mock_deployer = read_bytecode(MOCK_DEPLOYER_PATH); + let mock_deployer = TestContract::mock_deployer().bytecode.to_vec(); let mock_deployer_hash = hash_bytecode(&mock_deployer); - let mock_known_code_storage = read_bytecode(MOCK_KNOWN_CODE_STORAGE_PATH); + let mock_known_code_storage = TestContract::mock_known_code_storage().bytecode.to_vec(); let mock_known_code_storage_hash = hash_bytecode(&mock_known_code_storage); storage.set_value(get_code_key(&CONTRACT_DEPLOYER_ADDRESS), mock_deployer_hash); @@ -83,7 +76,7 @@ impl EvmTestBuilder { } fn build(self) -> VmTester { - let mock_emulator = read_bytecode(MOCK_EMULATOR_PATH); + let mock_emulator = TestContract::mock_evm_emulator().bytecode.to_vec(); let mut storage = self.storage; let mut system_env = default_system_env(); if self.deploy_emulator { @@ -193,7 +186,6 @@ const RECIPIENT_ADDRESS: Address = Address::repeat_byte(0x12); #[test_casing(2, [false, true])] #[test] fn mock_emulator_with_payment(deploy_emulator: bool) { - let mock_emulator_abi = load_contract(MOCK_EMULATOR_PATH); let mut vm = EvmTestBuilder::new(deploy_emulator, RECIPIENT_ADDRESS).build(); let mut current_balance = U256::zero(); @@ -201,7 +193,7 @@ fn mock_emulator_with_payment(deploy_emulator: bool) { let transferred_value = (1_000_000_000 * i).into(); let vm_result = test_payment( &mut vm, - &mock_emulator_abi, + &TestContract::mock_evm_emulator().abi, &mut current_balance, transferred_value, ); @@ -249,7 +241,7 @@ fn test_payment( #[test_casing(4, Product(([false, true], [false, true])))] #[test] fn mock_emulator_with_recursion(deploy_emulator: bool, is_external: bool) { - let mock_emulator_abi = load_contract(MOCK_EMULATOR_PATH); + let mock_emulator_abi = &TestContract::mock_evm_emulator().abi; let recipient_address = Address::repeat_byte(0x12); let mut vm = EvmTestBuilder::new(deploy_emulator, recipient_address).build(); let account = &mut vm.rich_accounts[0]; @@ -268,7 +260,7 @@ fn mock_emulator_with_recursion(deploy_emulator: bool, is_external: bool) { } let factory_deps = if is_external { - vec![read_bytecode(RECURSIVE_CONTRACT_PATH)] + vec![TestContract::recursive_test().bytecode.to_vec()] } else { vec![] }; @@ -296,10 +288,8 @@ fn calling_to_mock_emulator_from_native_contract() { let account = &mut vm.rich_accounts[0]; // Deploy a native contract. - let native_contract = read_bytecode(RECURSIVE_CONTRACT_PATH); - let native_contract_abi = load_contract(RECURSIVE_CONTRACT_PATH); let deploy_tx = account.get_deploy_tx( - &native_contract, + TestContract::recursive_test().bytecode, Some(&[Token::Address(recipient_address)]), TxType::L2, ); @@ -309,7 +299,7 @@ fn calling_to_mock_emulator_from_native_contract() { assert!(!vm_result.result.is_failed(), "{:?}", vm_result.result); // Call from the native contract to the EVM emulator. - let test_fn = native_contract_abi.function("recurse").unwrap(); + let test_fn = TestContract::recursive_test().function("recurse"); let test_tx = account.get_l2_tx_for_execute( Execute { contract_address: Some(deploy_tx.address), @@ -333,7 +323,7 @@ fn mock_emulator_with_deployment() { .build(); let account = &mut vm.rich_accounts[0]; - let mock_emulator_abi = load_contract(MOCK_EMULATOR_PATH); + let mock_emulator_abi = &TestContract::mock_evm_emulator().abi; let new_evm_bytecode = vec![0xfe; 96]; let new_evm_bytecode_hash = hash_evm_bytecode(&new_evm_bytecode); @@ -381,15 +371,14 @@ fn mock_emulator_with_delegate_call() { let account = &mut vm.rich_accounts[0]; // Deploy a native contract. - let native_contract = read_bytecode(INCREMENTING_CONTRACT_PATH); - let native_contract_abi = load_contract(INCREMENTING_CONTRACT_PATH); - let deploy_tx = account.get_deploy_tx(&native_contract, None, TxType::L2); + let deploy_tx = + account.get_deploy_tx(TestContract::increment_test().bytecode, None, TxType::L2); let (_, vm_result) = vm .vm .execute_transaction_with_bytecode_compression(deploy_tx.tx, true); assert!(!vm_result.result.is_failed(), "{:?}", vm_result.result); - let test_fn = native_contract_abi.function("testDelegateCall").unwrap(); + let test_fn = TestContract::increment_test().function("testDelegateCall"); // Delegate to the native contract from EVM. test_delegate_call(&mut vm, test_fn, evm_contract_address, deploy_tx.address); // Delegate to EVM from the native contract. @@ -452,15 +441,14 @@ fn mock_emulator_with_static_call() { let account = &mut vm.rich_accounts[0]; // Deploy a native contract. - let native_contract = read_bytecode(INCREMENTING_CONTRACT_PATH); - let native_contract_abi = load_contract(INCREMENTING_CONTRACT_PATH); - let deploy_tx = account.get_deploy_tx(&native_contract, None, TxType::L2); + let deploy_tx = + account.get_deploy_tx(TestContract::increment_test().bytecode, None, TxType::L2); let (_, vm_result) = vm .vm .execute_transaction_with_bytecode_compression(deploy_tx.tx, true); assert!(!vm_result.result.is_failed(), "{:?}", vm_result.result); - let test_fn = native_contract_abi.function("testStaticCall").unwrap(); + let test_fn = TestContract::increment_test().function("testStaticCall"); // Call to the native contract from EVM. test_static_call(&mut vm, test_fn, evm_contract_address, deploy_tx.address, 0); // Call to EVM from the native contract. diff --git a/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs index bef1eafc381..a70f6dfd331 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/prestate_tracer.rs @@ -1,14 +1,14 @@ use std::sync::Arc; use once_cell::sync::OnceCell; -use zksync_test_contracts::TxType; +use zksync_test_contracts::{TestContract, TxType}; use zksync_types::{utils::deployed_address_create, Execute, U256}; use super::TestedLatestVm; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, tracers::PrestateTracer, - versions::testonly::{read_simple_transfer_contract, VmTesterBuilder}, + versions::testonly::VmTesterBuilder, vm_latest::{constants::BATCH_COMPUTATIONAL_GAS_LIMIT, ToTracerPointer}, }; @@ -56,9 +56,9 @@ fn test_prestate_tracer_diff_mode() { .with_bootloader_gas_limit(BATCH_COMPUTATIONAL_GAS_LIMIT) .with_execution_mode(TxExecutionMode::VerifyExecute) .build::(); - let contract = read_simple_transfer_contract(); + let contract = TestContract::simple_transfer().bytecode; let account = &mut vm.rich_accounts[0]; - let tx = account.get_deploy_tx(&contract, None, TxType::L2).tx; + let tx = account.get_deploy_tx(contract, None, TxType::L2).tx; let nonce = tx.nonce().unwrap().0.into(); vm.vm.push_transaction(tx); vm.vm.execute(VmExecutionMode::OneTx); @@ -66,7 +66,7 @@ fn test_prestate_tracer_diff_mode() { vm.test_contract = Some(deployed_address); // Deploy a second copy of the contract to see its appearance in the pre-state - let tx2 = account.get_deploy_tx(&contract, None, TxType::L2).tx; + let tx2 = account.get_deploy_tx(contract, None, TxType::L2).tx; let nonce2 = tx2.nonce().unwrap().0.into(); vm.vm.push_transaction(tx2); vm.vm.execute(VmExecutionMode::OneTx); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs index a0ae5b6aff4..e2bd43812a8 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/rollbacks.rs @@ -1,5 +1,7 @@ use ethabi::Token; -use zksync_test_contracts::{DeployContractsTx, LoadnextContractExecutionParams, TxType}; +use zksync_test_contracts::{ + DeployContractsTx, LoadnextContractExecutionParams, TestContract, TxType, +}; use zksync_types::{get_nonce_key, U256}; use super::TestedLatestVm; @@ -56,7 +58,7 @@ impl VmTracer for MaxRecursionTracer { } #[test] -fn test_layered_rollback() { +fn layered_rollback() { // This test checks that the layered rollbacks work correctly, i.e. // the rollback by the operator will always revert all the changes @@ -67,14 +69,13 @@ fn test_layered_rollback() { .build::(); let account = &mut vm.rich_accounts[0]; - let loadnext_contract = vec![]; // FIXME let DeployContractsTx { tx: deploy_tx, address, .. } = account.get_deploy_tx( - &loadnext_contract, + TestContract::load_test().bytecode, Some(&[Token::Uint(0.into())]), TxType::L2, ); From b5d98851d6c44d566dda7955bd33b37070296b17 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 18 Oct 2024 16:45:03 +0300 Subject: [PATCH 30/32] Fix `zkstack` --- zkstack_cli/crates/common/src/contracts.rs | 6 ----- .../src/commands/dev/commands/contracts.rs | 23 +++---------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/zkstack_cli/crates/common/src/contracts.rs b/zkstack_cli/crates/common/src/contracts.rs index c95849131c1..256f18eda1a 100644 --- a/zkstack_cli/crates/common/src/contracts.rs +++ b/zkstack_cli/crates/common/src/contracts.rs @@ -4,12 +4,6 @@ use xshell::{cmd, Shell}; use crate::cmd::Cmd; -pub fn build_test_contracts(shell: Shell, link_to_code: PathBuf) -> anyhow::Result<()> { - let _dir_guard = shell.push_dir(link_to_code.join("etc/contracts-test-data")); - Cmd::new(cmd!(shell, "yarn install")).run()?; - Ok(Cmd::new(cmd!(shell, "yarn build")).run()?) -} - pub fn build_l1_contracts(shell: Shell, link_to_code: PathBuf) -> anyhow::Result<()> { let _dir_guard = shell.push_dir(link_to_code.join("contracts/l1-contracts")); Ok(Cmd::new(cmd!(shell, "forge build")).run()?) diff --git a/zkstack_cli/crates/zkstack/src/commands/dev/commands/contracts.rs b/zkstack_cli/crates/zkstack/src/commands/dev/commands/contracts.rs index fbafaec09e6..8e0384cbca9 100644 --- a/zkstack_cli/crates/zkstack/src/commands/dev/commands/contracts.rs +++ b/zkstack_cli/crates/zkstack/src/commands/dev/commands/contracts.rs @@ -2,9 +2,7 @@ use std::path::PathBuf; use clap::Parser; use common::{ - contracts::{ - build_l1_contracts, build_l2_contracts, build_system_contracts, build_test_contracts, - }, + contracts::{build_l1_contracts, build_l2_contracts, build_system_contracts}, logger, spinner::Spinner, }; @@ -14,8 +12,8 @@ use xshell::Shell; use crate::commands::dev::messages::{ MSG_BUILDING_CONTRACTS, MSG_BUILDING_CONTRACTS_SUCCESS, MSG_BUILDING_L1_CONTRACTS_SPINNER, MSG_BUILDING_L2_CONTRACTS_SPINNER, MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER, - MSG_BUILDING_TEST_CONTRACTS_SPINNER, MSG_BUILD_L1_CONTRACTS_HELP, MSG_BUILD_L2_CONTRACTS_HELP, - MSG_BUILD_SYSTEM_CONTRACTS_HELP, MSG_BUILD_TEST_CONTRACTS_HELP, MSG_NOTHING_TO_BUILD_MSG, + MSG_BUILD_L1_CONTRACTS_HELP, MSG_BUILD_L2_CONTRACTS_HELP, MSG_BUILD_SYSTEM_CONTRACTS_HELP, + MSG_NOTHING_TO_BUILD_MSG, }; #[derive(Debug, Parser)] @@ -26,8 +24,6 @@ pub struct ContractsArgs { pub l2_contracts: Option, #[clap(long, alias = "sc", help = MSG_BUILD_SYSTEM_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] pub system_contracts: Option, - #[clap(long, alias = "test", help = MSG_BUILD_TEST_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] - pub test_contracts: Option, } impl ContractsArgs { @@ -35,18 +31,15 @@ impl ContractsArgs { if self.l1_contracts.is_none() && self.l2_contracts.is_none() && self.system_contracts.is_none() - && self.test_contracts.is_none() { return vec![ ContractType::L1, ContractType::L2, ContractType::SystemContracts, - ContractType::TestContracts, ]; } let mut contracts = vec![]; - if self.l1_contracts.unwrap_or(false) { contracts.push(ContractType::L1); } @@ -56,10 +49,6 @@ impl ContractsArgs { if self.system_contracts.unwrap_or(false) { contracts.push(ContractType::SystemContracts); } - if self.test_contracts.unwrap_or(false) { - contracts.push(ContractType::TestContracts); - } - contracts } } @@ -69,7 +58,6 @@ pub enum ContractType { L1, L2, SystemContracts, - TestContracts, } struct ContractBuilder { @@ -96,11 +84,6 @@ impl ContractBuilder { msg: MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER.to_string(), link_to_code: ecosystem.link_to_code.clone(), }, - ContractType::TestContracts => Self { - cmd: Box::new(build_test_contracts), - msg: MSG_BUILDING_TEST_CONTRACTS_SPINNER.to_string(), - link_to_code: ecosystem.link_to_code.clone(), - }, } } From e31e1e5c0796acbdfbc09b1b1bedac99248b6e3f Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 18 Oct 2024 16:57:17 +0300 Subject: [PATCH 31/32] Revert transfer-related contracts --- Cargo.lock | 34 +++++++------------ Cargo.toml | 4 +-- core/lib/test_contracts/build.rs | 8 +++-- .../simple-transfer/simple-transfer.sol | 3 +- .../contracts/transfer/transfer.sol | 5 ++- 5 files changed, 23 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85382f66ab5..a3b51c0d8a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2846,8 +2846,8 @@ dependencies = [ [[package]] name = "foundry-compilers" -version = "0.11.1" -source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +version = "0.11.4" +source = "git+https://github.com/slowli/foundry-compilers.git?rev=afe2718237d423d268bacc13fc5f0dbf01587cf7#afe2718237d423d268bacc13fc5f0dbf01587cf7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -2886,8 +2886,8 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts" -version = "0.11.1" -source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +version = "0.11.4" +source = "git+https://github.com/slowli/foundry-compilers.git?rev=afe2718237d423d268bacc13fc5f0dbf01587cf7#afe2718237d423d268bacc13fc5f0dbf01587cf7" dependencies = [ "foundry-compilers-artifacts-solc", "foundry-compilers-artifacts-vyper", @@ -2896,8 +2896,8 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-solc" -version = "0.11.1" -source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +version = "0.11.4" +source = "git+https://github.com/slowli/foundry-compilers.git?rev=afe2718237d423d268bacc13fc5f0dbf01587cf7#afe2718237d423d268bacc13fc5f0dbf01587cf7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -2919,8 +2919,8 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-vyper" -version = "0.11.1" -source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +version = "0.11.4" +source = "git+https://github.com/slowli/foundry-compilers.git?rev=afe2718237d423d268bacc13fc5f0dbf01587cf7#afe2718237d423d268bacc13fc5f0dbf01587cf7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -2933,8 +2933,8 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-zksolc" -version = "0.11.1" -source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +version = "0.11.4" +source = "git+https://github.com/slowli/foundry-compilers.git?rev=afe2718237d423d268bacc13fc5f0dbf01587cf7#afe2718237d423d268bacc13fc5f0dbf01587cf7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -2954,14 +2954,13 @@ dependencies = [ [[package]] name = "foundry-compilers-core" -version = "0.11.1" -source = "git+https://github.com/Moonsong-Labs/compilers.git?rev=b2aca7f87e0484d1e202d77a4ada8b46b059da6d#b2aca7f87e0484d1e202d77a4ada8b46b059da6d" +version = "0.11.4" +source = "git+https://github.com/slowli/foundry-compilers.git?rev=afe2718237d423d268bacc13fc5f0dbf01587cf7#afe2718237d423d268bacc13fc5f0dbf01587cf7" dependencies = [ "alloy-primitives", "cfg-if", "dunce", "fs_extra", - "memmap2", "once_cell", "path-slash", "regex", @@ -4855,15 +4854,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memmap2" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" -dependencies = [ - "libc", -] - [[package]] name = "merkle_tree_consistency_checker" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 7e293d06ca4..66aab61d23f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -200,8 +200,8 @@ trybuild = "1.0" # "Internal" dependencies vise = "0.2.0" vise-exporter = "0.2.0" - -foundry-compilers = { version = "0.11.1", git = "https://github.com/Moonsong-Labs/compilers.git", rev = "b2aca7f87e0484d1e202d77a4ada8b46b059da6d" } +# FIXME: use the `Moonsong-Labs` repo once the relevant functionality is merged +foundry-compilers = { version = "0.11.4", git = "https://github.com/slowli/foundry-compilers.git", rev = "afe2718237d423d268bacc13fc5f0dbf01587cf7" } # DA clients' dependencies # Avail diff --git a/core/lib/test_contracts/build.rs b/core/lib/test_contracts/build.rs index 4df672c1b98..67f523304b2 100644 --- a/core/lib/test_contracts/build.rs +++ b/core/lib/test_contracts/build.rs @@ -12,7 +12,10 @@ use foundry_compilers::{ Remapping, }, solc, - zksolc::{settings::Optimizer, ZkSettings, ZkSolcCompiler, ZkSolcSettings}, + zksolc::{ + settings::{Optimizer, ZkSolcError, ZkSolcWarning}, + ZkSettings, ZkSolcCompiler, ZkSolcSettings, + }, zksync, zksync::artifact_output::zk::{ZkArtifactOutput, ZkContractArtifact}, ArtifactId, ProjectBuilder, ProjectPathsConfig, @@ -79,7 +82,6 @@ fn save_artifacts( } /// `zksolc` compiler settings. -/// fn compiler_settings() -> ZkSolcSettings { ZkSolcSettings { cli_settings: solc::CliSettings::default(), @@ -98,6 +100,8 @@ fn compiler_settings() -> ZkSolcSettings { }), }, enable_eravm_extensions: true, + suppressed_errors: HashSet::from([ZkSolcError::SendTransfer]), + suppressed_warnings: HashSet::from([ZkSolcWarning::TxOrigin]), ..ZkSettings::default() }, } diff --git a/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol b/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol index 3aa294056a0..8ab5bf330e0 100644 --- a/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol +++ b/core/lib/test_contracts/contracts/simple-transfer/simple-transfer.sol @@ -26,8 +26,7 @@ contract SimpleTransfer { // Function to transfer Ether from this contract to any address function transfer(address _to, uint _amount) public onlyOwner { require(address(this).balance >= _amount, "Insufficient balance in contract"); - (bool success, ) = _to.call{value: _amount}(""); - require(success, "transfer reverted"); + payable(_to).transfer(_amount); } // Function to check the contract's balance diff --git a/core/lib/test_contracts/contracts/transfer/transfer.sol b/core/lib/test_contracts/contracts/transfer/transfer.sol index 4911c4cef09..964fb3b0166 100644 --- a/core/lib/test_contracts/contracts/transfer/transfer.sol +++ b/core/lib/test_contracts/contracts/transfer/transfer.sol @@ -4,12 +4,11 @@ pragma solidity ^0.8.0; contract TransferTest { function transfer(address payable to, uint256 amount) public payable { - (bool success, ) = to.call{value: amount}(""); // FIXME: revert; required because it's impossible to suppress errors - require(success, "transfer reverted"); + to.transfer(amount); } function send(address payable to, uint256 amount) public payable { - (bool success, ) = to.call{value: amount}(""); // FIXME: revert; required because it's impossible to suppress errors + bool success = to.send(amount); require(success, "Transaction failed"); } From 56b4ea4f6722649952431ac5e36cf6e6435e1d60 Mon Sep 17 00:00:00 2001 From: Alex Ostrovski Date: Fri, 18 Oct 2024 17:14:00 +0300 Subject: [PATCH 32/32] Fix link to OpenZeppelin --- core/lib/test_contracts/build.rs | 2 +- core/lib/test_contracts/contract-libs/openzeppelin-contracts | 1 - core/lib/test_contracts/contract-libs/openzeppelin-contracts-v4 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 120000 core/lib/test_contracts/contract-libs/openzeppelin-contracts create mode 120000 core/lib/test_contracts/contract-libs/openzeppelin-contracts-v4 diff --git a/core/lib/test_contracts/build.rs b/core/lib/test_contracts/build.rs index 67f523304b2..e46a32ea688 100644 --- a/core/lib/test_contracts/build.rs +++ b/core/lib/test_contracts/build.rs @@ -116,7 +116,7 @@ fn main() { context: None, name: "@openzeppelin/contracts".into(), path: format!( - "{}/contract-libs/openzeppelin-contracts/contracts", + "{}/contract-libs/openzeppelin-contracts-v4/contracts", env!("CARGO_MANIFEST_DIR") ), }) diff --git a/core/lib/test_contracts/contract-libs/openzeppelin-contracts b/core/lib/test_contracts/contract-libs/openzeppelin-contracts deleted file mode 120000 index a601fb05eb6..00000000000 --- a/core/lib/test_contracts/contract-libs/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -../../../../contracts/l1-contracts/lib/openzeppelin-contracts \ No newline at end of file diff --git a/core/lib/test_contracts/contract-libs/openzeppelin-contracts-v4 b/core/lib/test_contracts/contract-libs/openzeppelin-contracts-v4 new file mode 120000 index 00000000000..ec18125715f --- /dev/null +++ b/core/lib/test_contracts/contract-libs/openzeppelin-contracts-v4 @@ -0,0 +1 @@ +../../../../contracts/l1-contracts/lib/openzeppelin-contracts-v4 \ No newline at end of file