From 5400dd1c9aff03726022901457066026ab57f7a2 Mon Sep 17 00:00:00 2001 From: Saeed Dadkhah Date: Tue, 3 Oct 2023 11:42:24 +0330 Subject: [PATCH] [master] Make scilla tests parallel-friendly. (#3762) * Separate eth signers and zil signers * Add more scilla tests * Remove useless packages * Fix init-signers to batch fund zil addresses * Fix packages * Bump s-h-p version * new tests * bump hardhat-scilla-plugin version * Fix HelloWorld test * Fix FungibleToken tests * Fix GetBalance test * Refactor, add new script to fund from eth accounts * Update CI script * fix ci * Update readme --- scripts/integration_test_js.sh | 1 + .../AddConfigHelpersToHre.ts | 73 +- tests/EvmAcceptanceTests/README.md | 9 +- tests/EvmAcceptanceTests/hardhat.config.ts | 28 +- .../helpers/Parallelizer.ts | 10 +- .../helpers/parallel-tests/SignerPool.ts | 42 +- tests/EvmAcceptanceTests/package-lock.json | 654 ++++++++++-------- tests/EvmAcceptanceTests/package.json | 2 +- .../scripts/FundAccountsFromEth.ts | 45 ++ tests/EvmAcceptanceTests/tasks/Balances.ts | 4 +- tests/EvmAcceptanceTests/tasks/InitSigners.ts | 8 +- .../EvmAcceptanceTests/tasks/ParallelTest.ts | 6 +- tests/EvmAcceptanceTests/tasks/Setup.ts | 2 +- tests/EvmAcceptanceTests/tasks/Test.ts | 4 +- tests/EvmAcceptanceTests/test/Delegatecall.ts | 4 +- tests/EvmAcceptanceTests/test/ERC20Interop.ts | 6 +- tests/EvmAcceptanceTests/test/ERC20isZRC2.ts | 8 +- .../EvmAcceptanceTests/test/GasEstimations.ts | 4 +- tests/EvmAcceptanceTests/test/Transfer.ts | 10 +- .../ContractDeploymentEthers.ts | 4 +- .../openzeppelin/access-control/Ownable.ts | 12 +- .../openzeppelin/access-control/RoleBased.ts | 6 +- .../test/precompiles/EvmPrecompiles.ts | 4 +- .../test/rpc/eth_getTransactionByHash.ts | 2 +- .../test/rpc/eth_getTransactionReceipt.ts | 4 +- tests/EvmAcceptanceTests/test/scilla/ByStr.ts | 20 +- .../EvmAcceptanceTests/test/scilla/ChainId.ts | 15 +- .../test/scilla/Codehash.ts | 15 +- tests/EvmAcceptanceTests/test/scilla/Ecdsa.ts | 16 +- .../test/scilla/FungibleToken.ts | 17 +- .../test/scilla/HelloWorld.ts | 29 +- .../test/scilla/ManualNonce.ts | 16 +- .../EvmAcceptanceTests/test/scilla/SendZil.ts | 19 +- .../test/scilla/Timestamp.ts | 11 +- .../test/zilrpc/GetBalance.ts | 17 +- tests/EvmAcceptanceTests/tsconfig.json | 4 +- 36 files changed, 691 insertions(+), 440 deletions(-) create mode 100644 tests/EvmAcceptanceTests/scripts/FundAccountsFromEth.ts diff --git a/scripts/integration_test_js.sh b/scripts/integration_test_js.sh index b9bb108f9a..3d582a1d98 100755 --- a/scripts/integration_test_js.sh +++ b/scripts/integration_test_js.sh @@ -118,6 +118,7 @@ else cd tests/EvmAcceptanceTests/ npm install + npx hardhat run scripts/FundAccountsFromEth.ts DEBUG=true MOCHA_TIMEOUT=40000 npx hardhat test --bail 2>&1 > npx.out retVal=$? diff --git a/tests/EvmAcceptanceTests/AddConfigHelpersToHre.ts b/tests/EvmAcceptanceTests/AddConfigHelpersToHre.ts index 6481ba394d..f61a4c296d 100644 --- a/tests/EvmAcceptanceTests/AddConfigHelpersToHre.ts +++ b/tests/EvmAcceptanceTests/AddConfigHelpersToHre.ts @@ -6,9 +6,12 @@ import {Contract as Web3Contract} from "web3-eth-contract"; import {SignerWithAddress} from "@nomiclabs/hardhat-ethers/signers"; import {TransactionRequest, TransactionResponse} from "@ethersproject/providers"; import BN from "bn.js"; +import {ScillaContract, Setup} from "hardhat-scilla-plugin"; +import {Account} from "@zilliqa-js/zilliqa"; declare module "hardhat/types/runtime" { interface HardhatRuntimeEnvironment { + zilliqaSetup: Setup; signer_pool: SingerPool; debug: boolean; parallel: boolean; @@ -24,10 +27,15 @@ declare module "hardhat/types/runtime" { getProtocolVersion: () => number; getMiningState: () => boolean; getNetworkName: () => string; - getASignerForContractDeployment: () => Promise; - allocateSigner: () => SignerWithAddress; - releaseSigner: (...signer: SignerWithAddress[]) => void; - sendTransaction: (txn: TransactionRequest) => Promise<{response: TransactionResponse; signer_address: string}>; + getEthSignerForContractDeployment: () => Promise; + getZilSignerForContractDeployment: () => Account; + allocateEthSigner: () => SignerWithAddress; + allocateZilSigner: () => Account; + releaseEthSigner: (...signer: SignerWithAddress[]) => void; + releaseZilSigner: (...signer: Account[]) => void; + sendEthTransaction: (txn: TransactionRequest) => Promise<{response: TransactionResponse; signer_address: string}>; + deployScillaContract2: (name: string, ...args: any[]) => Promise; + deployScillaContractWithSigner: (name: string, signer: Account, ...args: any[]) => Promise; deployContract: (name: string, ...args: any[]) => Promise; deployContractWithSigner: (name: string, signer: Signer, ...args: any[]) => Promise; deployContractWeb3: ( @@ -79,33 +87,66 @@ extendEnvironment((hre: HardhatRuntimeEnvironment) => { return (hre as any).network.name; }; - hre.getASignerForContractDeployment = async (): Promise => { + hre.getEthSignerForContractDeployment = async (): Promise => { if (hre.parallel) { - return hre.signer_pool.takeSigner(); + return hre.signer_pool.takeEthSigner(); } else { return (await hre.ethers.getSigners())[0]; } }; - /// If you call this function, consequently you must call `releaseSigner`, otherwise you'll run out of signers. - hre.allocateSigner = (): SignerWithAddress => { - return hre.signer_pool.takeSigner(); + hre.getZilSignerForContractDeployment = (): Account => { + if (hre.parallel) { + return hre.signer_pool.takeZilSigner(); + } else { + return hre.signer_pool.getZilSigner(0); + } + }; + + /// If you call this function, consequently you must call `releaseEthSigner`, otherwise you'll run out of signers. + hre.allocateEthSigner = (): SignerWithAddress => { + return hre.signer_pool.takeEthSigner(); + }; + + /// If you call this function, consequently you must call `releaseZilSigner`, otherwise you'll run out of signers. + hre.allocateZilSigner = (): Account => { + return hre.signer_pool.takeZilSigner(); }; - hre.releaseSigner = (...signer: SignerWithAddress[]) => { - hre.signer_pool.releaseSigner(...signer); + hre.releaseEthSigner = (...signer: SignerWithAddress[]) => { + hre.signer_pool.releaseEthSigner(...signer); }; - hre.sendTransaction = async (txn: TransactionRequest) => { - const signer = hre.allocateSigner(); + hre.releaseZilSigner = (...signer: Account[]) => { + hre.signer_pool.releaseZilSigner(...signer); + }; + + hre.sendEthTransaction = async (txn: TransactionRequest) => { + const signer = hre.allocateEthSigner(); const response = await signer.sendTransaction(txn); - hre.releaseSigner(signer); + hre.releaseEthSigner(signer); return {response, signer_address: await signer.getAddress()}; }; + hre.deployScillaContract2 = async (name: string, ...args: any[]): Promise => { + const signer = hre.getZilSignerForContractDeployment(); + hre.setActiveAccount(signer); + return hre.deployScillaContract(name, ...args); + }; + + hre.deployScillaContractWithSigner = async ( + name: string, + signer: Account, + ...args: any[] + ): Promise => { + hre.setActiveAccount(signer); + let contract = await hre.deployScillaContract(name, ...args); + return contract.connect(signer); + }; + hre.deployContract = async (name: string, ...args: any[]): Promise => { - const signer = await hre.getASignerForContractDeployment(); + const signer = await hre.getEthSignerForContractDeployment(); return hre.deployContractWithSigner(name, signer, ...args); }; @@ -120,7 +161,7 @@ extendEnvironment((hre: HardhatRuntimeEnvironment) => { options: {gasPrice?: string; gasLimit?: number; value?: BN}, ...args: any[] ): Promise => { - const signer = await hre.getASignerForContractDeployment(); + const signer = await hre.getEthSignerForContractDeployment(); const contractRaw = hre.artifacts.readArtifactSync(contractName); const contract = new hre.web3.eth.Contract(contractRaw.abi); diff --git a/tests/EvmAcceptanceTests/README.md b/tests/EvmAcceptanceTests/README.md index 36fe108848..d765c9dd3f 100644 --- a/tests/EvmAcceptanceTests/README.md +++ b/tests/EvmAcceptanceTests/README.md @@ -401,8 +401,8 @@ npx hardhat transfer --from db11cfa086b92497c8ed5a4cc6edb3a5bfe3a640c43ffb9fc6aa To get the balances of the current accounts, run: ```bash -npx hardhat run scripts/Accounts.js -npx hardhat run scripts/Accounts.js --network public_testnet +npx hardhat run scripts/Accounts.ts +npx hardhat run scripts/Accounts.ts --network public_testnet ``` When you start a testnet, your funds are initially in zil addresses, which is inconvenient. @@ -413,6 +413,11 @@ and moves half of the funds at that address to the same address, but eth style. npx hardhat run scripts/FundAccountsFromZil.ts --network testnet ``` +Similarly you can do the same job if your initial accounts have funds in their eth addresses: +```bash +npx hardhat run scripts/FundAccountsFromEth.ts --network your_network +``` + ## Setup github pre-commit hook You may want to set up pre-commit hook to fix your code before commit by: diff --git a/tests/EvmAcceptanceTests/hardhat.config.ts b/tests/EvmAcceptanceTests/hardhat.config.ts index 776651f562..45c4a3ebf5 100644 --- a/tests/EvmAcceptanceTests/hardhat.config.ts +++ b/tests/EvmAcceptanceTests/hardhat.config.ts @@ -3,9 +3,6 @@ import "@nomiclabs/hardhat-web3"; import {HardhatUserConfig} from "hardhat/types"; import "dotenv/config"; import {ENV_VARS} from "./helpers/EnvVarParser"; -import "./tasks/ZilBalance"; -import "./tasks/Transfer"; -import "./tasks/InitSigners"; import fs from "fs"; if (ENV_VARS.scilla) { @@ -36,7 +33,21 @@ const loadFromSignersFile = (network_name: string): string[] => { const config: HardhatUserConfig = { solidity: "0.8.9", defaultNetwork: "isolated_server", + networks: { + public_devnet: { + url: "https://api.devnet.zilliqa.com", + websocketUrl: "ws://api.devnet.zilliqa.com", + accounts: [ + "4CC853DE4F9FE4A9155185C65B56B6A9B024F896B54528B9E9448B6CD9B8F329", + ...loadFromSignersFile("public_devnet") + ], + chainId: 33385, + zilliqaNetwork: true, + web3ClientVersion: "Zilliqa/v8.2", + protocolVersion: 0x41, + miningState: false + }, localdev2: { url: "http://localdev-l2api.localdomain", websocketUrl: "ws://localdev-l2api.localdomain", @@ -130,13 +141,20 @@ import "./AddConfigHelpersToHre"; import {extendEnvironment} from "hardhat/config"; import SignerPool from "./helpers/parallel-tests/SignerPool"; extendEnvironment(async (hre) => { + const private_keys: string[] = hre.network["config"]["accounts"] as string[]; + hre.debug = ENV_VARS.debug; hre.scillaTesting = ENV_VARS.scilla; hre.signer_pool = new SignerPool(); + hre.zilliqaSetup = initZilliqa(hre.getNetworkUrl(), hre.getZilliqaChainId(), private_keys, 30); }); -import "./tasks/Balances"; // To fix tsc error -import "./tasks/Setup"; // To fix tsc error +import "./tasks/Balances"; +import "./tasks/Setup"; import "./tasks/ParallelTest"; import "./tasks/Test"; +import "./tasks/ZilBalance"; +import "./tasks/Transfer"; +import "./tasks/InitSigners"; +import {initZilliqa} from "hardhat-scilla-plugin"; export default config; diff --git a/tests/EvmAcceptanceTests/helpers/Parallelizer.ts b/tests/EvmAcceptanceTests/helpers/Parallelizer.ts index 0a048dad3e..ce9b5b3e2a 100644 --- a/tests/EvmAcceptanceTests/helpers/Parallelizer.ts +++ b/tests/EvmAcceptanceTests/helpers/Parallelizer.ts @@ -2,6 +2,7 @@ import {getAddressFromPrivateKey} from "@zilliqa-js/crypto"; import BN from "bn.js"; import hre, {ethers as hh_ethers, web3} from "hardhat"; import {initZilliqa, ScillaContract, Setup, UserDefinedLibrary} from "hardhat-scilla-plugin"; +import {} from "hardhat-scilla-plugin/dist/src/index"; export type DeployOptions = { gasPrice?: string; @@ -11,13 +12,9 @@ export type DeployOptions = { export class Parallelizer { constructor() { - let privateKey = "254d9924fc1dcdca44ce92d80255c6a0bb690f867abde80e626fbfef4d357004"; - if (process.env.PRIMARY_ACCOUNT !== undefined) { - privateKey = process.env.PRIMARY_ACCOUNT; - } + const private_keys: string[] = hre.network["config"]["accounts"] as string[]; - this.zilliqaAccountAddress = getAddressFromPrivateKey(privateKey); - this.zilliqaSetup = initZilliqa(hre.getNetworkUrl(), hre.getZilliqaChainId(), [privateKey], 30); + this.zilliqaSetup = initZilliqa(hre.getNetworkUrl(), hre.getZilliqaChainId(), private_keys, 30); } async deployScillaContract(contractName: string, ...args: any[]): Promise { @@ -36,7 +33,6 @@ export class Parallelizer { return hre.deployScillaContractWithLib(libraryName, userDefinedLibraries, ...args); } - zilliqaAccountAddress: string; zilliqaSetup: Setup; } diff --git a/tests/EvmAcceptanceTests/helpers/parallel-tests/SignerPool.ts b/tests/EvmAcceptanceTests/helpers/parallel-tests/SignerPool.ts index c9af7cb38c..6343c43281 100644 --- a/tests/EvmAcceptanceTests/helpers/parallel-tests/SignerPool.ts +++ b/tests/EvmAcceptanceTests/helpers/parallel-tests/SignerPool.ts @@ -1,27 +1,49 @@ import {SignerWithAddress} from "@nomiclabs/hardhat-ethers/signers"; +import {Account} from "@zilliqa-js/account"; export default class SignerPool { - public takeSigner(): SignerWithAddress { - if (this.signers.length == 0) { + public takeEthSigner(): SignerWithAddress { + if (this.eth_signers.length == 0) { throw new Error( "No more signers to return. Either you haven't initialized this pool, or you just ran out of signers." ); } - return this.signers.pop()!; + return this.eth_signers.pop()!; } - public initSigners(...signer: SignerWithAddress[]) { - this.releaseSigner(...signer); + public takeZilSigner(): Account { + if (this.zil_signers.length == 0) { + throw new Error( + "No more signers to return. Either you haven't initialized this pool, or you just ran out of signers." + ); + } + + return this.zil_signers.pop()!; + } + + public initSigners(signer: SignerWithAddress[], privateKeys: string[]) { + this.releaseEthSigner(...signer); + + this.zil_signers.push(...privateKeys.map((key) => new Account(key))); + } + + public releaseEthSigner(...signer: SignerWithAddress[]) { + this.eth_signers.push(...signer); + } + + public releaseZilSigner(...signer: Account[]) { + this.zil_signers.push(...signer); } - public releaseSigner(...signer: SignerWithAddress[]) { - this.signers.push(...signer); + public getZilSigner(index: number): Account { + return this.zil_signers[index]; } - public count(): number { - return this.signers.length; + public count(): [eth_count: number, zil_count: number] { + return [this.eth_signers.length, this.zil_signers.length]; } - private signers: SignerWithAddress[] = []; + private eth_signers: SignerWithAddress[] = []; + private zil_signers: Account[] = []; } diff --git a/tests/EvmAcceptanceTests/package-lock.json b/tests/EvmAcceptanceTests/package-lock.json index 0e77e27195..3b36fd2221 100644 --- a/tests/EvmAcceptanceTests/package-lock.json +++ b/tests/EvmAcceptanceTests/package-lock.json @@ -46,7 +46,7 @@ "ethers": "^5.7.1", "hardhat": "^2.13.0", "hardhat-gas-reporter": "^1.0.9", - "hardhat-scilla-plugin": "^3.1.3", + "hardhat-scilla-plugin": "^3.6.0", "husky": "^8.0.3", "jest-circus": "^29.6.2", "lint-staged": "^13.2.0", @@ -604,6 +604,32 @@ "node": ">=6.9.0" } }, + "node_modules/@chainsafe/as-sha256": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", + "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", + "dev": true + }, + "node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", + "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", + "dev": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "node_modules/@chainsafe/ssz": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", + "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", + "dev": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, "node_modules/@cronvel/get-pixels": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@cronvel/get-pixels/-/get-pixels-3.4.1.tgz", @@ -2409,34 +2435,36 @@ } }, "node_modules/@nomicfoundation/ethereumjs-block": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.0.0.tgz", - "integrity": "sha512-bk8uP8VuexLgyIZAHExH1QEovqx0Lzhc9Ntm63nCRKLHXIZkobaFaeCVwTESV7YkPKUk7NiK11s8ryed4CS9yA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz", + "integrity": "sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "ethereum-cryptography": "0.1.3" + "@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" }, "engines": { "node": ">=14" } }, "node_modules/@nomicfoundation/ethereumjs-blockchain": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.0.0.tgz", - "integrity": "sha512-pLFEoea6MWd81QQYSReLlLfH7N9v7lH66JC/NMPN848ySPPQA5renWnE7wPByfQFzNrPBuDDRFFULMDmj1C0xw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz", + "integrity": "sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-ethash": "^2.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@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", @@ -2449,24 +2477,24 @@ } }, "node_modules/@nomicfoundation/ethereumjs-common": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.0.0.tgz", - "integrity": "sha512-WS7qSshQfxoZOpHG/XqlHEGRG1zmyjYrvmATvc4c62+gZXgre1ymYP8ZNgx/3FyZY0TWe9OjFlKOfLqmgOeYwA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz", + "integrity": "sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.1", "crc-32": "^1.2.0" } }, "node_modules/@nomicfoundation/ethereumjs-ethash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.0.tgz", - "integrity": "sha512-WpDvnRncfDUuXdsAXlI4lXbqUDOA+adYRQaEezIkxqDkc+LDyYDbd/xairmY98GnQzo1zIqsIL6GB5MoMSJDew==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz", + "integrity": "sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@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" @@ -2476,15 +2504,15 @@ } }, "node_modules/@nomicfoundation/ethereumjs-evm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.0.0.tgz", - "integrity": "sha512-hVS6qRo3V1PLKCO210UfcEQHvlG7GqR8iFzp0yyjTg2TmJQizcChKgWo8KFsdMw6AyoLgLhHGHw4HdlP8a4i+Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz", + "integrity": "sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "@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", @@ -2495,9 +2523,9 @@ } }, "node_modules/@nomicfoundation/ethereumjs-rlp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.0.tgz", - "integrity": "sha512-GaSOGk5QbUk4eBP5qFbpXoZoZUj/NrW7MRa0tKY4Ew4c2HAS0GXArEMAamtFrkazp0BO4K5p2ZCG3b2FmbShmw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz", + "integrity": "sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==", "dev": true, "bin": { "rlp": "bin/rlp" @@ -2507,28 +2535,28 @@ } }, "node_modules/@nomicfoundation/ethereumjs-statemanager": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.0.tgz", - "integrity": "sha512-jCtqFjcd2QejtuAMjQzbil/4NHf5aAWxUc+CvS0JclQpl+7M0bxMofR2AJdtz+P3u0ke2euhYREDiE7iSO31vQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz", + "integrity": "sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1" + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" } }, "node_modules/@nomicfoundation/ethereumjs-trie": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.0.tgz", - "integrity": "sha512-LIj5XdE+s+t6WSuq/ttegJzZ1vliwg6wlb+Y9f4RlBpuK35B9K02bO7xU+E6Rgg9RGptkWd6TVLdedTI4eNc2A==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz", + "integrity": "sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@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" }, @@ -2537,14 +2565,16 @@ } }, "node_modules/@nomicfoundation/ethereumjs-tx": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.0.0.tgz", - "integrity": "sha512-Gg3Lir2lNUck43Kp/3x6TfBNwcWC9Z1wYue9Nz3v4xjdcv6oDW9QSMJxqsKw9QEGoBBZ+gqwpW7+F05/rs/g1w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz", + "integrity": "sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@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" }, "engines": { @@ -2552,38 +2582,55 @@ } }, "node_modules/@nomicfoundation/ethereumjs-util": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.0.tgz", - "integrity": "sha512-2emi0NJ/HmTG+CGY58fa+DQuAoroFeSH9gKu9O6JnwTtlzJtgfTixuoOqLEgyyzZVvwfIpRueuePb8TonL1y+A==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz", + "integrity": "sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "^4.0.0-beta.2", + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", "ethereum-cryptography": "0.1.3" }, "engines": { "node": ">=14" } }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", + "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", + "dev": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/ssz": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", + "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", + "dev": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + }, "node_modules/@nomicfoundation/ethereumjs-vm": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.0.0.tgz", - "integrity": "sha512-JMPxvPQ3fzD063Sg3Tp+UdwUkVxMoo1uML6KSzFhMH3hoQi/LMuXBoEHAoW83/vyNS9BxEe6jm6LmT5xdeEJ6w==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz", + "integrity": "sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==", + "dev": true, + "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", - "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "rustbn.js": "~0.2.0" }, @@ -4422,12 +4469,6 @@ "node": ">= 10.0.0" } }, - "node_modules/@types/async-eventemitter": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@types/async-eventemitter/-/async-eventemitter-0.2.1.tgz", - "integrity": "sha512-M2P4Ng26QbAeITiH7w1d7OxtldgfAe0wobpyJzVK/XOb0cUGKU2R4pfAhqcJBXAe2ife5ZOhSv4wk7p+ffURtg==", - "dev": true - }, "node_modules/@types/bignumber.js": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@types/bignumber.js/-/bignumber.js-5.0.0.tgz", @@ -4650,6 +4691,22 @@ "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", "dev": true }, + "node_modules/@types/readable-stream": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", + "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + } + }, + "node_modules/@types/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/@types/responselike": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", @@ -5244,24 +5301,6 @@ "node": ">=8" } }, - "node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dev": true, - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "dev": true, - "dependencies": { - "async": "^2.4.0" - } - }, "node_modules/async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -5437,24 +5476,12 @@ } }, "node_modules/bigint-crypto-utils": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.1.6.tgz", - "integrity": "sha512-k5ljSLHx94jQTW3+18KEfxLJR8/XFBHqhfhEGF48qT8p/jL6EdiG7oNOiiIRGMFh2wEP8kaCXZbVd+5dYkngUg==", - "dev": true, - "dependencies": { - "bigint-mod-arith": "^3.1.0" - }, - "engines": { - "node": ">=10.4.0" - } - }, - "node_modules/bigint-mod-arith": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.1.1.tgz", - "integrity": "sha512-SzFqdncZKXq5uh3oLFZXmzaZEMDsA7ml9l53xKaVGO6/+y26xNwAaTQEg2R+D+d07YduLbKi0dni3YPsR51UDQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz", + "integrity": "sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==", "dev": true, "engines": { - "node": ">=10.4.0" + "node": ">=14.0.0" } }, "node_modules/bignumber.js": { @@ -5870,6 +5897,15 @@ } ] }, + "node_modules/case": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", + "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -6151,16 +6187,16 @@ "dev": true }, "node_modules/classic-level": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.2.0.tgz", - "integrity": "sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", "dev": true, "hasInstallScript": true, "dependencies": { "abstract-level": "^1.0.2", "catering": "^2.1.0", "module-error": "^1.0.1", - "napi-macros": "~2.0.0", + "napi-macros": "^2.2.2", "node-gyp-build": "^4.3.0" }, "engines": { @@ -9815,23 +9851,23 @@ } }, "node_modules/hardhat": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.13.0.tgz", - "integrity": "sha512-ZlzBOLML1QGlm6JWyVAG8lVTEAoOaVm1in/RU2zoGAnYEoD1Rp4T+ZMvrLNhHaaeS9hfjJ1gJUBfiDr4cx+htQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.16.1.tgz", + "integrity": "sha512-QpBjGXFhhSYoYBGEHyoau/A63crZOP+i3GbNxzLGkL6IklzT+piN14+wGnINNCg5BLSKisQI/RAySPzaWRcx/g==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@nomicfoundation/ethereumjs-vm": "^6.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", @@ -9859,7 +9895,6 @@ "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", - "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", @@ -9905,21 +9940,26 @@ } }, "node_modules/hardhat-scilla-plugin": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hardhat-scilla-plugin/-/hardhat-scilla-plugin-3.1.3.tgz", - "integrity": "sha512-zlW9I3wlQQBOfEfRp1F1pw9Z4+m13XwdEJj0RCL5JRn40Sgr1F6htAmKHJOrZceOGak1IursF/5f0T1pTDKa0Q==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/hardhat-scilla-plugin/-/hardhat-scilla-plugin-3.6.0.tgz", + "integrity": "sha512-S8wxl0e9iFOqgE6eCdJ2Lmfi2Euz0N7lLG8crA8aheVX4S5M8K7q6rmeK4uCEHxeuoD4NX2zio4QEgaDZsb3AQ==", "dev": true, "dependencies": { "@ethersproject/bignumber": "^5.7.0", "@types/chai-subset": "^1.3.3", + "@zilliqa-js/account": "^3.4.3", + "@zilliqa-js/contract": "^3.4.3", + "@zilliqa-js/core": "^3.4.3", + "@zilliqa-js/crypto": "^3.4.3", + "@zilliqa-js/util": "^3.4.3", "chai-subset": "^1.6.0", "cli-color": "^2.0.3", - "glob": "^8.0.3", + "glob": "^8.1.0", "s-expression": "^3.1.1" }, "peerDependencies": { - "@zilliqa-js/zilliqa": "^3.3.4", - "hardhat": "^2.0.0" + "@zilliqa-js/zilliqa": "^3.4.3", + "hardhat": "~2.16.0" } }, "node_modules/hardhat/node_modules/ethereum-cryptography": { @@ -13539,9 +13579,9 @@ } }, "node_modules/napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", "dev": true }, "node_modules/natural-compare": { @@ -19755,6 +19795,32 @@ "to-fast-properties": "^2.0.0" } }, + "@chainsafe/as-sha256": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", + "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", + "dev": true + }, + "@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", + "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", + "dev": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "@chainsafe/ssz": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", + "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", + "dev": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, "@cronvel/get-pixels": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@cronvel/get-pixels/-/get-pixels-3.4.1.tgz", @@ -21043,31 +21109,33 @@ } }, "@nomicfoundation/ethereumjs-block": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.0.0.tgz", - "integrity": "sha512-bk8uP8VuexLgyIZAHExH1QEovqx0Lzhc9Ntm63nCRKLHXIZkobaFaeCVwTESV7YkPKUk7NiK11s8ryed4CS9yA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz", + "integrity": "sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "ethereum-cryptography": "0.1.3" + "@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": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.0.0.tgz", - "integrity": "sha512-pLFEoea6MWd81QQYSReLlLfH7N9v7lH66JC/NMPN848ySPPQA5renWnE7wPByfQFzNrPBuDDRFFULMDmj1C0xw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz", + "integrity": "sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-ethash": "^2.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@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", @@ -21077,39 +21145,39 @@ } }, "@nomicfoundation/ethereumjs-common": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.0.0.tgz", - "integrity": "sha512-WS7qSshQfxoZOpHG/XqlHEGRG1zmyjYrvmATvc4c62+gZXgre1ymYP8ZNgx/3FyZY0TWe9OjFlKOfLqmgOeYwA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz", + "integrity": "sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.1", "crc-32": "^1.2.0" } }, "@nomicfoundation/ethereumjs-ethash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.0.tgz", - "integrity": "sha512-WpDvnRncfDUuXdsAXlI4lXbqUDOA+adYRQaEezIkxqDkc+LDyYDbd/xairmY98GnQzo1zIqsIL6GB5MoMSJDew==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz", + "integrity": "sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@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": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.0.0.tgz", - "integrity": "sha512-hVS6qRo3V1PLKCO210UfcEQHvlG7GqR8iFzp0yyjTg2TmJQizcChKgWo8KFsdMw6AyoLgLhHGHw4HdlP8a4i+Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz", + "integrity": "sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "@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", @@ -21117,80 +21185,101 @@ } }, "@nomicfoundation/ethereumjs-rlp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.0.tgz", - "integrity": "sha512-GaSOGk5QbUk4eBP5qFbpXoZoZUj/NrW7MRa0tKY4Ew4c2HAS0GXArEMAamtFrkazp0BO4K5p2ZCG3b2FmbShmw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz", + "integrity": "sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==", "dev": true }, "@nomicfoundation/ethereumjs-statemanager": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.0.tgz", - "integrity": "sha512-jCtqFjcd2QejtuAMjQzbil/4NHf5aAWxUc+CvS0JclQpl+7M0bxMofR2AJdtz+P3u0ke2euhYREDiE7iSO31vQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz", + "integrity": "sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1" + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" } }, "@nomicfoundation/ethereumjs-trie": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.0.tgz", - "integrity": "sha512-LIj5XdE+s+t6WSuq/ttegJzZ1vliwg6wlb+Y9f4RlBpuK35B9K02bO7xU+E6Rgg9RGptkWd6TVLdedTI4eNc2A==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz", + "integrity": "sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@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": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.0.0.tgz", - "integrity": "sha512-Gg3Lir2lNUck43Kp/3x6TfBNwcWC9Z1wYue9Nz3v4xjdcv6oDW9QSMJxqsKw9QEGoBBZ+gqwpW7+F05/rs/g1w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz", + "integrity": "sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@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": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.0.tgz", - "integrity": "sha512-2emi0NJ/HmTG+CGY58fa+DQuAoroFeSH9gKu9O6JnwTtlzJtgfTixuoOqLEgyyzZVvwfIpRueuePb8TonL1y+A==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz", + "integrity": "sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-rlp": "^4.0.0-beta.2", + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", "ethereum-cryptography": "0.1.3" + }, + "dependencies": { + "@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", + "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", + "dev": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "@chainsafe/ssz": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", + "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", + "dev": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + } } }, "@nomicfoundation/ethereumjs-vm": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.0.0.tgz", - "integrity": "sha512-JMPxvPQ3fzD063Sg3Tp+UdwUkVxMoo1uML6KSzFhMH3hoQi/LMuXBoEHAoW83/vyNS9BxEe6jm6LmT5xdeEJ6w==", - "dev": true, - "requires": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz", + "integrity": "sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==", + "dev": true, + "requires": { + "@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", - "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "rustbn.js": "~0.2.0" } @@ -22668,12 +22757,6 @@ } } }, - "@types/async-eventemitter": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@types/async-eventemitter/-/async-eventemitter-0.2.1.tgz", - "integrity": "sha512-M2P4Ng26QbAeITiH7w1d7OxtldgfAe0wobpyJzVK/XOb0cUGKU2R4pfAhqcJBXAe2ife5ZOhSv4wk7p+ffURtg==", - "dev": true - }, "@types/bignumber.js": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@types/bignumber.js/-/bignumber.js-5.0.0.tgz", @@ -22894,6 +22977,24 @@ "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", "dev": true }, + "@types/readable-stream": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", + "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", + "dev": true, + "requires": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, "@types/responselike": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", @@ -23395,24 +23496,6 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, - "async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "dev": true, - "requires": { - "async": "^2.4.0" - } - }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -23548,18 +23631,9 @@ "dev": true }, "bigint-crypto-utils": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.1.6.tgz", - "integrity": "sha512-k5ljSLHx94jQTW3+18KEfxLJR8/XFBHqhfhEGF48qT8p/jL6EdiG7oNOiiIRGMFh2wEP8kaCXZbVd+5dYkngUg==", - "dev": true, - "requires": { - "bigint-mod-arith": "^3.1.0" - } - }, - "bigint-mod-arith": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.1.1.tgz", - "integrity": "sha512-SzFqdncZKXq5uh3oLFZXmzaZEMDsA7ml9l53xKaVGO6/+y26xNwAaTQEg2R+D+d07YduLbKi0dni3YPsR51UDQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz", + "integrity": "sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==", "dev": true }, "bignumber.js": { @@ -23881,6 +23955,12 @@ "integrity": "sha512-fnx1grfpEOvDGH+V17eccmNjucGUnCbP6KL+l5KqBIerp26WK/+RQ7CIDE37KGJjaPyqWXXlFUyKiWmvdNNKmQ==", "dev": true }, + "case": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", + "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -24100,15 +24180,15 @@ "dev": true }, "classic-level": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.2.0.tgz", - "integrity": "sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", "dev": true, "requires": { "abstract-level": "^1.0.2", "catering": "^2.1.0", "module-error": "^1.0.1", - "napi-macros": "~2.0.0", + "napi-macros": "^2.2.2", "node-gyp-build": "^4.3.0" } }, @@ -26955,23 +27035,23 @@ } }, "hardhat": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.13.0.tgz", - "integrity": "sha512-ZlzBOLML1QGlm6JWyVAG8lVTEAoOaVm1in/RU2zoGAnYEoD1Rp4T+ZMvrLNhHaaeS9hfjJ1gJUBfiDr4cx+htQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.16.1.tgz", + "integrity": "sha512-QpBjGXFhhSYoYBGEHyoau/A63crZOP+i3GbNxzLGkL6IklzT+piN14+wGnINNCg5BLSKisQI/RAySPzaWRcx/g==", "dev": true, "requires": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@nomicfoundation/ethereumjs-vm": "^6.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", @@ -26999,7 +27079,6 @@ "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", - "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", @@ -27058,16 +27137,21 @@ } }, "hardhat-scilla-plugin": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hardhat-scilla-plugin/-/hardhat-scilla-plugin-3.1.3.tgz", - "integrity": "sha512-zlW9I3wlQQBOfEfRp1F1pw9Z4+m13XwdEJj0RCL5JRn40Sgr1F6htAmKHJOrZceOGak1IursF/5f0T1pTDKa0Q==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/hardhat-scilla-plugin/-/hardhat-scilla-plugin-3.6.0.tgz", + "integrity": "sha512-S8wxl0e9iFOqgE6eCdJ2Lmfi2Euz0N7lLG8crA8aheVX4S5M8K7q6rmeK4uCEHxeuoD4NX2zio4QEgaDZsb3AQ==", "dev": true, "requires": { "@ethersproject/bignumber": "^5.7.0", "@types/chai-subset": "^1.3.3", + "@zilliqa-js/account": "^3.4.3", + "@zilliqa-js/contract": "^3.4.3", + "@zilliqa-js/core": "^3.4.3", + "@zilliqa-js/crypto": "^3.4.3", + "@zilliqa-js/util": "^3.4.3", "chai-subset": "^1.6.0", "cli-color": "^2.0.3", - "glob": "^8.0.3", + "glob": "^8.1.0", "s-expression": "^3.1.1" } }, @@ -29752,9 +29836,9 @@ "dev": true }, "napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", "dev": true }, "natural-compare": { diff --git a/tests/EvmAcceptanceTests/package.json b/tests/EvmAcceptanceTests/package.json index 7339391d50..28ffdd9d3a 100644 --- a/tests/EvmAcceptanceTests/package.json +++ b/tests/EvmAcceptanceTests/package.json @@ -40,7 +40,7 @@ "ethers": "^5.7.1", "hardhat": "^2.13.0", "hardhat-gas-reporter": "^1.0.9", - "hardhat-scilla-plugin": "^3.1.3", + "hardhat-scilla-plugin": "^3.6.0", "husky": "^8.0.3", "jest-circus": "^29.6.2", "lint-staged": "^13.2.0", diff --git a/tests/EvmAcceptanceTests/scripts/FundAccountsFromEth.ts b/tests/EvmAcceptanceTests/scripts/FundAccountsFromEth.ts new file mode 100644 index 0000000000..cd77a10e1c --- /dev/null +++ b/tests/EvmAcceptanceTests/scripts/FundAccountsFromEth.ts @@ -0,0 +1,45 @@ +import {Account} from "@zilliqa-js/zilliqa"; +import hre, {ethers} from "hardhat"; + +async function main() { + const signers = await ethers.getSigners(); + const private_keys: string[] = hre.network["config"]["accounts"] as string[]; + + console.log(""); + console.log("Starting transfer..."); + + let txns = []; + for (const pv_index in private_keys) { + const privateKey = private_keys[pv_index]; + const ethSigner = signers[pv_index]; + + // Get corresponding eth account + const zilAccount = new Account(privateKey); + console.log("Account to send to: ", zilAccount.address); + + const signerBalance = await ethSigner.getBalance(); + if (signerBalance.isZero()) { + console.log(`Skipping eth signer: ${ethSigner.address} with zero balance`); + continue; + } + + txns.push( + ethSigner.sendTransaction({ + to: zilAccount.address.toLowerCase(), + value: signerBalance.div(2) + }) + ); + } + + await Promise.all(txns); + + console.log(""); + await hre.run("balances", {zil: true}); +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); diff --git a/tests/EvmAcceptanceTests/tasks/Balances.ts b/tests/EvmAcceptanceTests/tasks/Balances.ts index e7579a0f17..90258dc468 100644 --- a/tests/EvmAcceptanceTests/tasks/Balances.ts +++ b/tests/EvmAcceptanceTests/tasks/Balances.ts @@ -2,7 +2,7 @@ import clc from "cli-color"; import {task} from "hardhat/config"; import {ethers} from "ethers"; import {HardhatRuntimeEnvironment} from "hardhat/types"; -import {BN, Zilliqa, getAddressFromPrivateKey} from "@zilliqa-js/zilliqa"; +import {BN, Zilliqa, getAddressFromPrivateKey, units} from "@zilliqa-js/zilliqa"; task("balances", "A task to get balances of signers in the config") .addFlag("zil", "Show balances in zil based addresses of private keys") @@ -52,7 +52,7 @@ const printZilBalances = async (hre: HardhatRuntimeEnvironment) => { balanceString = clc.red.bold(balanceResult.error.message); } else { const balance = new BN(balanceResult.result.balance); - balanceString = balance.toString(); + balanceString = units.fromQa(balance, units.Units.Zil); } displayBalance(++index, address, balanceString, error ? "" : "zil"); diff --git a/tests/EvmAcceptanceTests/tasks/InitSigners.ts b/tests/EvmAcceptanceTests/tasks/InitSigners.ts index 5da74ad521..dfbc52a9d2 100644 --- a/tests/EvmAcceptanceTests/tasks/InitSigners.ts +++ b/tests/EvmAcceptanceTests/tasks/InitSigners.ts @@ -5,6 +5,7 @@ import fs from "fs"; import {join} from "path"; import clc from "cli-color"; import ora from "ora"; +import {getAddressFromPrivateKey} from "@zilliqa-js/zilliqa"; task("init-signers", "A task to init signers") .addParam("from", "Sender's private key") @@ -63,10 +64,13 @@ const createAccountsEth = async ( const accounts = Array.from({length: count}, (v, k) => ethers.Wallet.createRandom().connect(hre.ethers.provider)); - const addresses = accounts.map((signer) => signer.address); + const addresses = [ + ...accounts.map((signer) => signer.address), + ...accounts.map((signer) => getAddressFromPrivateKey(signer.privateKey).toLocaleLowerCase()) + ]; await hre.deployContractWithSigner("BatchTransferCtor", wallet, addresses, amount, { - value: amount.mul(count) + value: amount.mul(addresses.length) }); return accounts; diff --git a/tests/EvmAcceptanceTests/tasks/ParallelTest.ts b/tests/EvmAcceptanceTests/tasks/ParallelTest.ts index 2d993152f9..d75c47db70 100644 --- a/tests/EvmAcceptanceTests/tasks/ParallelTest.ts +++ b/tests/EvmAcceptanceTests/tasks/ParallelTest.ts @@ -13,7 +13,7 @@ task("parallel-test", "Runs test in parallel") .addOptionalParam("grep", "Only run tests matching the given string or regexp") .setAction(async (taskArgs, hre) => { hre.run("compile"); - const signersCount = hre.signer_pool.count(); + const [eth_signer_count, zil_signer_count] = hre.signer_pool.count(); const {grep, testFiles}: {grep: string | undefined; testFiles: string[]} = taskArgs; @@ -44,7 +44,9 @@ task("parallel-test", "Runs test in parallel") // Display results await hre.run("parallel-test:output-results", {failures}); - console.log(`🪪 ${clc.bold.white(signersCount - hre.signer_pool.count())} signers used.`); + const [current_eth_signer_count, current_zil_signer_count] = hre.signer_pool.count(); + console.log(`🪪 ${clc.bold.white(eth_signer_count - current_eth_signer_count)} eth signers used.`); + console.log(`🪪 ${clc.bold.white(zil_signer_count - current_zil_signer_count)} zil signers used.`); }); subtask("parallel-test:run-tsc", "Runs tsc to make sure everything's synced").setAction(async () => { diff --git a/tests/EvmAcceptanceTests/tasks/Setup.ts b/tests/EvmAcceptanceTests/tasks/Setup.ts index f05f79b19a..e1e7327d5b 100644 --- a/tests/EvmAcceptanceTests/tasks/Setup.ts +++ b/tests/EvmAcceptanceTests/tasks/Setup.ts @@ -60,7 +60,7 @@ task("setup", "A task to setup test suite").setAction(async (taskArgs, hre) => { } if (address_type == AddressType.EvmBased) { - await hre.run("init-signers", {from: private_key, count: "30", balance: "1", append}); + await hre.run("init-signers", {from: private_key, count: "30", balance: "10", append}); } else if (address_type == AddressType.ZilBased) { console.log("To be supported"); } diff --git a/tests/EvmAcceptanceTests/tasks/Test.ts b/tests/EvmAcceptanceTests/tasks/Test.ts index b30b0a4672..3edb40bd38 100644 --- a/tests/EvmAcceptanceTests/tasks/Test.ts +++ b/tests/EvmAcceptanceTests/tasks/Test.ts @@ -5,8 +5,10 @@ task("test") .addFlag("logJsonrpc", "Log JSON RPC ") .addFlag("logTxnid", "Log JSON RPC ") .setAction(async (taskArgs, hre, runSuper): Promise => { + console.log(clc.yellow(`⚠️ Your ${clc.bold("Eth/Zil")} accounts supposed to have funds to run tests successfully.`)); let signers = await hre.ethers.getSigners(); - hre.signer_pool.initSigners(...signers); + const private_keys: string[] = hre.network["config"]["accounts"] as string[]; + hre.signer_pool.initSigners(signers, private_keys); let balances = await Promise.all(signers.map((signer) => signer.getBalance())); if (taskArgs.logJsonrpc || taskArgs.logTxnid) { diff --git a/tests/EvmAcceptanceTests/test/Delegatecall.ts b/tests/EvmAcceptanceTests/test/Delegatecall.ts index 7e0e8534f7..99cdf73e44 100644 --- a/tests/EvmAcceptanceTests/test/Delegatecall.ts +++ b/tests/EvmAcceptanceTests/test/Delegatecall.ts @@ -8,13 +8,13 @@ describe("Delegatecall functionality #parallel", function () { let testDelegateContract: Contract; let signer: SignerWithAddress; before(async function () { - signer = hre.allocateSigner(); + signer = hre.allocateEthSigner(); delegateContract = await hre.deployContractWithSigner("Delegatecall", signer); testDelegateContract = await hre.deployContractWithSigner("TestDelegatecall", signer); }); after(function () { - hre.releaseSigner(signer); + hre.releaseEthSigner(signer); }); it("should delegate function call correctly @block-1", async function () { diff --git a/tests/EvmAcceptanceTests/test/ERC20Interop.ts b/tests/EvmAcceptanceTests/test/ERC20Interop.ts index d2468d7a87..6ae4de26c3 100644 --- a/tests/EvmAcceptanceTests/test/ERC20Interop.ts +++ b/tests/EvmAcceptanceTests/test/ERC20Interop.ts @@ -16,7 +16,7 @@ describe("ERC20 Interop", function () { this.skip(); } - contractOwner = hre.allocateSigner(); + contractOwner = hre.allocateEthSigner(); zrc2_contract = await parallelizer.deployScillaContract( "ZRC2Interop", @@ -26,7 +26,7 @@ describe("ERC20 Interop", function () { 2, 1_000 ); - alice = hre.allocateSigner(); + alice = hre.allocateEthSigner(); bridge_contract = await hre.deployContractWithSigner( "ERC20Interop", contractOwner, @@ -35,7 +35,7 @@ describe("ERC20 Interop", function () { }); after(() => { - hre.releaseSigner(contractOwner, alice); + hre.releaseEthSigner(contractOwner, alice); }); it("Interop Should be deployed successfully", async function () { diff --git a/tests/EvmAcceptanceTests/test/ERC20isZRC2.ts b/tests/EvmAcceptanceTests/test/ERC20isZRC2.ts index e805ec36ec..4fd0c85768 100644 --- a/tests/EvmAcceptanceTests/test/ERC20isZRC2.ts +++ b/tests/EvmAcceptanceTests/test/ERC20isZRC2.ts @@ -35,7 +35,7 @@ describe("ERC20 Is ZRC2", function () { this.skip(); } - contractOwner = hre.allocateSigner(); + contractOwner = hre.allocateEthSigner(); zrc2_contract = await parallelizer.deployScillaContract( "FungibleToken", @@ -45,8 +45,8 @@ describe("ERC20 Is ZRC2", function () { 2, 1_000 ); - alice = hre.allocateSigner(); - bob = hre.allocateSigner(); + alice = hre.allocateEthSigner(); + bob = hre.allocateEthSigner(); erc20_contract = await hre.deployContractWithSigner( "ERC20isZRC2", contractOwner, @@ -57,7 +57,7 @@ describe("ERC20 Is ZRC2", function () { }); after(() => { - hre.releaseSigner(alice, bob, contractOwner); + hre.releaseEthSigner(alice, bob, contractOwner); }); it("Interop Should be deployed successfully", async function () { diff --git a/tests/EvmAcceptanceTests/test/GasEstimations.ts b/tests/EvmAcceptanceTests/test/GasEstimations.ts index c912557481..132d30b1b8 100644 --- a/tests/EvmAcceptanceTests/test/GasEstimations.ts +++ b/tests/EvmAcceptanceTests/test/GasEstimations.ts @@ -7,7 +7,7 @@ describe("Gas estimation with web3.js", function () { describe("When a fund transfer is made", function () { it("should return proper estimation [@transactional]", async function () { const to = ethers.Wallet.createRandom(); - const signer = hre.allocateSigner(); + const signer = hre.allocateEthSigner(); const gasAmountEst = await ethers.provider.estimateGas({ to: to.address, from: signer.address, @@ -21,7 +21,7 @@ describe("Gas estimation with web3.js", function () { const receipt = await txn.wait(); expect(gasAmountEst).to.be.equal(receipt.gasUsed); - hre.releaseSigner(signer); + hre.releaseEthSigner(signer); }); }); diff --git a/tests/EvmAcceptanceTests/test/Transfer.ts b/tests/EvmAcceptanceTests/test/Transfer.ts index fafec2f2d5..6191a0143a 100644 --- a/tests/EvmAcceptanceTests/test/Transfer.ts +++ b/tests/EvmAcceptanceTests/test/Transfer.ts @@ -38,7 +38,7 @@ describe("ForwardZil contract functionality #parallel", function () { it("should be possible to transfer ethers to the contract @block-2", async function () { const prevBalance = await ethers.provider.getBalance(contract.address); - const {response} = await hre.sendTransaction({ + const {response} = await hre.sendEthTransaction({ to: contract.address, value: FUND }); @@ -55,7 +55,7 @@ describe("Transfer ethers #parallel", function () { it("should be possible to transfer ethers to a user account @block-1", async function () { const payee = ethers.Wallet.createRandom(); - const {response} = await hre.sendTransaction({ + const {response} = await hre.sendEthTransaction({ to: payee.address, value: FUND }); @@ -144,7 +144,7 @@ describe("Transfer ethers #parallel", function () { let initialBal = await ethers.provider.getBalance(randomAccount); expect(initialBal).to.be.eq(0); - const owner = hre.allocateSigner(); + const owner = hre.allocateEthSigner(); let InitialOwnerbal = await ethers.provider.getBalance(owner.address); // check enough funds + gas @@ -162,7 +162,7 @@ describe("Transfer ethers #parallel", function () { const receivedBal = await ethers.provider.getBalance(randomAccount); expect(receivedBal).to.be.eq(TRANSFER_VALUE); - hre.releaseSigner(owner); + hre.releaseEthSigner(owner); }); // Disabled in q4-working-branch @@ -171,7 +171,7 @@ describe("Transfer ethers #parallel", function () { const FUND = BigNumber.from(200_000_000_000_000_000n); - const tx = await hre.sendTransaction({ + const tx = await hre.sendEthTransaction({ to: rndAccount.address, value: FUND }); diff --git a/tests/EvmAcceptanceTests/test/contract-deployment/ContractDeploymentEthers.ts b/tests/EvmAcceptanceTests/test/contract-deployment/ContractDeploymentEthers.ts index d14689b43f..6a18fdb802 100755 --- a/tests/EvmAcceptanceTests/test/contract-deployment/ContractDeploymentEthers.ts +++ b/tests/EvmAcceptanceTests/test/contract-deployment/ContractDeploymentEthers.ts @@ -9,13 +9,13 @@ describe("Contract Deployment using Ethers.js #parallel", function () { let nonceBeforeDeploy: number; let zeroParamConstructor: Contract; before(async function () { - signer = hre.allocateSigner(); + signer = hre.allocateEthSigner(); nonceBeforeDeploy = await ethers.provider.getTransactionCount(signer.getAddress()); zeroParamConstructor = await hre.deployContractWithSigner("ZeroParamConstructor", signer); }); after(() => { - hre.releaseSigner(signer); + hre.releaseEthSigner(signer); }); it("Should be deployed successfully @block-1 [@transactional]", async function () { diff --git a/tests/EvmAcceptanceTests/test/openzeppelin/access-control/Ownable.ts b/tests/EvmAcceptanceTests/test/openzeppelin/access-control/Ownable.ts index 68abf9bbc8..996501d2b3 100644 --- a/tests/EvmAcceptanceTests/test/openzeppelin/access-control/Ownable.ts +++ b/tests/EvmAcceptanceTests/test/openzeppelin/access-control/Ownable.ts @@ -22,22 +22,22 @@ describe("Openzeppelin ownable contract functionality #parallel", function () { }); it("should not be possible to call a restricted function using an arbitrary account @block-1", async function () { - const notOwner = hre.allocateSigner(); + const notOwner = hre.allocateEthSigner(); await expect(contract.connect(notOwner).store(123)).to.be.revertedWith("Ownable: caller is not the owner"); - hre.releaseSigner(notOwner); + hre.releaseEthSigner(notOwner); }); it("should be possible to call a unrestricted function @block-2", async function () { - const notOwner = hre.allocateSigner(); + const notOwner = hre.allocateEthSigner(); expect(await contract.connect(notOwner).retrieve()).to.be.equal(123); - hre.releaseSigner(notOwner); + hre.releaseEthSigner(notOwner); }); it("should be possible to transfer ownership @block-2", async function () { const prevOwner = contract.signer as SignerWithAddress; - newOwner = hre.allocateSigner(); + newOwner = hre.allocateEthSigner(); await expect(contract.transferOwnership(newOwner.address)) .to.emit(contract, "OwnershipTransferred") @@ -48,6 +48,6 @@ describe("Openzeppelin ownable contract functionality #parallel", function () { // We changed the owner in previous test. await contract.connect(newOwner).renounceOwnership(); await expect(contract.connect(newOwner).store(123)).to.be.revertedWith("Ownable: caller is not the owner"); - hre.releaseSigner(newOwner); + hre.releaseEthSigner(newOwner); }); }); diff --git a/tests/EvmAcceptanceTests/test/openzeppelin/access-control/RoleBased.ts b/tests/EvmAcceptanceTests/test/openzeppelin/access-control/RoleBased.ts index 1e966d0b4d..d15f7c2049 100644 --- a/tests/EvmAcceptanceTests/test/openzeppelin/access-control/RoleBased.ts +++ b/tests/EvmAcceptanceTests/test/openzeppelin/access-control/RoleBased.ts @@ -13,14 +13,14 @@ describe("Openzeppelin role based access control functionality", function () { before(async function () { user = ethers.Wallet.createRandom(); - minter = hre.allocateSigner(); + minter = hre.allocateEthSigner(); contract = await hre.deployContract("OpenZeppelinRoleBasedToken", minter.address); defaultAdmin = contract.signer; - burner = hre.allocateSigner(); + burner = hre.allocateEthSigner(); }); after(function () { - hre.releaseSigner(minter, burner); + hre.releaseEthSigner(minter, burner); }); it("should return true if hasRole is called for minter and MINTER_ROLE", async function () { diff --git a/tests/EvmAcceptanceTests/test/precompiles/EvmPrecompiles.ts b/tests/EvmAcceptanceTests/test/precompiles/EvmPrecompiles.ts index 24c8983ff8..120468ae5a 100644 --- a/tests/EvmAcceptanceTests/test/precompiles/EvmPrecompiles.ts +++ b/tests/EvmAcceptanceTests/test/precompiles/EvmPrecompiles.ts @@ -52,12 +52,12 @@ describe("Precompile tests with web3.js #parallel", function () { const modulus = 10; const expectedResult = 8; - const signer = hre.allocateSigner(); + const signer = hre.allocateEthSigner(); const sendResult = await contract.methods.testModexp(base, exponent, modulus).send({ from: signer.address }); - hre.releaseSigner(signer); + hre.releaseEthSigner(signer); expect(sendResult).to.be.not.null; const readValue = await contract.methods.modExpResult().call({gasLimit: 50000}); diff --git a/tests/EvmAcceptanceTests/test/rpc/eth_getTransactionByHash.ts b/tests/EvmAcceptanceTests/test/rpc/eth_getTransactionByHash.ts index c7c70e39f8..0e5a7b7ba8 100644 --- a/tests/EvmAcceptanceTests/test/rpc/eth_getTransactionByHash.ts +++ b/tests/EvmAcceptanceTests/test/rpc/eth_getTransactionByHash.ts @@ -9,7 +9,7 @@ describe(`Calling ${METHOD} #parallel`, function () { // FIXME: https://zilliqa-jira.atlassian.net/browse/EM-53 xit("should have valid structure in response", async function () { const to = ethers.Wallet.createRandom(); - const {response, signer_address} = await hre.sendTransaction({ + const {response, signer_address} = await hre.sendEthTransaction({ to: to.address, value: 1_000_000 }); diff --git a/tests/EvmAcceptanceTests/test/rpc/eth_getTransactionReceipt.ts b/tests/EvmAcceptanceTests/test/rpc/eth_getTransactionReceipt.ts index 3803654fd8..2a5bdaeacd 100644 --- a/tests/EvmAcceptanceTests/test/rpc/eth_getTransactionReceipt.ts +++ b/tests/EvmAcceptanceTests/test/rpc/eth_getTransactionReceipt.ts @@ -17,12 +17,12 @@ describe(`Calling ${METHOD} #parallel`, function () { let amount = 10_000; // send amount from primary to secondary account const to = ethers.Wallet.createRandom(); - const signer = hre.signer_pool.takeSigner(); + const signer = hre.allocateEthSigner(); const response = await signer.sendTransaction({ to: to.address, value: amount }); - hre.signer_pool.releaseSigner(signer); + hre.releaseEthSigner(signer); const transactionHash = response.hash; await response.wait(); diff --git a/tests/EvmAcceptanceTests/test/scilla/ByStr.ts b/tests/EvmAcceptanceTests/test/scilla/ByStr.ts index 9816df86b4..a653d29253 100644 --- a/tests/EvmAcceptanceTests/test/scilla/ByStr.ts +++ b/tests/EvmAcceptanceTests/test/scilla/ByStr.ts @@ -1,31 +1,29 @@ import {ScillaContract} from "hardhat-scilla-plugin"; import {expect} from "chai"; import hre from "hardhat"; -import {parallelizer} from "../../helpers"; +import {Account} from "@zilliqa-js/zilliqa"; -describe("Scilla ByStr Functionality", function () { +describe("Scilla ByStr Functionality #parallel", function () { let contract: ScillaContract; + let signer: Account; let BYSTR5_VALUE = "0x1234567890"; let BYSTR6_VALUE = "0x223344556677"; before(async function () { - if (!hre.isZilliqaNetworkSelected() || !hre.isScillaTestingEnabled()) { - this.skip(); - } - - contract = await parallelizer.deployScillaContract("ByStrFunctionality"); + signer = hre.allocateZilSigner(); + contract = await hre.deployScillaContractWithSigner("ByStrFunctionality", signer); }); - it("Should be deployed successfully", async function () { + it("Should be deployed successfully @block-1", async function () { expect(contract.address).to.be.properAddress; }); - it("should return ByStr5 field", async function () { + it("should return ByStr5 field @block-1", async function () { const tx = await contract.getByStr5Field(); expect(tx).to.have.eventLogWithParams("getByStr5()", {value: BYSTR5_VALUE, vname: "value"}); }); - it("should return expected value if builtin concat is called", async function () { + it("should return expected value if builtin concat is called @block-2", async function () { const tx = await contract.getByStrConcat(); expect(tx).to.have.eventLogWithParams("getByStrConcat()", { value: BYSTR5_VALUE + BYSTR6_VALUE.substring(2), @@ -33,7 +31,7 @@ describe("Scilla ByStr Functionality", function () { }); }); - it("should return expected value if builtin strlen is called", async function () { + it("should return expected value if builtin strlen is called @block-3", async function () { const tx = await contract.getByStrLen("0x112233"); expect(await contract.bystr_len()).to.be.eq(3); }); diff --git a/tests/EvmAcceptanceTests/test/scilla/ChainId.ts b/tests/EvmAcceptanceTests/test/scilla/ChainId.ts index 4b134c919b..2518697ad3 100644 --- a/tests/EvmAcceptanceTests/test/scilla/ChainId.ts +++ b/tests/EvmAcceptanceTests/test/scilla/ChainId.ts @@ -1,17 +1,22 @@ const {expect} = require("chai"); import {ScillaContract} from "hardhat-scilla-plugin"; -import {parallelizer} from "../../helpers"; import hre from "hardhat"; +import {Account} from "@zilliqa-js/zilliqa"; -describe("ChainId contract", () => { +describe("ChainId contract #parallel", () => { let contract: ScillaContract; + let signer: Account; - it("Deploy chainId contract", async () => { - contract = await parallelizer.deployScillaContract("ChainId"); + before(async () => { + signer = hre.allocateZilSigner(); + contract = await hre.deployScillaContractWithSigner("ChainId", signer); + }); + + it("Deploy chainId contract @block-1", async () => { expect(contract.address).to.be.properAddress; }); - it("Call chain id contract - EventChainId", async () => { + it("Call chain id contract - EventChainId @block-1", async () => { const tx = await contract.EventChainID(); expect(tx).to.have.eventLogWithParams("ChainID", {value: hre.getZilliqaChainId()}); diff --git a/tests/EvmAcceptanceTests/test/scilla/Codehash.ts b/tests/EvmAcceptanceTests/test/scilla/Codehash.ts index 551a5d37bf..7b38aa3541 100644 --- a/tests/EvmAcceptanceTests/test/scilla/Codehash.ts +++ b/tests/EvmAcceptanceTests/test/scilla/Codehash.ts @@ -1,18 +1,21 @@ -const {assert, expect} = require("chai"); +import {assert, expect} from "chai"; import {ScillaContract} from "hardhat-scilla-plugin"; -import {parallelizer} from "../../helpers"; +import hre from "hardhat"; const {createHash} = require("crypto"); -describe("Codehash contract", () => { +describe("Codehash contract #parallel", () => { let expectedCodeHash: string; let contract: ScillaContract; - it("Deploy codehash contract", async () => { - contract = await parallelizer.deployScillaContract("Codehash"); + before(async () => { + contract = await hre.deployScillaContract2("Codehash"); + }); + + it("Deploy codehash contract @block-1", async () => { expectedCodeHash = "0x" + createHash("sha256").update(contract.code).digest("hex"); assert.isTrue(contract.address !== undefined); }); - it("Call code hash contract - Foo transition", async () => { + it("Call code hash contract - Foo transition #block-2", async () => { let tx1 = await contract.foo(contract.address!.toLowerCase()); const codeHash1 = tx1.receipt.event_logs[0].params[0].value; expect(tx1.receipt.success).equal(true); diff --git a/tests/EvmAcceptanceTests/test/scilla/Ecdsa.ts b/tests/EvmAcceptanceTests/test/scilla/Ecdsa.ts index 3237c016cb..09ffecd1ee 100644 --- a/tests/EvmAcceptanceTests/test/scilla/Ecdsa.ts +++ b/tests/EvmAcceptanceTests/test/scilla/Ecdsa.ts @@ -1,15 +1,19 @@ const {assert, expect} = require("chai"); import {ScillaContract} from "hardhat-scilla-plugin"; -import {parallelizer} from "../../helpers"; +import hre from "hardhat"; -describe("Ecdsa contract", () => { +describe("Ecdsa contract #parallel", () => { let contract: ScillaContract; - it("Deploy ecdsa contract", async () => { - contract = await parallelizer.deployScillaContract("Ecdsa"); + + before(async () => { + contract = await hre.deployScillaContract2("Ecdsa"); + }); + + it("Deploy ecdsa contract @block-1", async () => { assert.isTrue(contract.address !== undefined); }); - it("recover invalid input and failed", async () => { + it("recover invalid input and failed @block-1", async () => { const tx = await contract.recover( "0x1beedbe103d0b0da3f0ff6f8b614569c92174fb82e04c6676f9aa94b994774c5", "0x5f2afac816d9430bce53e081667378790bb5b703ea4a98234649ccac8a358f7a262553d9df46d8417239138bc69db8c458620093b2124937c6a5af2d86f0014e", @@ -20,7 +24,7 @@ describe("Ecdsa contract", () => { assert.include(tx.receipt.exceptions[0].message, "Sign.read_recoverable_exn: recid must be 0, 1, 2 or 3"); }); - it("recover valid input and failed", async () => { + it("recover valid input and failed @block-2", async () => { const tx = await contract.recover( "0x1beedbe103d0b0da3f0ff6f8b614569c92174fb82e04c6676f9aa94b994774c5", "0x5f2afac816d9430bce53e081667378790bb5b703ea4a98234649ccac8a358f7a262553d9df46d8417239138bc69db8c458620093b2124937c6a5af2d86f0014e", diff --git a/tests/EvmAcceptanceTests/test/scilla/FungibleToken.ts b/tests/EvmAcceptanceTests/test/scilla/FungibleToken.ts index fb50c17873..09aea42d2b 100644 --- a/tests/EvmAcceptanceTests/test/scilla/FungibleToken.ts +++ b/tests/EvmAcceptanceTests/test/scilla/FungibleToken.ts @@ -2,9 +2,11 @@ import {ScillaContract} from "hardhat-scilla-plugin"; import {expect} from "chai"; import hre from "hardhat"; import {parallelizer} from "../../helpers"; +import {Account} from "@zilliqa-js/zilliqa"; describe("Scilla Fungible token contract", function () { let contract: ScillaContract; + let signer: Account; let null_contract: ScillaContract; let aliceAddress: string; let bobAddress: string; @@ -22,9 +24,12 @@ describe("Scilla Fungible token contract", function () { this.skip(); } - contract = await parallelizer.deployScillaContract( + signer = hre.allocateZilSigner(); + + contract = await hre.deployScillaContractWithSigner( "FungibleToken", - parallelizer.zilliqaAccountAddress, + signer, + signer.address, "Saeed's Token", "SDT", 2, @@ -33,7 +38,11 @@ describe("Scilla Fungible token contract", function () { null_contract = await parallelizer.deployScillaContract("HelloWorld", "0xBFe2445408C51CD8Ee6727541195b02c891109ee"); aliceAddress = parallelizer.zilliqaSetup.zilliqa.wallet.create().toLocaleLowerCase(); bobAddress = parallelizer.zilliqaSetup.zilliqa.wallet.create().toLocaleLowerCase(); - ownerAddress = parallelizer.zilliqaAccountAddress; + ownerAddress = signer.address; + }); + + after(function () { + hre.releaseZilSigner(signer); }); it("Should be deployed successfully", async function () { @@ -49,7 +58,7 @@ describe("Scilla Fungible token contract", function () { }); it("Should have 1000 as contract owner's balance", async function () { - const owner_balance = (await contract.balances())[parallelizer.zilliqaAccountAddress.toLowerCase()]; + const owner_balance = (await contract.balances())[ownerAddress.toLowerCase()]; expect(Number(owner_balance)).to.be.eq(1000); }); diff --git a/tests/EvmAcceptanceTests/test/scilla/HelloWorld.ts b/tests/EvmAcceptanceTests/test/scilla/HelloWorld.ts index a75cc530c9..bc450ab062 100644 --- a/tests/EvmAcceptanceTests/test/scilla/HelloWorld.ts +++ b/tests/EvmAcceptanceTests/test/scilla/HelloWorld.ts @@ -1,47 +1,52 @@ import {expect} from "chai"; -import hre, {ethers} from "hardhat"; +import hre from "hardhat"; import {ScillaContract} from "hardhat-scilla-plugin"; -import {parallelizer} from "../../helpers"; -import {BN, Zilliqa} from "@zilliqa-js/zilliqa"; +import {Account, Zilliqa} from "@zilliqa-js/zilliqa"; -describe("Scilla HelloWorld contract", function () { +describe("Scilla HelloWorld contract #parallel", function () { let contract: ScillaContract; + let signer: Account; before(async function () { if (!hre.isZilliqaNetworkSelected() || !hre.isScillaTestingEnabled()) { this.skip(); } - contract = await parallelizer.deployScillaContract("HelloWorld", parallelizer.zilliqaAccountAddress); + signer = hre.allocateZilSigner(); + contract = await hre.deployScillaContractWithSigner("HelloWorld", signer, signer.address); }); - it("Should be deployed successfully", async function () { + after(function () { + hre.releaseZilSigner(signer); + }); + + it("Should be deployed successfully @block-1", async function () { expect(contract.address).to.be.properAddress; }); - it("Can be possible to call setHello by the owner", async function () { + it("Can be possible to call setHello by the owner @block-1", async function () { const tx = await contract.setHello("salam"); expect(tx).to.eventLogWithParams("setHello()", {value: "2", vname: "code"}); expect(await contract.welcome_msg()).to.be.eq("salam"); }); - it("Should send getHello() event when getHello() transition is called", async function () { + it("Should send getHello() event when getHello() transition is called @block-2", async function () { const tx = await contract.getHello(); expect(tx).to.have.eventLogWithParams("getHello()", {value: "salam", vname: "msg", type: "String"}); }); it("Should cost gas for failed transaction due to execution error", async function () { const zilliqa = new Zilliqa(hre.getNetworkUrl()); - const balanceBefore = await zilliqa.blockchain.getBalance(parallelizer.zilliqaAccountAddress); + const balanceBefore = await zilliqa.blockchain.getBalance(signer.address); await contract.throwError(); - const balanceAfter = await zilliqa.blockchain.getBalance(parallelizer.zilliqaAccountAddress); + const balanceAfter = await zilliqa.blockchain.getBalance(signer.address); expect(Number.parseInt(balanceAfter.result.balance)).to.be.lt(Number.parseInt(balanceBefore.result.balance)); }); it("Should cost gas for failed transaction due to too low gas", async function () { const zilliqa = new Zilliqa(hre.getNetworkUrl()); - const balanceBefore = await zilliqa.blockchain.getBalance(parallelizer.zilliqaAccountAddress); + const balanceBefore = await zilliqa.blockchain.getBalance(signer.address); await contract.getHello({gasLimit: 300}); - const balanceAfter = await zilliqa.blockchain.getBalance(parallelizer.zilliqaAccountAddress); + const balanceAfter = await zilliqa.blockchain.getBalance(signer.address); expect(Number.parseInt(balanceAfter.result.balance)).to.be.lt(Number.parseInt(balanceBefore.result.balance)); }); }); diff --git a/tests/EvmAcceptanceTests/test/scilla/ManualNonce.ts b/tests/EvmAcceptanceTests/test/scilla/ManualNonce.ts index cabe092af5..f4e76fcddd 100644 --- a/tests/EvmAcceptanceTests/test/scilla/ManualNonce.ts +++ b/tests/EvmAcceptanceTests/test/scilla/ManualNonce.ts @@ -1,10 +1,11 @@ import {ScillaContract} from "hardhat-scilla-plugin"; import {expect} from "chai"; import hre from "hardhat"; -import {parallelizer} from "../../helpers"; +import {Account} from "@zilliqa-js/zilliqa"; -describe("Manual nonce", function () { +describe("Manual nonce #parallel", function () { let contract: ScillaContract; + let signer: Account; const VALUE = 12; before(async function () { @@ -12,19 +13,20 @@ describe("Manual nonce", function () { this.skip(); } - contract = await parallelizer.deployScillaContract("SetGet"); + signer = hre.allocateZilSigner(); + contract = await hre.deployScillaContractWithSigner("SetGet", signer); }); - it("Should be possible to set nonce manually", async function () { - let result = await parallelizer.zilliqaSetup.zilliqa.blockchain.getBalance(parallelizer.zilliqaAccountAddress); + it("Should be possible to set nonce manually @block-1", async function () { + let result = await hre.zilliqaSetup.zilliqa.blockchain.getBalance(signer.address); const nextNonce = result.result.nonce + 1; await contract.set(VALUE, {nonce: nextNonce}); expect(await contract.value()).to.be.eq(VALUE); }); // FIXME: in https://zilliqa-jira.atlassian.net/browse/ZIL-5199 - xit("Should be possible to call multiple transitions with manual nonces", async function () { - let result = await parallelizer.zilliqaSetup.zilliqa.blockchain.getBalance(parallelizer.zilliqaAccountAddress); + xit("Should be possible to call multiple transitions with manual nonces @block-2", async function () { + let result = await hre.zilliqaSetup.zilliqa.blockchain.getBalance(signer.address); const NONCE = result.result.nonce; diff --git a/tests/EvmAcceptanceTests/test/scilla/SendZil.ts b/tests/EvmAcceptanceTests/test/scilla/SendZil.ts index f4ba295a2a..244a473f68 100644 --- a/tests/EvmAcceptanceTests/test/scilla/SendZil.ts +++ b/tests/EvmAcceptanceTests/test/scilla/SendZil.ts @@ -4,7 +4,7 @@ import hre, {ethers} from "hardhat"; import {parallelizer} from "../../helpers"; import {BN, Zilliqa} from "@zilliqa-js/zilliqa"; -describe("Move Zil", function () { +describe("Move Zil #parallel", function () { const ZIL_AMOUNT = 3_000_000; let contract: ScillaContract; let to_be_funded_contract: ScillaContract; @@ -16,15 +16,24 @@ describe("Move Zil", function () { } zilliqa = new Zilliqa(hre.getNetworkUrl()); - contract = await parallelizer.deployScillaContract("SendZil"); - to_be_funded_contract = await parallelizer.deployScillaContract("SendZil"); + + if (hre.parallel) { + [contract, to_be_funded_contract] = await Promise.all([ + hre.deployScillaContract2("SendZil"), + hre.deployScillaContract2("SendZil") + ]); + } else { + contract = await parallelizer.deployScillaContract("SendZil"); + to_be_funded_contract = await parallelizer.deployScillaContract("SendZil"); + } }); - it("Should be deployed successfully", async function () { + it("Should be deployed successfully @block-1", async function () { expect(contract.address).to.be.properAddress; + expect(to_be_funded_contract.address).to.be.properAddress; }); - it("Should have updated balance if accept is called", async function () { + it("Should have updated balance if accept is called @block-1", async function () { const tx = await contract.acceptZil({amount: new BN(ZIL_AMOUNT)}); expect(tx).to.have.eventLogWithParams("currentBalance", {value: ethers.BigNumber.from(ZIL_AMOUNT)}); }); diff --git a/tests/EvmAcceptanceTests/test/scilla/Timestamp.ts b/tests/EvmAcceptanceTests/test/scilla/Timestamp.ts index b7d2ec81b0..303d3f42e8 100644 --- a/tests/EvmAcceptanceTests/test/scilla/Timestamp.ts +++ b/tests/EvmAcceptanceTests/test/scilla/Timestamp.ts @@ -1,19 +1,14 @@ import {expect} from "chai"; import {ScillaContract} from "hardhat-scilla-plugin"; -import {parallelizer} from "../../helpers"; import hre, {ethers} from "hardhat"; -describe("Scilla timestamp", () => { +describe("Scilla timestamp #parallel", () => { let contract: ScillaContract; before(async function () { - if (!hre.isZilliqaNetworkSelected() || !hre.isScillaTestingEnabled()) { - this.skip(); - } - - contract = await parallelizer.deployScillaContract("Timestamp"); + contract = await hre.deployScillaContract2("Timestamp"); }); - it("Should send back timestamp of a block", async () => { + it("Should send back timestamp of a block @block-1", async () => { const blockCount = await ethers.provider.getBlockNumber(); const blockTimestamp = (await ethers.provider.getBlock(blockCount)).timestamp; const tx = await contract.EventTimestamp(blockCount); diff --git a/tests/EvmAcceptanceTests/test/zilrpc/GetBalance.ts b/tests/EvmAcceptanceTests/test/zilrpc/GetBalance.ts index d6f75a3d8e..c43e7dfec1 100644 --- a/tests/EvmAcceptanceTests/test/zilrpc/GetBalance.ts +++ b/tests/EvmAcceptanceTests/test/zilrpc/GetBalance.ts @@ -1,17 +1,17 @@ import chai, {expect} from "chai"; -import {parallelizer} from "../../helpers"; import deepEqualInAnyOrder from "deep-equal-in-any-order"; +import hre from "hardhat"; chai.use(deepEqualInAnyOrder); const getZilBalance = async (address: string) => { - const zilliqa = parallelizer.zilliqaSetup.zilliqa; + const zilliqa = hre.zilliqaSetup.zilliqa; return zilliqa.blockchain.getBalance(address); }; -describe("Calling zilliqa GetBalance method", function () { - it("should return error if account is not created yet", async function () { - const account = parallelizer.zilliqaSetup.zilliqa.wallet.create(); +describe("Calling zilliqa GetBalance method #parallel", function () { + it("should return error if account is not created yet @block-1", async function () { + const account = hre.zilliqaSetup.zilliqa.wallet.create(); const balanceResult = await getZilBalance(account); expect(balanceResult.error).to.deep.equalInAnyOrder({ code: -5, @@ -20,9 +20,10 @@ describe("Calling zilliqa GetBalance method", function () { }); }); - it("should return the latest balance from the specified account", async function () { - const account = parallelizer.zilliqaAccountAddress; - const balanceResult = await getZilBalance(account); + it("should return the latest balance from the specified account @block-1", async function () { + const account = hre.allocateZilSigner(); + const balanceResult = await getZilBalance(account.address); expect(+balanceResult.result.balance).to.be.gt(0); + hre.releaseZilSigner(account); }); }); diff --git a/tests/EvmAcceptanceTests/tsconfig.json b/tests/EvmAcceptanceTests/tsconfig.json index c0aff84d32..6935b1d13b 100644 --- a/tests/EvmAcceptanceTests/tsconfig.json +++ b/tests/EvmAcceptanceTests/tsconfig.json @@ -8,6 +8,6 @@ "skipLibCheck": true, "outDir": "dist" }, - "include": ["./scripts", "./test", "./helpers"], - "files": ["./hardhat.config.ts"] + "include": ["./tasks", "./scripts", "./test", "./helpers"], + "files": ["./hardhat.config.ts", "./AddConfigHelpersToHre.ts"] }