From bc9a4e93ddbb37c1f87c0a15073cb9c13f11eb38 Mon Sep 17 00:00:00 2001 From: Aleksandr Kuperman Date: Wed, 23 Oct 2024 17:02:26 +0100 Subject: [PATCH] refactor: NFT fix --- contracts/contribute/ContributeManager.sol | 6 +- contracts/contribute/interfaces/IToken.sol | 3 +- contracts/test/ABICreator.sol | 11 +- package.json | 2 +- .../deploy_10_contribute_activity_checker.js | 4 +- test/StakingContribute.js | 175 +++++++++++++++++ yarn.lock | 184 ++++++++---------- 7 files changed, 273 insertions(+), 112 deletions(-) create mode 100644 test/StakingContribute.js diff --git a/contracts/contribute/ContributeManager.sol b/contracts/contribute/ContributeManager.sol index e7bcb92..35b248a 100644 --- a/contracts/contribute/ContributeManager.sol +++ b/contracts/contribute/ContributeManager.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.28; +import {ERC721TokenReceiver} from "../../lib/autonolas-registries/lib/solmate/src/tokens/ERC721.sol"; import {IContributors} from "./interfaces/IContributors.sol"; import {IService} from "./interfaces/IService.sol"; import {IStaking} from "./interfaces/IStaking.sol"; @@ -50,7 +51,7 @@ error ServiceOwnerOnly(uint256 serviceId, address sender, address serviceOwner); /// @author Andrey Lebedev - /// @author Tatiana Priemova - /// @author David Vilela - -contract ContributeManager { +contract ContributeManager is ERC721TokenReceiver { event CreatedAndStaked(uint256 indexed socialId, address indexed serviceOwner, uint256 serviceId, address indexed multisig, address stakingInstance); event Staked(uint256 indexed socialId, address indexed serviceOwner, uint256 serviceId, @@ -225,7 +226,8 @@ contract ContributeManager { uint256 threshold = IStaking(stakingInstance).threshold(); // Check for number of agent instances that must be equal to one, // since msg.sender is the only service multisig owner - if (numAgentInstances != NUM_AGENT_INSTANCES || threshold != THRESHOLD) { + if ((numAgentInstances > 0 && numAgentInstances != NUM_AGENT_INSTANCES) || + (threshold > 0 && threshold != THRESHOLD)) { revert WrongStakingInstance(stakingInstance); } diff --git a/contracts/contribute/interfaces/IToken.sol b/contracts/contribute/interfaces/IToken.sol index cd0aaf1..31b0032 100644 --- a/contracts/contribute/interfaces/IToken.sol +++ b/contracts/contribute/interfaces/IToken.sol @@ -19,6 +19,5 @@ interface IToken { /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. /// @param spender Account address that will be able to transfer tokens on behalf of the caller. /// @param amount Token amount. - /// @return True if the function execution is successful. - function approve(address spender, uint256 amount) external returns (bool); + function approve(address spender, uint256 amount) external; } \ No newline at end of file diff --git a/contracts/test/ABICreator.sol b/contracts/test/ABICreator.sol index f08ba9d..9efe4b7 100644 --- a/contracts/test/ABICreator.sol +++ b/contracts/test/ABICreator.sol @@ -4,14 +4,15 @@ pragma solidity ^0.8.25; // Getting ABIs for the Gnosis Safe master copy and proxy contracts import "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol"; import "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol"; +import "@gnosis.pm/safe-contracts/contracts/handler/DefaultCallbackHandler.sol"; import "@gnosis.pm/safe-contracts/contracts/libraries/MultiSendCallOnly.sol"; // Getting ABIs for registry contracts -import "../../lib/autonolas-registries/contracts/ComponentRegistry.sol"; -import "../../lib/autonolas-registries/contracts/AgentRegistry.sol"; -import "../../lib/autonolas-registries/contracts/ServiceRegistry.sol"; -import "../../lib/autonolas-registries/contracts/ServiceRegistryTokenUtility.sol"; -import "../../lib/autonolas-registries/contracts/multisigs/GnosisSafeMultisig.sol"; +import {OperatorWhitelist} from "../../lib/autonolas-registries/contracts/utils/OperatorWhitelist.sol"; +import {ServiceRegistryL2} from "../../lib/autonolas-registries/contracts/ServiceRegistryL2.sol"; +import {ServiceRegistryTokenUtility} from "../../lib/autonolas-registries/contracts/ServiceRegistryTokenUtility.sol"; +import {ServiceManagerToken} from "../../lib/autonolas-registries/contracts/ServiceManagerToken.sol"; +import {GnosisSafeMultisig} from "../../lib/autonolas-registries/contracts/multisigs/GnosisSafeMultisig.sol"; import {StakingFactory} from "../../lib/autonolas-registries/contracts/staking/StakingFactory.sol"; import {StakingToken} from "../../lib/autonolas-registries/contracts/staking/StakingToken.sol"; import {StakingNativeToken} from "../../lib/autonolas-registries/contracts/staking/StakingNativeToken.sol"; diff --git a/package.json b/package.json index 7129f8c..87da197 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "chai": "^4.3.10", "eslint": "^8.52.0", "ethers": "^5.7.2", - "hardhat": "^2.22.4", + "hardhat": "^2.22.14", "hardhat-contract-sizer": "^2.10.0", "hardhat-deploy": "^0.11.43", "hardhat-deploy-ethers": "^0.3.0-beta.13", diff --git a/scripts/deployment/deploy_10_contribute_activity_checker.js b/scripts/deployment/deploy_10_contribute_activity_checker.js index d916823..701bfb9 100644 --- a/scripts/deployment/deploy_10_contribute_activity_checker.js +++ b/scripts/deployment/deploy_10_contribute_activity_checker.js @@ -47,8 +47,8 @@ async function main() { const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei"); const ContributeActivityChecker = await ethers.getContractFactory("ContributeActivityChecker"); console.log("You are signing the following transaction: ContributeActivityChecker.connect(EOA).deploy()"); - const contributeActivityChecker = await ContributeActivityChecker.connect(EOA).deploy(contributorsProxyAddress, livenessRatio, - { gasPrice }); + const contributeActivityChecker = await ContributeActivityChecker.connect(EOA).deploy(contributorsProxyAddress, + livenessRatio, { gasPrice }); const result = await contributeActivityChecker.deployed(); // Transaction details diff --git a/test/StakingContribute.js b/test/StakingContribute.js new file mode 100644 index 0000000..1ab88cb --- /dev/null +++ b/test/StakingContribute.js @@ -0,0 +1,175 @@ +/*global describe, context, beforeEach, it*/ +const { expect } = require("chai"); +const { ethers } = require("hardhat"); +const helpers = require("@nomicfoundation/hardhat-network-helpers"); +const safeContracts = require("@gnosis.pm/safe-contracts"); + +describe("Staking", function () { + let componentRegistry; + let agentRegistry; + let serviceRegistry; + let serviceRegistryTokenUtility; + let operatorWhitelist; + let serviceManager; + let token; + let gnosisSafe; + let gnosisSafeProxyFactory; + let fallbackHandler; + let gnosisSafeMultisig; + let stakingFactory; + let contributors; + let contributorsProxy; + let contributeManager; + let contributeActivityChecker; + let stakingTokenImplementation; + let stakingToken; + let signers; + let deployer; + let agentInstances; + let bytecodeHash; + const AddressZero = ethers.constants.AddressZero; + const HashZero = ethers.constants.HashZero; + const defaultHash = "0x" + "5".repeat(64); + const regDeposit = 1000; + const regBond = 1000; + const serviceId = 1; + const agentId = 1; + let socialId = 1; + const agentIds = [1]; + const agentParams = [[1, regBond]]; + const threshold = 1; + const livenessPeriod = 10; // Ten seconds + const initSupply = "5" + "0".repeat(26); + const payload = "0x"; + const livenessRatio = "1" + "0".repeat(16); // 0.01 transaction per second (TPS) + let serviceParams = { + metadataHash: defaultHash, + maxNumServices: 3, + rewardsPerSecond: "1" + "0".repeat(15), + minStakingDeposit: 10, + minNumStakingPeriods: 3, + maxNumInactivityPeriods: 3, + livenessPeriod: livenessPeriod, // Ten seconds + timeForEmissions: 100, + numAgentInstances: 1, + agentIds: [], + threshold: 1, + configHash: HashZero, + proxyHash: HashZero, + serviceRegistry: AddressZero, + activityChecker: AddressZero + }; + const maxInactivity = serviceParams.maxNumInactivityPeriods * livenessPeriod + 1; + + beforeEach(async function () { + signers = await ethers.getSigners(); + deployer = signers[0]; + + const ServiceRegistry = await ethers.getContractFactory("ServiceRegistryL2"); + serviceRegistry = await ServiceRegistry.deploy("Service Registry L2", "SERVICE", "https://localhost/service/"); + await serviceRegistry.deployed(); + serviceParams.serviceRegistry = serviceRegistry.address; + + const ServiceRegistryTokenUtility = await ethers.getContractFactory("ServiceRegistryTokenUtility"); + serviceRegistryTokenUtility = await ServiceRegistryTokenUtility.deploy(serviceRegistry.address); + await serviceRegistry.deployed(); + + const OperatorWhitelist = await ethers.getContractFactory("OperatorWhitelist"); + operatorWhitelist = await OperatorWhitelist.deploy(serviceRegistry.address); + await operatorWhitelist.deployed(); + + const ServiceManagerToken = await ethers.getContractFactory("ServiceManagerToken"); + serviceManager = await ServiceManagerToken.deploy(serviceRegistry.address, serviceRegistryTokenUtility.address, + operatorWhitelist.address); + await serviceManager.deployed(); + + const Token = await ethers.getContractFactory("ERC20Token"); + token = await Token.deploy(); + await token.deployed(); + + const GnosisSafe = await ethers.getContractFactory("GnosisSafe"); + gnosisSafe = await GnosisSafe.deploy(); + await gnosisSafe.deployed(); + + const GnosisSafeProxyFactory = await ethers.getContractFactory("GnosisSafeProxyFactory"); + gnosisSafeProxyFactory = await GnosisSafeProxyFactory.deploy(); + await gnosisSafeProxyFactory.deployed(); + + const FallbackHandler = await ethers.getContractFactory("DefaultCallbackHandler"); + fallbackHandler = await FallbackHandler.deploy(); + await fallbackHandler.deployed(); + + const GnosisSafeMultisig = await ethers.getContractFactory("GnosisSafeMultisig"); + gnosisSafeMultisig = await GnosisSafeMultisig.deploy(gnosisSafe.address, gnosisSafeProxyFactory.address); + await gnosisSafeMultisig.deployed(); + + const GnosisSafeProxy = await ethers.getContractFactory("GnosisSafeProxy"); + const gnosisSafeProxy = await GnosisSafeProxy.deploy(gnosisSafe.address); + await gnosisSafeProxy.deployed(); + const bytecode = await ethers.provider.getCode(gnosisSafeProxy.address); + bytecodeHash = ethers.utils.keccak256(bytecode); + serviceParams.proxyHash = bytecodeHash; + + const StakingFactory = await ethers.getContractFactory("StakingFactory"); + stakingFactory = await StakingFactory.deploy(AddressZero); + await stakingFactory.deployed(); + + const Contributors = await ethers.getContractFactory("Contributors"); + contributors = await Contributors.deploy(); + await contributors.deployed(); + + const ContributorsProxy = await ethers.getContractFactory("ContributorsProxy"); + const proxyData = contributors.interface.encodeFunctionData("initialize", []); + contributorsProxy = await ContributorsProxy.deploy(contributors.address, proxyData); + await contributorsProxy.deployed(); + contributors = await ethers.getContractAt("Contributors", contributorsProxy.address); + + const ContributeManager = await ethers.getContractFactory("ContributeManager"); + contributeManager = await ContributeManager.deploy(contributorsProxy.address, serviceManager.address, + token.address, stakingFactory.address, gnosisSafeMultisig.address, fallbackHandler.address, + agentId, defaultHash); + + const ContributeActivityChecker = await ethers.getContractFactory("ContributeActivityChecker"); + contributeActivityChecker = await ContributeActivityChecker.deploy(contributorsProxy.address, livenessRatio); + await contributeActivityChecker.deployed(); + serviceParams.activityChecker = contributeActivityChecker.address; + + const StakingToken = await ethers.getContractFactory("StakingToken"); + stakingTokenImplementation = await StakingToken.deploy(); + const initPayload = stakingTokenImplementation.interface.encodeFunctionData("initialize", + [serviceParams, serviceRegistryTokenUtility.address, token.address]); + const tx = await stakingFactory.createStakingInstance(stakingTokenImplementation.address, initPayload); + const res = await tx.wait(); + // Get staking contract instance address from the event + const stakingTokenAddress = "0x" + res.logs[0].topics[2].slice(26); + stakingToken = await ethers.getContractAt("StakingToken", stakingTokenAddress); + + // Set service manager + await serviceRegistry.changeManager(serviceManager.address); + await serviceRegistryTokenUtility.changeManager(serviceManager.address); + + // Mint tokens to the service owner and the operator + await token.mint(deployer.address, initSupply); + + // Whitelist gnosis multisig implementations + await serviceRegistry.changeMultisigPermission(gnosisSafeMultisig.address, true); + + // Set the manager of contributorsProxy + contributors.changeManager(contributeManager.address); + + // Fund the staking contract + await token.approve(stakingTokenAddress, ethers.utils.parseEther("1")); + await stakingToken.deposit(ethers.utils.parseEther("1")); + }); + + context("Initialization", function () { + }); + + context("Contribute manager", function () { + it.only("Mint and stake", async function () { + await token.approve(contributeManager.address, serviceParams.minStakingDeposit * 2); + + await contributeManager.createAndStake(socialId, stakingToken.address, {value: 2}); + }); + }); +}); diff --git a/yarn.lock b/yarn.lock index 8967b49..493d428 100644 --- a/yarn.lock +++ b/yarn.lock @@ -675,53 +675,53 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomicfoundation/edr-darwin-arm64@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.8.tgz#09de1f03c0336670fce959f376f0fe9137545836" - integrity sha512-eB0leCexS8sQEmfyD72cdvLj9djkBzQGP4wSQw6SNf2I4Sw4Cnzb3d45caG2FqFFjbvfqL0t+badUUIceqQuMw== - -"@nomicfoundation/edr-darwin-x64@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.8.tgz#c3ca237c74ed3b6fb800fd7f1de7174f4ad24f72" - integrity sha512-JksVCS1N5ClwVF14EvO25HCQ+Laljh/KRfHERMVAC9ZwPbTuAd/9BtKvToCBi29uCHWqsXMI4lxCApYQv2nznw== - -"@nomicfoundation/edr-linux-arm64-gnu@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.8.tgz#08bd367789e745f4e78a8a87368fc470eea8a7de" - integrity sha512-raCE+fOeNXhVBLUo87cgsHSGvYYRB6arih4eG6B9KGACWK5Veebtm9xtKeiD8YCsdUlUfat6F7ibpeNm91fpsA== - -"@nomicfoundation/edr-linux-arm64-musl@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.8.tgz#9cab5cbec0052cb5812c6c66c463d28a756cd916" - integrity sha512-PwiDp4wBZWMCIy29eKkv8moTKRrpiSDlrc+GQMSZLhOAm8T33JKKXPwD/2EbplbhCygJDGXZdtEKl9x9PaH66A== - -"@nomicfoundation/edr-linux-x64-gnu@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.8.tgz#d4a11b6ebcd1b29d7431d185c6df3e65a2cd4bde" - integrity sha512-6AcvA/XKoipGap5jJmQ9Y6yT7Uf39D9lu2hBcDCXnXbMcXaDGw4mn1/L4R63D+9VGZyu1PqlcJixCUZlGGIWlg== - -"@nomicfoundation/edr-linux-x64-musl@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.8.tgz#b8eef960d06380a365866ddd1e97ecb7fbf6bd70" - integrity sha512-cxb0sEmZjlwhYWO28sPsV64VDx31ekskhC1IsDXU1p9ntjHSJRmW4KEIqJ2O3QwJap/kLKfMS6TckvY10gjc6w== - -"@nomicfoundation/edr-win32-x64-msvc@0.3.8": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.8.tgz#ac7061aeb07cc847c429513080b76bb05297a869" - integrity sha512-yVuVPqRRNLZk7TbBMkKw7lzCvI8XO8fNTPTYxymGadjr9rEGRuNTU1yBXjfJ59I1jJU/X2TSkRk1OFX0P5tpZQ== - -"@nomicfoundation/edr@^0.3.7": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.8.tgz#28fe7ae4f462ae74a16cd1a714ff7b1cd9c22b4c" - integrity sha512-u2UJ5QpznSHVkZRh6ePWoeVb6kmPrrqh08gCnZ9FHlJV9CITqlrTQHJkacd+INH31jx88pTAJnxePE4XAiH5qg== - dependencies: - "@nomicfoundation/edr-darwin-arm64" "0.3.8" - "@nomicfoundation/edr-darwin-x64" "0.3.8" - "@nomicfoundation/edr-linux-arm64-gnu" "0.3.8" - "@nomicfoundation/edr-linux-arm64-musl" "0.3.8" - "@nomicfoundation/edr-linux-x64-gnu" "0.3.8" - "@nomicfoundation/edr-linux-x64-musl" "0.3.8" - "@nomicfoundation/edr-win32-x64-msvc" "0.3.8" +"@nomicfoundation/edr-darwin-arm64@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.6.4.tgz#6eaa64a6ea5201e4c92b121f2b7fd197b26e450a" + integrity sha512-QNQErISLgssV9+qia8sIjRANqtbW8snSDvjspixT/kSQ5ZSGxxctTg7x72wPSrcu8+EBEveIe5uqENIp5GH8HQ== + +"@nomicfoundation/edr-darwin-x64@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.6.4.tgz#d15ca89e9deef7d0a710cf90e79f3cc270a5a999" + integrity sha512-cjVmREiwByyc9+oGfvAh49IAw+oVJHF9WWYRD+Tm/ZlSpnEVWxrGNBak2bd/JSYjn+mZE7gmWS4SMRi4nKaLUg== + +"@nomicfoundation/edr-linux-arm64-gnu@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.6.4.tgz#e73c41ca015dfddb5f4cb6cd3d9b2cbe5cc28989" + integrity sha512-96o9kRIVD6W5VkgKvUOGpWyUGInVQ5BRlME2Fa36YoNsRQMaKtmYJEU0ACosYES6ZTpYC8U5sjMulvPtVoEfOA== + +"@nomicfoundation/edr-linux-arm64-musl@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.6.4.tgz#90906f733e4ad26657baeb22d28855d934ab7541" + integrity sha512-+JVEW9e5plHrUfQlSgkEj/UONrIU6rADTEk+Yp9pbe+mzNkJdfJYhs5JYiLQRP4OjxH4QOrXI97bKU6FcEbt5Q== + +"@nomicfoundation/edr-linux-x64-gnu@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.6.4.tgz#11b8bd73df145a192e5a08199e5e81995fcde502" + integrity sha512-nzYWW+fO3EZItOeP4CrdMgDXfaGBIBkKg0Y/7ySpUxLqzut40O4Mb0/+quqLAFkacUSWMlFp8nsmypJfOH5zoA== + +"@nomicfoundation/edr-linux-x64-musl@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.6.4.tgz#a34b9a2c9e34853207824dc81622668a069ca642" + integrity sha512-QFRoE9qSQ2boRrVeQ1HdzU+XN7NUgwZ1SIy5DQt4d7jCP+5qTNsq8LBNcqhRBOATgO63nsweNUhxX/Suj5r1Sw== + +"@nomicfoundation/edr-win32-x64-msvc@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.6.4.tgz#ca035c6f66ae9f88fa3ef123a1f3a2099cce7a5a" + integrity sha512-2yopjelNkkCvIjUgBGhrn153IBPLwnsDeNiq6oA0WkeM8tGmQi4td+PGi9jAriUDAkc59Yoi2q9hYA6efiY7Zw== + +"@nomicfoundation/edr@^0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.6.4.tgz#1cd336c46a60f5af774e6cf0f1943f49f63dded6" + integrity sha512-YgrSuT3yo5ZQkbvBGqQ7hG+RDvz3YygSkddg4tb1Z0Y6pLXFzwrcEwWaJCFAVeeZxdxGfCgGMUYgRVneK+WXkw== + dependencies: + "@nomicfoundation/edr-darwin-arm64" "0.6.4" + "@nomicfoundation/edr-darwin-x64" "0.6.4" + "@nomicfoundation/edr-linux-arm64-gnu" "0.6.4" + "@nomicfoundation/edr-linux-arm64-musl" "0.6.4" + "@nomicfoundation/edr-linux-x64-gnu" "0.6.4" + "@nomicfoundation/edr-linux-x64-musl" "0.6.4" + "@nomicfoundation/edr-win32-x64-msvc" "0.6.4" "@nomicfoundation/ethereumjs-common@4.0.4": version "4.0.4" @@ -1574,7 +1574,7 @@ check-error@^1.0.2, check-error@^1.0.3: dependencies: get-func-name "^2.0.2" -chokidar@3.5.3, chokidar@^3.4.0, chokidar@^3.5.2: +chokidar@3.5.3, chokidar@^3.5.2: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -1589,6 +1589,13 @@ chokidar@3.5.3, chokidar@^3.4.0, chokidar@^3.5.2: optionalDependencies: fsevents "~2.3.2" +chokidar@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-4.0.1.tgz#4a6dff66798fb0f72a94f616abbd7e1a19f31d41" + integrity sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA== + dependencies: + readdirp "^4.0.1" + chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -1686,16 +1693,16 @@ command-exists@^1.2.8: resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - commander@^10.0.0: version "10.0.1" resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== +commander@^8.1.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + commander@^9.3.0: version "9.5.0" resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" @@ -2392,17 +2399,6 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - fs-extra@^10.0.0, fs-extra@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" @@ -2602,7 +2598,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -2686,14 +2682,14 @@ hardhat-tracer@^2.6.0: debug "^4.3.4" ethers "^5.6.1" -hardhat@^2.22.4: - version "2.22.4" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.4.tgz#766227b6cefca5dbf4fd15ab5b5a68138fa13baf" - integrity sha512-09qcXJFBHQUaraJkYNr7XlmwjOj27xBB0SL2rYS024hTj9tPMbp26AFjlf5quBMO9SR4AJFg+4qWahcYcvXBuQ== +hardhat@^2.22.14: + version "2.22.14" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.14.tgz#389bb3789a52adc0b1a3b4bfc9b891239d5a2b42" + integrity sha512-sD8vHtS9l5QQVHzyPPe3auwZDJyZ0fG3Z9YENVa4oOqVEefCuHcPzdU736rei3zUKTqkX0zPIHkSMHpu02Fq1A== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/edr" "^0.3.7" + "@nomicfoundation/edr" "^0.6.4" "@nomicfoundation/ethereumjs-common" "4.0.4" "@nomicfoundation/ethereumjs-tx" "5.0.4" "@nomicfoundation/ethereumjs-util" "9.0.4" @@ -2706,7 +2702,7 @@ hardhat@^2.22.4: ansi-escapes "^4.3.0" boxen "^5.1.2" chalk "^2.4.2" - chokidar "^3.4.0" + chokidar "^4.0.0" ci-info "^2.0.0" debug "^4.1.1" enquirer "^2.3.0" @@ -2719,6 +2715,7 @@ hardhat@^2.22.4: glob "7.2.0" immutable "^4.0.0-rc.12" io-ts "1.10.4" + json-stream-stringify "^3.1.4" keccak "^3.0.2" lodash "^4.17.11" mnemonist "^0.38.0" @@ -2727,7 +2724,7 @@ hardhat@^2.22.4: raw-body "^2.4.1" resolve "1.17.0" semver "^6.3.0" - solc "0.7.3" + solc "0.8.26" source-map-support "^0.5.13" stacktrace-parser "^0.1.10" tsort "0.0.1" @@ -3054,12 +3051,10 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== - optionalDependencies: - graceful-fs "^4.1.6" +json-stream-stringify@^3.1.4: + version "3.1.6" + resolved "https://registry.yarnpkg.com/json-stream-stringify/-/json-stream-stringify-3.1.6.tgz#ebe32193876fb99d4ec9f612389a8d8e2b5d54d4" + integrity sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog== jsonfile@^4.0.0: version "4.0.0" @@ -3103,13 +3098,6 @@ kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== - optionalDependencies: - graceful-fs "^4.1.9" - levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -3793,6 +3781,11 @@ readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" +readdirp@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-4.0.2.tgz#388fccb8b75665da3abffe2d8f8ed59fe74c230a" + integrity sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA== + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -3843,7 +3836,7 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-from-string@^2.0.0, require-from-string@^2.0.2: +require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== @@ -3884,13 +3877,6 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^2.2.8: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -4102,18 +4088,16 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -solc@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" - integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== +solc@0.8.26: + version "0.8.26" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.26.tgz#afc78078953f6ab3e727c338a2fefcd80dd5b01a" + integrity sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g== dependencies: command-exists "^1.2.8" - commander "3.0.2" + commander "^8.1.0" follow-redirects "^1.12.1" - fs-extra "^0.30.0" js-sha3 "0.8.0" memorystream "^0.3.1" - require-from-string "^2.0.0" semver "^5.5.0" tmp "0.0.33"