From 6880cce06d741a66af957fa3416a5da196112bd9 Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 1 Nov 2024 07:28:54 +0000 Subject: [PATCH 1/2] Add callbacks to Generator Registry --- contracts/GeneratorRegistry.sol | 70 +- contracts/binding_generator.sol | 14 + contracts/interfaces/IGeneratorCallbacks.sol | 25 + .../staking/l2_contracts/NativeStaking.sol | 19 + .../staking/l2_contracts/SymbioticStaking.sol | 15 + package-lock.json | 632 ++------- scripts/assignTask.ts | 44 - scripts/createAsk.ts | 105 -- scripts/createMarket.ts | 96 -- scripts/deploy.ts | 294 ----- scripts/deployMockVerifier.ts | 39 - scripts/deployTeeVerifier.ts | 39 - scripts/distributeEth.ts | 24 - scripts/emitTasks.ts | 227 ---- scripts/foundry/DeployArbitrumSepolia.s.sol | 263 ---- scripts/foundry/mocks/POND.sol | 23 - scripts/foundry/mocks/USDC.sol | 24 - scripts/foundry/mocks/WETH.sol | 20 - scripts/readMarketData.ts | 38 - scripts/registerGenerator.ts | 106 -- scripts/setInputFormat.ts | 57 - scripts/transferTokens.ts | 60 - scripts/verify.ts | 73 -- scripts/verifyMockVerifier.ts | 36 - scripts/verifyTeeVerifier.ts | 41 - scripts/whitelistKeyAv.ts | 56 - test/EntityKeyRegistry.ts | 113 -- test/Generator.ts | 901 ------------- test/PrivateMarket.ts | 481 ------- test/ProofMarketPlaceBasic.ts | 1146 ----------------- test/ProorMarketPlaceWithCircomVerifier.ts | 205 --- test/ProorMarketPlaceWithPlonk.ts | 202 --- test/ProorMarketPlaceWithTransferVerifier.ts | 251 ---- test/ProorMarketPlaceWithTreeVerifier.ts | 479 ------- test/ProorMarketPlaceWithZkSync.ts | 198 --- test/StakingManager.ts | 295 ----- test/UpgradabilityTest.ts | 29 - test/foundry/TestSetup.t.sol | 377 ------ test/foundry/e2e/KalypsoStaking.t.sol | 904 ------------- test/foundry/mocks/POND.sol | 18 - test/foundry/mocks/USDC.sol | 14 - test/foundry/mocks/WETH.sol | 14 - 42 files changed, 222 insertions(+), 7845 deletions(-) create mode 100644 contracts/binding_generator.sol create mode 100644 contracts/interfaces/IGeneratorCallbacks.sol delete mode 100644 scripts/assignTask.ts delete mode 100644 scripts/createAsk.ts delete mode 100644 scripts/createMarket.ts delete mode 100644 scripts/deploy.ts delete mode 100644 scripts/deployMockVerifier.ts delete mode 100644 scripts/deployTeeVerifier.ts delete mode 100644 scripts/distributeEth.ts delete mode 100644 scripts/emitTasks.ts delete mode 100644 scripts/foundry/DeployArbitrumSepolia.s.sol delete mode 100644 scripts/foundry/mocks/POND.sol delete mode 100644 scripts/foundry/mocks/USDC.sol delete mode 100644 scripts/foundry/mocks/WETH.sol delete mode 100644 scripts/readMarketData.ts delete mode 100644 scripts/registerGenerator.ts delete mode 100644 scripts/setInputFormat.ts delete mode 100644 scripts/transferTokens.ts delete mode 100644 scripts/verify.ts delete mode 100644 scripts/verifyMockVerifier.ts delete mode 100644 scripts/verifyTeeVerifier.ts delete mode 100644 scripts/whitelistKeyAv.ts delete mode 100644 test/EntityKeyRegistry.ts delete mode 100644 test/Generator.ts delete mode 100644 test/PrivateMarket.ts delete mode 100644 test/ProofMarketPlaceBasic.ts delete mode 100644 test/ProorMarketPlaceWithCircomVerifier.ts delete mode 100644 test/ProorMarketPlaceWithPlonk.ts delete mode 100644 test/ProorMarketPlaceWithTransferVerifier.ts delete mode 100644 test/ProorMarketPlaceWithTreeVerifier.ts delete mode 100644 test/ProorMarketPlaceWithZkSync.ts delete mode 100644 test/StakingManager.ts delete mode 100644 test/UpgradabilityTest.ts delete mode 100644 test/foundry/TestSetup.t.sol delete mode 100644 test/foundry/e2e/KalypsoStaking.t.sol delete mode 100644 test/foundry/mocks/POND.sol delete mode 100644 test/foundry/mocks/USDC.sol delete mode 100644 test/foundry/mocks/WETH.sol diff --git a/contracts/GeneratorRegistry.sol b/contracts/GeneratorRegistry.sol index 1909b15..0df259e 100644 --- a/contracts/GeneratorRegistry.sol +++ b/contracts/GeneratorRegistry.sol @@ -17,6 +17,9 @@ import "./ProofMarketplace.sol"; import {IStakingManager} from "./interfaces/staking/IStakingManager.sol"; import "./interfaces/IGeneratorRegistry.sol"; +import "./interfaces/IGeneratorCallbacks.sol"; +import "./staking/l2_contracts/StakingManager.sol"; + contract GeneratorRegistry is Initializable, ContextUpgradeable, @@ -24,14 +27,16 @@ contract GeneratorRegistry is AccessControlUpgradeable, UUPSUpgradeable, ReentrancyGuardUpgradeable, - IGeneratorRegistry + IGeneratorRegistry, + IGeneratorCallbacks { // in case we add more contracts in the inheritance chain uint256[500] private __gap_0; /// @custom:oz-upgrades-unsafe-allow constructor - constructor(EntityKeyRegistry _entityRegistry) initializer { + constructor(EntityKeyRegistry _entityRegistry, StakingManager _stakingManager) initializer { ENTITY_KEY_REGISTRY = _entityRegistry; + STAKING_MANAGER = _stakingManager; } using HELPER for bytes; @@ -64,6 +69,8 @@ contract GeneratorRegistry is /// @custom:oz-upgrades-unsafe-allow state-variable-immutable EntityKeyRegistry public immutable ENTITY_KEY_REGISTRY; + + StakingManager public immutable STAKING_MANAGER; //-------------------------------- Constants and Immutable start --------------------------------// //-------------------------------- State variables start --------------------------------// @@ -514,7 +521,7 @@ contract GeneratorRegistry is } /** - * @notice Should be called by proof market place only, PMP is assigned SLASHER_ROLE + * @notice Should be called by proof market place only, PMP is assigned SLASHER_ROLE, called when generators is about to be slashed */ function releaseGeneratorResources( address generatorAddress, @@ -534,6 +541,7 @@ contract GeneratorRegistry is info.activeRequests--; generator.computeConsumed -= info.computePerRequestRequired; + emit ComputeLockReleased(generatorAddress, info.computePerRequestRequired); } function assignGeneratorTask( @@ -607,6 +615,62 @@ contract GeneratorRegistry is return (generator.rewardAddress, info.proofGenerationCost); } + function addStakeCallback(address generatorAddress, address token, uint256 amount) external override { + if(!STAKING_MANAGER.isEnabledPool(msg.sender)){ + revert Error.InvalidContractAddress(); + } + + emit AddedStake(generatorAddress, token, amount); + } + + function intendToReduceStakeCallback(address generatorAddress, address token, uint256 amount) external override { + if(!STAKING_MANAGER.isEnabledPool(msg.sender)){ + revert Error.InvalidContractAddress(); + } + + emit IntendToReduceStake(generatorAddress, token, amount); + } + + function removeStakeCallback(address generatorAddress, address token, uint256 amount) external override { + if(!STAKING_MANAGER.isEnabledPool(msg.sender)){ + revert Error.InvalidContractAddress(); + } + + emit RemovedStake(generatorAddress, token, amount); + } + + function stakeLockImposedCallback(address generatorAddress, address token, uint256 amount) external override { + if(!STAKING_MANAGER.isEnabledPool(msg.sender)){ + revert Error.InvalidContractAddress(); + } + + emit StakeLockImposed(generatorAddress, token, amount); + } + + function stakeLockReleasedCallback(address generatorAddress, address token, uint256 amount) external override { + if(!STAKING_MANAGER.isEnabledPool(msg.sender)){ + revert Error.InvalidContractAddress(); + } + + emit StakeLockReleased(generatorAddress, token, amount); + } + + function stakeSlashedCallback(address generatorAddress, address token, uint256 amount) external override { + if(!STAKING_MANAGER.isEnabledPool(msg.sender)){ + revert Error.InvalidContractAddress(); + } + + emit StakeSlashed(generatorAddress, token, amount); + } + + function symbioticCompleteSnapshotCallback(uint256 captureTimestamp) external override { + if(!STAKING_MANAGER.isEnabledPool(msg.sender)){ + revert Error.InvalidContractAddress(); + } + + emit SymbioticCompleteSnapshot(captureTimestamp); + } + // for further increase uint256[50] private __gap1_0; } diff --git a/contracts/binding_generator.sol b/contracts/binding_generator.sol new file mode 100644 index 0000000..2532157 --- /dev/null +++ b/contracts/binding_generator.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "./EntityKeyRegistry.sol"; +import "./GeneratorRegistry.sol"; +import "./ProofMarketplace.sol"; +import "./staking/l2_contracts/NativeStaking.sol"; +import "./staking/l2_contracts/StakingManager.sol"; +import "./staking/l2_contracts/SymbioticStaking.sol"; + +contract binding_generator { + +} \ No newline at end of file diff --git a/contracts/interfaces/IGeneratorCallbacks.sol b/contracts/interfaces/IGeneratorCallbacks.sol new file mode 100644 index 0000000..c11ab50 --- /dev/null +++ b/contracts/interfaces/IGeneratorCallbacks.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.26; + +interface IGeneratorCallbacks { + event AddedStake(address indexed generatorAddress, address indexed token, uint256 amount); + function addStakeCallback(address generatorAddress, address token, uint256 amount) external; + + event IntendToReduceStake(address indexed generatorAddress, address indexed token, uint256 amount); + function intendToReduceStakeCallback(address generatorAddress, address token, uint256 amount) external; + + event RemovedStake(address indexed generatorAddress, address indexed token, uint256 amount); + function removeStakeCallback(address generatorAddress, address token, uint256 amount) external; + + event StakeLockImposed(address indexed generatorAddress, address indexed token, uint256 stake); + function stakeLockImposedCallback(address generatorAddress, address token, uint256 amount) external; + + event StakeLockReleased(address indexed generatorAddress, address indexed token, uint256 stake); + function stakeLockReleasedCallback(address generatorAddress, address token, uint256 amount) external; + + event StakeSlashed(address indexed generatorAddress, address indexed token, uint256 stake); + function stakeSlashedCallback(address generatorAddress, address token, uint256 amount) external; + + event SymbioticCompleteSnapshot(uint256 indexed captureTimestamp); + function symbioticCompleteSnapshotCallback(uint256 captureTimestamp) external; +} \ No newline at end of file diff --git a/contracts/staking/l2_contracts/NativeStaking.sol b/contracts/staking/l2_contracts/NativeStaking.sol index 3b9963c..2c3c5ad 100644 --- a/contracts/staking/l2_contracts/NativeStaking.sol +++ b/contracts/staking/l2_contracts/NativeStaking.sol @@ -21,6 +21,8 @@ import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import "../../interfaces/IGeneratorCallbacks.sol"; + contract NativeStaking is ContextUpgradeable, ERC165Upgradeable, @@ -32,6 +34,11 @@ contract NativeStaking is using EnumerableSet for EnumerableSet.AddressSet; using SafeERC20 for IERC20; + IGeneratorCallbacks public immutable I_GENERATOR_CALLBACK; + constructor(IGeneratorCallbacks _generator_callback) { + I_GENERATOR_CALLBACK = _generator_callback; + } + /*===================================================================================================================*/ /*================================================ state variable ===================================================*/ /*===================================================================================================================*/ @@ -138,6 +145,8 @@ contract NativeStaking is operatorstakeAmounts[_stakeToken][_operator] += _amount; emit Staked(msg.sender, _operator, _stakeToken, _amount); + + I_GENERATOR_CALLBACK.addStakeCallback(_operator, _stakeToken, _amount); } // TODO @@ -154,6 +163,8 @@ contract NativeStaking is uint256 index = withdrawalRequests[msg.sender][_operator].length - 1; emit StakeWithdrawalRequested(msg.sender, _operator, _stakeToken, index, _amount); + + I_GENERATOR_CALLBACK.intendToReduceStakeCallback(_operator, _stakeToken, _amount); } function withdrawStake(address _operator, uint256[] calldata _index) external nonReentrant { @@ -172,6 +183,8 @@ contract NativeStaking is IERC20(request.stakeToken).safeTransfer(msg.sender, request.amount); emit StakeWithdrawn(msg.sender, _operator, request.stakeToken, _index[i], request.amount); + + I_GENERATOR_CALLBACK.removeStakeCallback(_operator, request.stakeToken, request.amount); } } @@ -187,6 +200,8 @@ contract NativeStaking is operatorLockedAmounts[_stakeToken][_operator] += _amountToLock; emit StakeLocked(_jobId, _operator, _stakeToken, _amountToLock); + + I_GENERATOR_CALLBACK.stakeLockImposedCallback(_operator, _stakeToken, _amountToLock); } /// @notice unlock stake and distribute reward @@ -203,6 +218,8 @@ contract NativeStaking is _unlockStake(_jobId, lock.token, _operator, lock.amount); emit StakeUnlocked(_jobId, _operator, lock.token, lock.amount); + + I_GENERATOR_CALLBACK.stakeLockReleasedCallback(_operator, lock.token, lock.amount); } function slash(Struct.JobSlashed[] calldata _slashedJobs) external onlyStakingManager { @@ -217,6 +234,8 @@ contract NativeStaking is IERC20(lock.token).safeTransfer(_slashedJobs[i].rewardAddress, lockedAmount); emit JobSlashed(_slashedJobs[i].jobId, _slashedJobs[i].operator, lock.token, lockedAmount); + + I_GENERATOR_CALLBACK.stakeSlashedCallback(_slashedJobs[i].operator, lock.token, lockedAmount); } } diff --git a/contracts/staking/l2_contracts/SymbioticStaking.sol b/contracts/staking/l2_contracts/SymbioticStaking.sol index 1f7db40..678aba8 100644 --- a/contracts/staking/l2_contracts/SymbioticStaking.sol +++ b/contracts/staking/l2_contracts/SymbioticStaking.sol @@ -27,6 +27,8 @@ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import "../../interfaces/IGeneratorCallbacks.sol"; + import {console} from "hardhat/console.sol"; contract SymbioticStaking is @@ -40,6 +42,11 @@ contract SymbioticStaking is using EnumerableSet for EnumerableSet.AddressSet; using SafeERC20 for IERC20; + IGeneratorCallbacks public immutable I_GENERATOR_CALLBACK; + constructor(IGeneratorCallbacks _generator_callback) { + I_GENERATOR_CALLBACK = _generator_callback; + } + struct EnclaveImage { bytes PCR0; bytes PCR1; @@ -252,6 +259,8 @@ contract SymbioticStaking is operatorLockedAmounts[_stakeToken][_operator] += _amountToLock; emit StakeLocked(_jobId, _operator, _stakeToken, _amountToLock); + + I_GENERATOR_CALLBACK.stakeLockImposedCallback(_operator, _stakeToken, _amountToLock); } function onJobCompletion(uint256 _jobId, address _operator, uint256 _feeRewardAmount) external onlyStakingManager { @@ -278,6 +287,8 @@ contract SymbioticStaking is operatorLockedAmounts[lock.stakeToken][_operator] -= amountToLock[lock.stakeToken]; emit StakeUnlocked(_jobId, _operator, lock.stakeToken, amountToLock[lock.stakeToken]); + + I_GENERATOR_CALLBACK.stakeLockReleasedCallback(_operator, lock.stakeToken, amountToLock[lock.stakeToken]); } /*------------------------------------- slash ------------------------------------*/ @@ -295,6 +306,8 @@ contract SymbioticStaking is delete lockInfo[_slashedJobs[i].jobId]; emit JobSlashed(_slashedJobs[i].jobId, _slashedJobs[i].operator, lock.stakeToken, lockedAmount); + + I_GENERATOR_CALLBACK.stakeSlashedCallback(_slashedJobs[i].operator, lock.stakeToken, lockedAmount); } } @@ -351,6 +364,8 @@ contract SymbioticStaking is confirmedTimestamps.push(confirmedTimestamp); emit SnapshotConfirmed(msg.sender, _captureTimestamp); + + I_GENERATOR_CALLBACK.symbioticCompleteSnapshotCallback(_captureTimestamp); } /*===================================================================================================================*/ diff --git a/package-lock.json b/package-lock.json index a6626ed..9b09f21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,8 +46,7 @@ "node_modules/@adraffy/ens-normalize": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", - "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", - "dev": true + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" }, "node_modules/@aws-crypto/sha256-js": { "version": "1.2.2", @@ -103,7 +102,6 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -115,7 +113,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", - "dev": true, "bin": { "rlp": "bin/rlp" }, @@ -127,7 +124,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "dev": true, "dependencies": { "@ethereumjs/rlp": "^4.0.1", "ethereum-cryptography": "^2.0.0", @@ -141,7 +137,6 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", - "dev": true, "dependencies": { "@noble/hashes": "1.4.0" }, @@ -153,7 +148,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "dev": true, "engines": { "node": ">= 16" }, @@ -165,7 +159,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "dev": true, "dependencies": { "@noble/curves": "1.4.2", "@noble/hashes": "1.4.0", @@ -873,7 +866,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", - "dev": true, "engines": { "node": ">=14" } @@ -882,7 +874,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -890,14 +881,12 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -907,7 +896,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", - "dev": true, "dependencies": { "ethereumjs-abi": "^0.6.8", "ethereumjs-util": "^6.2.1", @@ -923,7 +911,6 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -931,14 +918,12 @@ "node_modules/@metamask/eth-sig-util/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "node_modules/@metamask/eth-sig-util/node_modules/ethereumjs-util": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "dev": true, "dependencies": { "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", @@ -980,7 +965,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", - "dev": true, "engines": { "node": "^14.21.3 || >=16" }, @@ -992,7 +976,6 @@ "version": "1.7.1", "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", - "dev": true, "funding": [ { "type": "individual", @@ -1004,7 +987,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1017,7 +999,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "engines": { "node": ">= 8" } @@ -1026,7 +1007,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1039,7 +1019,6 @@ "version": "0.6.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.6.4.tgz", "integrity": "sha512-YgrSuT3yo5ZQkbvBGqQ7hG+RDvz3YygSkddg4tb1Z0Y6pLXFzwrcEwWaJCFAVeeZxdxGfCgGMUYgRVneK+WXkw==", - "dev": true, "dependencies": { "@nomicfoundation/edr-darwin-arm64": "0.6.4", "@nomicfoundation/edr-darwin-x64": "0.6.4", @@ -1057,7 +1036,6 @@ "version": "0.6.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.6.4.tgz", "integrity": "sha512-QNQErISLgssV9+qia8sIjRANqtbW8snSDvjspixT/kSQ5ZSGxxctTg7x72wPSrcu8+EBEveIe5uqENIp5GH8HQ==", - "dev": true, "engines": { "node": ">= 18" } @@ -1066,7 +1044,6 @@ "version": "0.6.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.6.4.tgz", "integrity": "sha512-cjVmREiwByyc9+oGfvAh49IAw+oVJHF9WWYRD+Tm/ZlSpnEVWxrGNBak2bd/JSYjn+mZE7gmWS4SMRi4nKaLUg==", - "dev": true, "engines": { "node": ">= 18" } @@ -1075,7 +1052,6 @@ "version": "0.6.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.6.4.tgz", "integrity": "sha512-96o9kRIVD6W5VkgKvUOGpWyUGInVQ5BRlME2Fa36YoNsRQMaKtmYJEU0ACosYES6ZTpYC8U5sjMulvPtVoEfOA==", - "dev": true, "engines": { "node": ">= 18" } @@ -1084,7 +1060,6 @@ "version": "0.6.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.6.4.tgz", "integrity": "sha512-+JVEW9e5plHrUfQlSgkEj/UONrIU6rADTEk+Yp9pbe+mzNkJdfJYhs5JYiLQRP4OjxH4QOrXI97bKU6FcEbt5Q==", - "dev": true, "engines": { "node": ">= 18" } @@ -1093,7 +1068,6 @@ "version": "0.6.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.6.4.tgz", "integrity": "sha512-nzYWW+fO3EZItOeP4CrdMgDXfaGBIBkKg0Y/7ySpUxLqzut40O4Mb0/+quqLAFkacUSWMlFp8nsmypJfOH5zoA==", - "dev": true, "engines": { "node": ">= 18" } @@ -1102,7 +1076,6 @@ "version": "0.6.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.6.4.tgz", "integrity": "sha512-QFRoE9qSQ2boRrVeQ1HdzU+XN7NUgwZ1SIy5DQt4d7jCP+5qTNsq8LBNcqhRBOATgO63nsweNUhxX/Suj5r1Sw==", - "dev": true, "engines": { "node": ">= 18" } @@ -1111,7 +1084,6 @@ "version": "0.6.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.6.4.tgz", "integrity": "sha512-2yopjelNkkCvIjUgBGhrn153IBPLwnsDeNiq6oA0WkeM8tGmQi4td+PGi9jAriUDAkc59Yoi2q9hYA6efiY7Zw==", - "dev": true, "engines": { "node": ">= 18" } @@ -1120,7 +1092,6 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz", "integrity": "sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg==", - "dev": true, "dependencies": { "@nomicfoundation/ethereumjs-util": "9.0.4" } @@ -1129,7 +1100,6 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz", "integrity": "sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw==", - "dev": true, "bin": { "rlp": "bin/rlp.cjs" }, @@ -1141,7 +1111,6 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz", "integrity": "sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw==", - "dev": true, "dependencies": { "@nomicfoundation/ethereumjs-common": "4.0.4", "@nomicfoundation/ethereumjs-rlp": "5.0.4", @@ -1164,7 +1133,6 @@ "version": "9.0.4", "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz", "integrity": "sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q==", - "dev": true, "dependencies": { "@nomicfoundation/ethereumjs-rlp": "5.0.4", "ethereum-cryptography": "0.1.3" @@ -1215,7 +1183,6 @@ "version": "0.15.7", "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.7.tgz", "integrity": "sha512-RFhGazR0/JqHxuuIxjjMmM+nWFqEvA7wcVqcX7vUqqmAIGuok4HhnWQH8aOvBaVguiXvvlFDJL0PIlxmkFgIUg==", - "dev": true, "license": "MIT", "dependencies": { "@nomicfoundation/ignition-core": "^0.15.7", @@ -1235,7 +1202,6 @@ "version": "0.15.7", "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.7.tgz", "integrity": "sha512-pUZWQeFNMwDe6F/yKIJsCo+87elk/M/Edjp6AnWWIBplRyPa13Nh63+yOqMSSd9Mx9lLuBaEGnYXoI2Uz2wYZA==", - "dev": true, "license": "MIT", "peerDependencies": { "@nomicfoundation/hardhat-ethers": "^3.0.4", @@ -1249,7 +1215,6 @@ "version": "1.0.12", "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.12.tgz", "integrity": "sha512-xTNQNI/9xkHvjmCJnJOTyqDSl8uq1rKb2WOVmixQxFtRd7Oa3ecO8zM0cyC2YmOK+jHB9WPZ+F/ijkHg1CoORA==", - "dev": true, "dependencies": { "ethereumjs-util": "^7.1.4" }, @@ -1286,7 +1251,6 @@ "version": "2.0.11", "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.11.tgz", "integrity": "sha512-lGIo4dNjVQFdsiEgZp3KP6ntLiF7xJEJsbNHfSyIiFCyI0Yv0518ElsFtMC5uCuHEChiBBMrib9jWQvHHT+X3Q==", - "dev": true, "dependencies": { "@ethersproject/abi": "^5.1.2", "@ethersproject/address": "^5.0.2", @@ -1306,7 +1270,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -1318,7 +1281,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1332,7 +1294,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -1340,14 +1301,12 @@ "node_modules/@nomicfoundation/hardhat-verify/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/@nomicfoundation/hardhat-verify/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -1356,7 +1315,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "engines": { "node": ">=4" } @@ -1365,7 +1323,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -1377,7 +1334,6 @@ "version": "0.15.7", "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-core/-/ignition-core-0.15.7.tgz", "integrity": "sha512-C4/0V/q2gNxKDt88cMr+Oxlf4NINQ7QgmJyciQ1/6UdCRUg+/Pgdgpd3vgGXQVTotq50Q/BU4ofNUAD/8HRqtg==", - "dev": true, "license": "MIT", "dependencies": { "@ethersproject/address": "5.6.1", @@ -1395,7 +1351,6 @@ "version": "5.6.1", "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", - "dev": true, "funding": [ { "type": "individual", @@ -1419,7 +1374,6 @@ "version": "9.0.2", "resolved": "https://registry.npmjs.org/cbor/-/cbor-9.0.2.tgz", "integrity": "sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==", - "dev": true, "license": "MIT", "dependencies": { "nofilter": "^3.1.0" @@ -1431,8 +1385,7 @@ "node_modules/@nomicfoundation/ignition-ui": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.7.tgz", - "integrity": "sha512-pj2LmXylgbHOTNrkFqFrre/FAOjcwYl4VKIKVH/QMMBH/DatbiT8aC5n9o2fbLD8uwlPEesD+uXZuKCE71KFBg==", - "dev": true + "integrity": "sha512-pj2LmXylgbHOTNrkFqFrre/FAOjcwYl4VKIKVH/QMMBH/DatbiT8aC5n9o2fbLD8uwlPEesD+uXZuKCE71KFBg==" }, "node_modules/@nomicfoundation/slang": { "version": "0.17.0", @@ -1529,7 +1482,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.2.tgz", "integrity": "sha512-q4n32/FNKIhQ3zQGGw5CvPF6GTvDCpYwIf7bEY/dZTZbgfDsHyjJwURxUJf3VQuuJj+fDIFl4+KkBVbw4Ef6jA==", - "dev": true, "engines": { "node": ">= 12" }, @@ -1547,7 +1499,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.2.tgz", "integrity": "sha512-JaqcWPDZENCvm++lFFGjrDd8mxtf+CtLd2MiXvMNTBD33dContTZ9TWETwNFwg7JTJT5Q9HEecH7FA+HTSsIUw==", - "dev": true, "optional": true, "engines": { "node": ">= 12" @@ -1557,7 +1508,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.2.tgz", "integrity": "sha512-fZNmVztrSXC03e9RONBT+CiksSeYcxI1wlzqyr0L7hsQlK1fzV+f04g2JtQ1c/Fe74ZwdV6aQBdd6Uwl1052sw==", - "dev": true, "optional": true, "engines": { "node": ">= 12" @@ -1567,7 +1517,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.2.tgz", "integrity": "sha512-3d54oc+9ZVBuB6nbp8wHylk4xh0N0Gc+bk+/uJae+rUgbOBwQSfuGIbAZt1wBXs5REkSmynEGcqx6DutoK0tPA==", - "dev": true, "optional": true, "engines": { "node": ">= 12" @@ -1577,7 +1526,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.2.tgz", "integrity": "sha512-iDJfR2qf55vgsg7BtJa7iPiFAsYf2d0Tv/0B+vhtnI16+wfQeTbP7teookbGvAo0eJo7aLLm0xfS/GTkvHIucA==", - "dev": true, "optional": true, "engines": { "node": ">= 12" @@ -1587,7 +1535,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.2.tgz", "integrity": "sha512-9dlHMAt5/2cpWyuJ9fQNOUXFB/vgSFORg1jpjX1Mh9hJ/MfZXlDdHQ+DpFCs32Zk5pxRBb07yGvSHk9/fezL+g==", - "dev": true, "optional": true, "engines": { "node": ">= 12" @@ -1597,7 +1544,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.2.tgz", "integrity": "sha512-GzzVeeJob3lfrSlDKQw2bRJ8rBf6mEYaWY+gW0JnTDHINA0s2gPR4km5RLIj1xeZZOYz4zRw+AEeYgLRqB2NXg==", - "dev": true, "optional": true, "engines": { "node": ">= 12" @@ -1607,7 +1553,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.2.tgz", "integrity": "sha512-Fdjli4DCcFHb4Zgsz0uEJXZ2K7VEO+w5KVv7HmT7WO10iODdU9csC2az4jrhEsRtiR9Gfd74FlG0NYlw1BMdyA==", - "dev": true, "optional": true, "engines": { "node": ">= 12" @@ -1728,7 +1673,6 @@ "version": "1.1.9", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", - "dev": true, "funding": { "url": "https://paulmillr.com/funding/" } @@ -1737,7 +1681,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", - "dev": true, "dependencies": { "@noble/curves": "~1.4.0", "@noble/hashes": "~1.4.0", @@ -1751,7 +1694,6 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", - "dev": true, "dependencies": { "@noble/hashes": "1.4.0" }, @@ -1763,7 +1705,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "dev": true, "engines": { "node": ">= 16" }, @@ -1775,7 +1716,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", - "dev": true, "dependencies": { "@noble/hashes": "~1.4.0", "@scure/base": "~1.1.6" @@ -1788,7 +1728,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "dev": true, "engines": { "node": ">= 16" }, @@ -1800,7 +1739,6 @@ "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", - "dev": true, "dependencies": { "@sentry/hub": "5.30.0", "@sentry/minimal": "5.30.0", @@ -1816,7 +1754,6 @@ "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", - "dev": true, "dependencies": { "@sentry/types": "5.30.0", "@sentry/utils": "5.30.0", @@ -1830,7 +1767,6 @@ "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", - "dev": true, "dependencies": { "@sentry/hub": "5.30.0", "@sentry/types": "5.30.0", @@ -1844,7 +1780,6 @@ "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", - "dev": true, "dependencies": { "@sentry/core": "5.30.0", "@sentry/hub": "5.30.0", @@ -1864,7 +1799,6 @@ "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", - "dev": true, "dependencies": { "@sentry/hub": "5.30.0", "@sentry/minimal": "5.30.0", @@ -1880,7 +1814,6 @@ "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", - "dev": true, "engines": { "node": ">=6" } @@ -1889,7 +1822,6 @@ "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", - "dev": true, "dependencies": { "@sentry/types": "5.30.0", "tslib": "^1.9.3" @@ -1918,7 +1850,6 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.5.tgz", "integrity": "sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==", - "dev": true, "dependencies": { "antlr4ts": "^0.5.0-alpha.4" } @@ -1926,32 +1857,27 @@ "node_modules/@tsconfig/node10": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", - "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "dev": true + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" }, "node_modules/@typechain/ethers-v6": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/@typechain/ethers-v6/-/ethers-v6-0.5.1.tgz", "integrity": "sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA==", - "dev": true, "dependencies": { "lodash": "^4.17.15", "ts-essentials": "^7.0.1" @@ -1966,7 +1892,6 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/@typechain/hardhat/-/hardhat-9.1.0.tgz", "integrity": "sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA==", - "dev": true, "dependencies": { "fs-extra": "^9.1.0" }, @@ -1981,7 +1906,6 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -2017,7 +1941,6 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -2026,7 +1949,6 @@ "version": "0.0.33", "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -2035,7 +1957,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", - "dev": true, "dependencies": { "@types/minimatch": "*", "@types/node": "*" @@ -2044,20 +1965,17 @@ "node_modules/@types/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", - "dev": true + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==" }, "node_modules/@types/minimatch": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" }, "node_modules/@types/mocha": { "version": "10.0.9", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.9.tgz", - "integrity": "sha512-sicdRoWtYevwxjOHNMPTl3vSfJM6oyW8o1wXeI7uww6b6xHg8eBznQDNSGBCDJmsE8UMxP05JgZRtsKbTqt//Q==", - "dev": true + "integrity": "sha512-sicdRoWtYevwxjOHNMPTl3vSfJM6oyW8o1wXeI7uww6b6xHg8eBznQDNSGBCDJmsE8UMxP05JgZRtsKbTqt//Q==" }, "node_modules/@types/node": { "version": "22.7.7", @@ -2087,14 +2005,12 @@ "node_modules/@types/prettier": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", - "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", - "dev": true + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==" }, "node_modules/@types/qs": { "version": "6.9.16", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.16.tgz", - "integrity": "sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A==", - "dev": true + "integrity": "sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A==" }, "node_modules/@types/secp256k1": { "version": "4.0.6", @@ -2107,14 +2023,12 @@ "node_modules/abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==", - "dev": true + "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==" }, "node_modules/acorn": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", "integrity": "sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -2126,7 +2040,6 @@ "version": "8.3.4", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "dev": true, "dependencies": { "acorn": "^8.11.0" }, @@ -2138,7 +2051,6 @@ "version": "0.4.16", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", - "dev": true, "engines": { "node": ">=0.3.0" } @@ -2146,14 +2058,12 @@ "node_modules/aes-js": { "version": "4.0.0-beta.5", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", - "dev": true + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, "dependencies": { "debug": "4" }, @@ -2165,7 +2075,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -2178,7 +2087,6 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -2206,7 +2114,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", - "dev": true, "optional": true, "engines": { "node": ">=0.4.2" @@ -2216,7 +2123,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, "dependencies": { "string-width": "^4.1.0" } @@ -2225,7 +2131,6 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, "engines": { "node": ">=6" } @@ -2234,7 +2139,6 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -2249,7 +2153,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -2271,14 +2174,12 @@ "node_modules/antlr4ts": { "version": "0.5.0-alpha.4", "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz", - "integrity": "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==", - "dev": true + "integrity": "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==" }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -2290,20 +2191,17 @@ "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/array-back": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, "engines": { "node": ">=6" } @@ -2312,7 +2210,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, "engines": { "node": ">=8" } @@ -2321,7 +2218,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -2329,14 +2225,12 @@ "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", - "dev": true + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, "engines": { "node": "*" } @@ -2345,7 +2239,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, "engines": { "node": ">=8" } @@ -2353,8 +2246,7 @@ "node_modules/async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", - "dev": true + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==" }, "node_modules/async-retry": { "version": "1.3.3", @@ -2373,7 +2265,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -2437,7 +2328,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, "engines": { "node": ">=8" }, @@ -2459,7 +2349,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "dev": true, "dependencies": { "ansi-align": "^3.0.0", "camelcase": "^6.2.0", @@ -2481,7 +2370,6 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, "engines": { "node": ">=10" }, @@ -2501,7 +2389,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -2517,8 +2404,7 @@ "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" }, "node_modules/browserify-aes": { "version": "1.2.0", @@ -2564,8 +2450,7 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/buffer-xor": { "version": "1.0.3", @@ -2576,7 +2461,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, "engines": { "node": ">= 0.8" } @@ -2585,7 +2469,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -2604,7 +2487,6 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, "engines": { "node": ">=10" }, @@ -2615,14 +2497,12 @@ "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" }, "node_modules/cbor": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", - "dev": true, "dependencies": { "nofilter": "^3.1.0" }, @@ -2634,7 +2514,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", - "dev": true, "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.3", @@ -2678,7 +2557,6 @@ "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", - "dev": true, "engines": { "node": "*" } @@ -2698,7 +2576,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", - "dev": true, "dependencies": { "readdirp": "^4.0.1" }, @@ -2712,8 +2589,7 @@ "node_modules/ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" }, "node_modules/cipher-base": { "version": "1.0.4", @@ -2728,7 +2604,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, "engines": { "node": ">=6" } @@ -2737,7 +2612,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true, "engines": { "node": ">=6" }, @@ -2749,7 +2623,6 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", - "dev": true, "dependencies": { "object-assign": "^4.1.0", "string-width": "^2.1.1" @@ -2765,7 +2638,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, "engines": { "node": ">=4" } @@ -2774,7 +2646,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, "engines": { "node": ">=4" } @@ -2783,7 +2654,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, "dependencies": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -2796,7 +2666,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, "dependencies": { "ansi-regex": "^3.0.0" }, @@ -2808,7 +2677,6 @@ "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -2835,7 +2703,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "dev": true, "engines": { "node": ">=0.1.90" } @@ -2854,14 +2721,12 @@ "node_modules/command-exists": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" }, "node_modules/command-line-args": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", - "dev": true, "dependencies": { "array-back": "^3.1.0", "find-replace": "^3.0.0", @@ -2876,7 +2741,6 @@ "version": "6.1.3", "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", - "dev": true, "dependencies": { "array-back": "^4.0.2", "chalk": "^2.4.2", @@ -2891,7 +2755,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -2903,7 +2766,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "dev": true, "engines": { "node": ">=8" } @@ -2912,7 +2774,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -2926,7 +2787,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -2934,14 +2794,12 @@ "node_modules/command-line-usage/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/command-line-usage/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -2950,7 +2808,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "engines": { "node": ">=4" } @@ -2959,7 +2816,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -2971,7 +2827,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "dev": true, "engines": { "node": ">=8" } @@ -2980,7 +2835,6 @@ "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "dev": true, "engines": { "node": ">= 12" } @@ -2993,14 +2847,12 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/concat-stream": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, "engines": [ "node >= 0.8" ], @@ -3015,7 +2867,6 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -3029,14 +2880,12 @@ "node_modules/concat-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 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/concat-stream/node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, "dependencies": { "safe-buffer": "~5.1.0" } @@ -3045,7 +2894,6 @@ "version": "0.4.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "dev": true, "engines": { "node": ">= 0.6" } @@ -3053,8 +2901,7 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/create-hash": { "version": "1.2.0", @@ -3084,14 +2931,12 @@ "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" }, "node_modules/crypt": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", - "dev": true, "engines": { "node": "*" } @@ -3099,8 +2944,7 @@ "node_modules/death": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", - "integrity": "sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==", - "dev": true + "integrity": "sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==" }, "node_modules/debug": { "version": "4.3.7", @@ -3122,7 +2966,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, "engines": { "node": ">=10" }, @@ -3145,7 +2988,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, "engines": { "node": ">=4.0.0" } @@ -3153,14 +2995,12 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -3185,7 +3025,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, "engines": { "node": ">= 0.8" } @@ -3194,7 +3033,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", - "dev": true, "engines": { "node": ">=0.3.1" } @@ -3203,7 +3041,6 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", "integrity": "sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==", - "dev": true, "dependencies": { "heap": ">= 0.2.0" }, @@ -3215,7 +3052,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -3270,14 +3106,12 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/enquirer": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -3290,7 +3124,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true, "engines": { "node": ">=6" } @@ -3299,7 +3132,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -3311,7 +3143,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, "engines": { "node": ">= 0.4" } @@ -3320,7 +3151,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, "engines": { "node": ">=6" } @@ -3329,7 +3159,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, "engines": { "node": ">=10" }, @@ -3341,7 +3170,6 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==", - "dev": true, "dependencies": { "esprima": "^2.7.1", "estraverse": "^1.9.1", @@ -3363,7 +3191,6 @@ "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", - "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -3376,7 +3203,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", "integrity": "sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -3385,7 +3211,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -3394,7 +3219,6 @@ "version": "0.2.27", "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.27.tgz", "integrity": "sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw==", - "dev": true, "dependencies": { "@solidity-parser/parser": "^0.14.0", "axios": "^1.5.1", @@ -3423,7 +3247,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", - "dev": true, "funding": [ { "type": "individual", @@ -3435,7 +3258,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", - "dev": true, "funding": [ { "type": "individual", @@ -3452,7 +3274,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", - "dev": true, "funding": [ { "type": "individual", @@ -3468,7 +3289,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", - "dev": true, "dependencies": { "@noble/hashes": "1.2.0", "@noble/secp256k1": "1.7.1", @@ -3480,7 +3300,6 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "dev": true, "funding": [ { "type": "individual", @@ -3528,7 +3347,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz", "integrity": "sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA==", - "dev": true, "dependencies": { "@noble/hashes": "^1.4.0" } @@ -3559,7 +3377,6 @@ "version": "0.6.8", "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", - "dev": true, "dependencies": { "bn.js": "^4.11.8", "ethereumjs-util": "^6.0.0" @@ -3569,7 +3386,6 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -3577,14 +3393,12 @@ "node_modules/ethereumjs-abi/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "node_modules/ethereumjs-abi/node_modules/ethereumjs-util": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "dev": true, "dependencies": { "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", @@ -3614,7 +3428,6 @@ "version": "6.13.4", "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.4.tgz", "integrity": "sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA==", - "dev": true, "funding": [ { "type": "individual", @@ -3642,7 +3455,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dev": true, "dependencies": { "@noble/hashes": "1.3.2" }, @@ -3654,7 +3466,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "dev": true, "engines": { "node": ">= 16" }, @@ -3666,7 +3477,6 @@ "version": "22.7.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", - "dev": true, "dependencies": { "undici-types": "~6.19.2" } @@ -3674,14 +3484,12 @@ "node_modules/ethers/node_modules/tslib": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" }, "node_modules/ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", "integrity": "sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==", - "dev": true, "dependencies": { "bn.js": "4.11.6", "number-to-bn": "1.7.0" @@ -3694,14 +3502,12 @@ "node_modules/ethjs-unit/node_modules/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", - "dev": true + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==" }, "node_modules/ethjs-util": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "dev": true, "dependencies": { "is-hex-prefixed": "1.0.0", "strip-hex-prefix": "1.0.0" @@ -3728,14 +3534,12 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -3750,20 +3554,17 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, "node_modules/fast-uri": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", - "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", - "dev": true + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==" }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -3772,7 +3573,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3784,7 +3584,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "dev": true, "dependencies": { "array-back": "^3.0.1" }, @@ -3796,7 +3595,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, "dependencies": { "locate-path": "^2.0.0" }, @@ -3808,7 +3606,6 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, "bin": { "flat": "cli.js" } @@ -3848,14 +3645,12 @@ "node_modules/fp-ts": { "version": "1.19.3", "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", - "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", - "dev": true + "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==" }, "node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", @@ -3869,20 +3664,17 @@ "node_modules/fs-readdir-recursive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", - "dev": true + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==" }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -3896,7 +3688,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3905,7 +3696,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -3922,7 +3712,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -3941,7 +3730,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==", - "dev": true, "engines": { "node": ">=4" } @@ -3950,7 +3738,6 @@ "version": "0.0.2", "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", - "dev": true, "dependencies": { "chalk": "^2.4.2", "node-emoji": "^1.10.0" @@ -3963,7 +3750,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -3975,7 +3761,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -3989,7 +3774,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -3997,14 +3781,12 @@ "node_modules/ghost-testrpc/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/ghost-testrpc/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -4013,7 +3795,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "engines": { "node": ">=4" } @@ -4022,7 +3803,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -4035,7 +3815,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4055,7 +3834,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -4067,7 +3845,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4077,7 +3854,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -4089,7 +3865,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, "dependencies": { "global-prefix": "^3.0.0" }, @@ -4101,7 +3876,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, "dependencies": { "ini": "^1.3.5", "kind-of": "^6.0.2", @@ -4115,7 +3889,6 @@ "version": "10.0.2", "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "dev": true, "dependencies": { "@types/glob": "^7.1.1", "array-union": "^2.1.0", @@ -4134,7 +3907,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -4151,7 +3923,6 @@ "version": "4.7.8", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", - "dev": true, "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.2", @@ -4172,7 +3943,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -4181,7 +3951,6 @@ "version": "2.22.13", "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.22.13.tgz", "integrity": "sha512-psVJX4FSXDpSXwsU8OcKTJN04pQEj9cFBMX5OPko+OFwbIoiOpvRmafa954/UaA1934npTj8sV3gaTSdx9bPbA==", - "dev": true, "dependencies": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", @@ -4248,7 +4017,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.10.tgz", "integrity": "sha512-02N4+So/fZrzJ88ci54GqwVA3Zrf0C9duuTyGt0CFRIh/CdNwbnTgkXkRfojOMLBQ+6t+lBIkgbsOtqMvNwikA==", - "dev": true, "dependencies": { "array-uniq": "1.0.3", "eth-gas-reporter": "^0.2.25", @@ -4338,7 +4106,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", - "dev": true, "funding": [ { "type": "individual", @@ -4350,7 +4117,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", - "dev": true, "funding": [ { "type": "individual", @@ -4367,7 +4133,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", - "dev": true, "funding": [ { "type": "individual", @@ -4383,7 +4148,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -4395,7 +4159,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -4409,7 +4172,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -4417,14 +4179,12 @@ "node_modules/hardhat/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/hardhat/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -4433,7 +4193,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", - "dev": true, "dependencies": { "@noble/hashes": "1.2.0", "@noble/secp256k1": "1.7.1", @@ -4445,7 +4204,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", @@ -4459,7 +4217,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "engines": { "node": ">=4" } @@ -4468,7 +4225,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -4477,7 +4233,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -4489,7 +4244,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -4498,7 +4252,6 @@ "version": "7.5.10", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "dev": true, "engines": { "node": ">=8.3.0" }, @@ -4527,7 +4280,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, "dependencies": { "es-define-property": "^1.0.0" }, @@ -4539,7 +4291,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -4551,7 +4302,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -4585,7 +4335,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -4597,7 +4346,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, "bin": { "he": "bin/he" } @@ -4605,8 +4353,7 @@ "node_modules/heap": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", - "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==", - "dev": true + "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==" }, "node_modules/hmac-drbg": { "version": "1.0.1", @@ -4622,7 +4369,6 @@ "version": "8.1.3", "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", - "dev": true, "dependencies": { "caseless": "^0.12.0", "concat-stream": "^1.6.2", @@ -4637,7 +4383,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -4653,7 +4398,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", - "dev": true, "dependencies": { "@types/node": "^10.0.3" } @@ -4661,14 +4405,12 @@ "node_modules/http-response-object/node_modules/@types/node": { "version": "10.17.60", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -4681,7 +4423,6 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -4712,7 +4453,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, "engines": { "node": ">= 4" } @@ -4721,7 +4461,6 @@ "version": "10.0.2", "resolved": "https://registry.npmjs.org/immer/-/immer-10.0.2.tgz", "integrity": "sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==", - "dev": true, "license": "MIT", "funding": { "type": "opencollective", @@ -4731,14 +4470,12 @@ "node_modules/immutable": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", - "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", - "dev": true + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==" }, "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, "engines": { "node": ">=8" } @@ -4748,7 +4485,6 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4762,14 +4498,12 @@ "node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true, "engines": { "node": ">= 0.10" } @@ -4778,7 +4512,6 @@ "version": "1.10.4", "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz", "integrity": "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==", - "dev": true, "dependencies": { "fp-ts": "^1.0.0" } @@ -4787,7 +4520,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -4799,7 +4531,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -4808,7 +4539,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -4817,7 +4547,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -4829,7 +4558,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", - "dev": true, "engines": { "node": ">=6.5.0", "npm": ">=3" @@ -4839,7 +4567,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -4848,7 +4575,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, "engines": { "node": ">=8" } @@ -4857,7 +4583,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, "engines": { "node": ">=10" }, @@ -4873,8 +4598,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/isomorphic-unfetch": { "version": "3.1.0", @@ -4899,7 +4623,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -4910,14 +4633,12 @@ "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/json-stream-stringify": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/json-stream-stringify/-/json-stream-stringify-3.1.6.tgz", "integrity": "sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog==", - "dev": true, "engines": { "node": ">=7.10.1" } @@ -4926,14 +4647,12 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, "license": "ISC" }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, "bin": { "json5": "lib/cli.js" }, @@ -4945,7 +4664,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, "dependencies": { "universalify": "^2.0.0" }, @@ -4957,7 +4675,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", - "dev": true, "engines": { "node": "*" } @@ -4980,7 +4697,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -4989,7 +4705,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true, "engines": { "node": ">=6" } @@ -4998,7 +4713,6 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, "dependencies": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -5011,7 +4725,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -5028,14 +4741,12 @@ "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" }, "node_modules/lodash.isequal": { "version": "4.5.0", @@ -5045,14 +4756,12 @@ "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==" }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -5068,7 +4777,6 @@ "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, "dependencies": { "get-func-name": "^2.0.1" } @@ -5076,20 +4784,17 @@ "node_modules/lru_map": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", - "dev": true + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==" }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" }, "node_modules/markdown-table": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", - "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==", - "dev": true + "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==" }, "node_modules/md5.js": { "version": "1.3.5", @@ -5105,7 +4810,6 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", - "dev": true, "engines": { "node": ">= 0.10.0" } @@ -5114,7 +4818,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -5122,14 +4825,12 @@ "node_modules/micro-ftch": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", - "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==", - "dev": true + "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==" }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -5193,7 +4894,6 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, "dependencies": { "minimist": "^1.2.6" }, @@ -5205,7 +4905,6 @@ "version": "0.38.5", "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", - "dev": true, "dependencies": { "obliterator": "^2.0.0" } @@ -5214,7 +4913,6 @@ "version": "10.7.3", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", - "dev": true, "dependencies": { "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", @@ -5249,7 +4947,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -5273,7 +4970,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -5290,7 +4986,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5309,7 +5004,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -5324,7 +5018,6 @@ "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -5336,7 +5029,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -5351,7 +5043,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -5366,7 +5057,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -5375,7 +5065,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -5387,7 +5076,6 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -5407,7 +5095,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ndjson/-/ndjson-2.0.0.tgz", "integrity": "sha512-nGl7LRGrzugTtaFcJMhLbpzJM6XdivmbkdlaGcrk/LXg2KL/YBC6z1g70xh0/al+oFuVFP8N8kiWRucmeEH/qQ==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "json-stringify-safe": "^5.0.1", @@ -5426,8 +5113,7 @@ "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, "node_modules/node-addon-api": { "version": "2.0.2", @@ -5438,7 +5124,6 @@ "version": "1.11.0", "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", - "dev": true, "dependencies": { "lodash": "^4.17.21" } @@ -5489,7 +5174,6 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", - "dev": true, "dependencies": { "abbrev": "1" }, @@ -5501,7 +5185,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5510,7 +5193,6 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", "integrity": "sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==", - "dev": true, "dependencies": { "bn.js": "4.11.6", "strip-hex-prefix": "1.0.0" @@ -5523,14 +5205,12 @@ "node_modules/number-to-bn/node_modules/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", - "dev": true + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==" }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5539,7 +5219,6 @@ "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -5550,14 +5229,12 @@ "node_modules/obliterator": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", - "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", - "dev": true + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==" }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } @@ -5566,7 +5243,6 @@ "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, "dependencies": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", @@ -5588,7 +5264,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5597,7 +5272,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, "dependencies": { "p-try": "^1.0.0" }, @@ -5609,7 +5283,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, "dependencies": { "p-limit": "^1.1.0" }, @@ -5621,7 +5294,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, "dependencies": { "aggregate-error": "^3.0.0" }, @@ -5636,7 +5308,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true, "engines": { "node": ">=4" } @@ -5644,14 +5315,12 @@ "node_modules/parse-cache-control": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", - "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==", - "dev": true + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==" }, "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, "engines": { "node": ">=4" } @@ -5660,7 +5329,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5668,14 +5336,12 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, "engines": { "node": ">=8" } @@ -5684,7 +5350,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, "engines": { "node": "*" } @@ -5708,7 +5373,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -5720,7 +5384,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, "engines": { "node": ">=6" } @@ -5729,7 +5392,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "dev": true, "engines": { "node": ">= 0.8.0" } @@ -5786,14 +5448,12 @@ "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "node_modules/promise": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", - "dev": true, "dependencies": { "asap": "~2.0.6" } @@ -5802,7 +5462,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -5838,7 +5497,6 @@ "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dev": true, "dependencies": { "side-channel": "^1.0.6" }, @@ -5853,7 +5511,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -5881,7 +5538,6 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dev": true, "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -5909,7 +5565,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", - "dev": true, "engines": { "node": ">= 14.16.0" }, @@ -5922,7 +5577,6 @@ "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dev": true, "dependencies": { "resolve": "^1.1.6" }, @@ -5934,7 +5588,6 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", - "dev": true, "dependencies": { "minimatch": "^3.0.5" }, @@ -5946,7 +5599,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5956,7 +5608,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5968,7 +5619,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", - "dev": true, "engines": { "node": ">=6" } @@ -5977,7 +5627,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", "integrity": "sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ==", - "dev": true, "dependencies": { "req-from": "^2.0.0" }, @@ -5989,7 +5638,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", "integrity": "sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA==", - "dev": true, "dependencies": { "resolve-from": "^3.0.0" }, @@ -6001,7 +5649,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -6010,7 +5657,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -6019,7 +5665,6 @@ "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, "dependencies": { "path-parse": "^1.0.6" }, @@ -6031,7 +5676,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", - "dev": true, "engines": { "node": ">=4" } @@ -6048,7 +5692,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -6078,7 +5721,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -6119,14 +5761,12 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sc-istanbul": { "version": "0.4.6", "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.6.tgz", "integrity": "sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g==", - "dev": true, "dependencies": { "abbrev": "1.0.x", "async": "1.x", @@ -6151,7 +5791,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -6160,7 +5799,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6171,7 +5809,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, "dependencies": { "inflight": "^1.0.4", "inherits": "2", @@ -6187,7 +5824,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -6196,7 +5832,6 @@ "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -6209,7 +5844,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -6222,7 +5856,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6233,14 +5866,12 @@ "node_modules/sc-istanbul/node_modules/resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", - "dev": true + "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==" }, "node_modules/sc-istanbul/node_modules/supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", - "dev": true, "dependencies": { "has-flag": "^1.0.0" }, @@ -6295,7 +5926,6 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -6304,7 +5934,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, "dependencies": { "randombytes": "^2.1.0" } @@ -6313,7 +5942,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -6334,8 +5962,7 @@ "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "node_modules/sha.js": { "version": "2.4.11", @@ -6353,7 +5980,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", "integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==", - "dev": true, "dependencies": { "charenc": ">= 0.0.1", "crypt": ">= 0.0.1" @@ -6366,7 +5992,6 @@ "version": "0.8.5", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, "dependencies": { "glob": "^7.0.0", "interpret": "^1.0.0", @@ -6383,7 +6008,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dev": true, "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -6405,14 +6029,12 @@ "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, "engines": { "node": ">=8" } @@ -6421,7 +6043,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -6438,7 +6059,6 @@ "version": "0.8.26", "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.26.tgz", "integrity": "sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==", - "dev": true, "dependencies": { "command-exists": "^1.2.8", "commander": "^8.1.0", @@ -6459,7 +6079,6 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, "bin": { "semver": "bin/semver" } @@ -6473,7 +6092,6 @@ "version": "0.8.13", "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.13.tgz", "integrity": "sha512-RiBoI+kF94V3Rv0+iwOj3HQVSqNzA9qm/qDP1ZDXK5IX0Cvho1qiz8hAXTsAo6KOIUeP73jfscq0KlLqVxzGWA==", - "dev": true, "dependencies": { "@ethersproject/abi": "^5.0.9", "@solidity-parser/parser": "^0.18.0", @@ -6505,14 +6123,12 @@ "node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.18.0.tgz", - "integrity": "sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==", - "dev": true + "integrity": "sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==" }, "node_modules/solidity-coverage/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -6524,7 +6140,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -6538,7 +6153,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -6546,14 +6160,12 @@ "node_modules/solidity-coverage/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/solidity-coverage/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -6562,7 +6174,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -6576,7 +6187,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "engines": { "node": ">=4" } @@ -6585,7 +6195,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -6594,7 +6203,6 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, "bin": { "semver": "bin/semver.js" }, @@ -6606,7 +6214,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -6618,7 +6225,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -6627,7 +6233,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", "integrity": "sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==", - "dev": true, "optional": true, "dependencies": { "amdefine": ">=0.0.4" @@ -6640,7 +6245,6 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -6650,7 +6254,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -6659,7 +6262,6 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", - "dev": true, "license": "ISC", "dependencies": { "readable-stream": "^3.0.0" @@ -6668,14 +6270,12 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "node_modules/stacktrace-parser": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", - "dev": true, "dependencies": { "type-fest": "^0.7.1" }, @@ -6687,7 +6287,6 @@ "version": "0.7.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", - "dev": true, "engines": { "node": ">=8" } @@ -6696,7 +6295,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "dev": true, "engines": { "node": ">= 0.8" } @@ -6712,14 +6310,12 @@ "node_modules/string-format": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz", - "integrity": "sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==", - "dev": true + "integrity": "sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==" }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6733,7 +6329,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6745,7 +6340,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", - "dev": true, "dependencies": { "is-hex-prefixed": "1.0.0" }, @@ -6758,7 +6352,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "engines": { "node": ">=8" }, @@ -6781,7 +6374,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", - "dev": true, "dependencies": { "http-response-object": "^3.0.1", "sync-rpc": "^1.2.1", @@ -6795,7 +6387,6 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", - "dev": true, "dependencies": { "get-port": "^3.1.0" } @@ -6804,7 +6395,6 @@ "version": "6.8.2", "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==", - "dev": true, "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -6820,7 +6410,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", - "dev": true, "dependencies": { "array-back": "^4.0.1", "deep-extend": "~0.6.0", @@ -6835,7 +6424,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "dev": true, "engines": { "node": ">=8" } @@ -6844,7 +6432,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "dev": true, "engines": { "node": ">=8" } @@ -6853,7 +6440,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", - "dev": true, "dependencies": { "@types/concat-stream": "^1.6.0", "@types/form-data": "0.0.33", @@ -6874,14 +6460,12 @@ "node_modules/then-request/node_modules/@types/node": { "version": "8.10.66", "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", - "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==", - "dev": true + "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==" }, "node_modules/then-request/node_modules/form-data": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.2.tgz", "integrity": "sha512-GgwY0PS7DbXqajuGf4OYlsrIu3zgxD6Vvql43IBhm6MahqA5SK/7mwhtNj2AdH2z35YR34ujJ7BN+3fFC3jP5Q==", - "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -6896,7 +6480,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", - "dev": true, "license": "MIT", "dependencies": { "readable-stream": "3" @@ -6906,7 +6489,6 @@ "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, "dependencies": { "os-tmpdir": "~1.0.2" }, @@ -6918,7 +6500,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -6930,7 +6511,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "dev": true, "engines": { "node": ">=0.6" } @@ -6944,7 +6524,6 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", "integrity": "sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==", - "dev": true, "dependencies": { "chalk": "^4.1.0", "command-line-args": "^5.1.1", @@ -6959,7 +6538,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", "integrity": "sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==", - "dev": true, "peerDependencies": { "typescript": ">=3.7.0" } @@ -6968,7 +6546,6 @@ "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -7011,7 +6588,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, "engines": { "node": ">=0.3.1" } @@ -7024,26 +6600,22 @@ "node_modules/tsort": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", - "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", - "dev": true + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==" }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "dev": true + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, "node_modules/tweetnacl-util": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", - "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", - "dev": true + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dev": true, "dependencies": { "prelude-ls": "~1.1.2" }, @@ -7063,7 +6635,6 @@ "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, "engines": { "node": ">=10" }, @@ -7075,7 +6646,6 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", "integrity": "sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==", - "dev": true, "dependencies": { "@types/prettier": "^2.1.1", "debug": "^4.3.1", @@ -7099,7 +6669,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7109,7 +6678,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", @@ -7124,7 +6692,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7144,7 +6711,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -7153,7 +6719,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -7165,7 +6730,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -7177,7 +6741,6 @@ "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "dev": true, "bin": { "prettier": "bin-prettier.js" }, @@ -7192,7 +6755,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -7200,14 +6762,12 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "dev": true + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { "version": "5.6.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7220,7 +6780,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "dev": true, "engines": { "node": ">=8" } @@ -7229,7 +6788,6 @@ "version": "3.19.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", - "dev": true, "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -7242,7 +6800,6 @@ "version": "5.28.4", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", - "dev": true, "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -7264,7 +6821,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, "engines": { "node": ">= 10.0.0" } @@ -7273,7 +6829,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "dev": true, "engines": { "node": ">= 0.8" } @@ -7281,8 +6836,7 @@ "node_modules/utf8": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", - "dev": true + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" }, "node_modules/util-deprecate": { "version": "1.0.2", @@ -7293,7 +6847,6 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, "bin": { "uuid": "dist/bin/uuid" } @@ -7301,14 +6854,12 @@ "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" }, "node_modules/web3-utils": { "version": "1.10.4", "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.4.tgz", "integrity": "sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==", - "dev": true, "dependencies": { "@ethereumjs/util": "^8.1.0", "bn.js": "^5.2.1", @@ -7327,7 +6878,6 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", - "dev": true, "dependencies": { "@noble/hashes": "1.4.0" }, @@ -7339,7 +6889,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "dev": true, "engines": { "node": ">= 16" }, @@ -7351,7 +6900,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "dev": true, "dependencies": { "@noble/curves": "1.4.2", "@noble/hashes": "1.4.0", @@ -7377,7 +6925,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -7389,7 +6936,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, "dependencies": { "string-width": "^4.0.0" }, @@ -7401,7 +6947,6 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -7409,14 +6954,12 @@ "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" }, "node_modules/wordwrapjs": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", - "dev": true, "dependencies": { "reduce-flatten": "^2.0.0", "typical": "^5.2.0" @@ -7429,7 +6972,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "dev": true, "engines": { "node": ">=8" } @@ -7437,14 +6979,12 @@ "node_modules/workerpool": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", - "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", - "dev": true + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==" }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -7460,14 +7000,12 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", - "dev": true, "engines": { "node": ">=10.0.0" }, @@ -7488,7 +7026,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "engines": { "node": ">=10" } @@ -7497,7 +7034,6 @@ "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -7515,7 +7051,6 @@ "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, "engines": { "node": ">=10" } @@ -7524,7 +7059,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", @@ -7539,7 +7073,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, "engines": { "node": ">=6" } @@ -7548,7 +7081,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, "engines": { "node": ">=10" }, diff --git a/scripts/assignTask.ts b/scripts/assignTask.ts deleted file mode 100644 index af50b11..0000000 --- a/scripts/assignTask.ts +++ /dev/null @@ -1,44 +0,0 @@ -// import { ethers } from "hardhat"; -// import { ProofMarketplace__factory } from "../typechain-types"; - -// import * as fs from "fs"; -// import { checkFileExists } from "../helpers"; - -// async function main(): Promise { -// const chainId = (await ethers.provider.getNetwork()).chainId.toString(); -// console.log("deploying on chain id:", chainId); - -// const signers = await ethers.getSigners(); -// console.log("available signers", signers.length); - -// if (signers.length < 6) { -// throw new Error("Atleast 6 signers are required for deployment"); -// } - -// const path = `./addresses/${chainId}.json`; -// const configPath = `./config/${chainId}.json`; -// const configurationExists = checkFileExists(configPath); - -// if (!configurationExists) { -// throw new Error(`Config doesn't exists for chainId: ${chainId}`); -// } - -// const config = JSON.parse(fs.readFileSync(configPath, "utf-8")); -// let admin = signers[0]; -// let tokenHolder = signers[1]; -// let treasury = signers[2]; -// // let marketCreator = signers[3]; -// // let generator = signers[4]; -// let matchingEngine = signers[5]; - -// const addresses = JSON.parse(fs.readFileSync(path, "utf-8")); -// const proof_market_place = ProofMarketplace__factory.connect(addresses.proxy.proof_market_place, matchingEngine); - -// const askId = 2; -// const generator = "0x01f01074dc5454B15faBf1F1006864D0b71e3f19"; -// const tx = await proof_market_place.connect(matchingEngine).assignTask(askId, generator, "0x"); -// console.log("assignment transaction", (await tx.wait())?.hash); -// return "Done"; -// } - -// main().then(console.log).catch(console.log); diff --git a/scripts/createAsk.ts b/scripts/createAsk.ts deleted file mode 100644 index 77d1de1..0000000 --- a/scripts/createAsk.ts +++ /dev/null @@ -1,105 +0,0 @@ -// import { ethers } from "hardhat"; -// import { checkFileExists, secret_operations } from "../helpers"; -// import { MockToken__factory, ProofMarketplace__factory } from "../typechain-types"; -// import BigNumber from "bignumber.js"; - -// import * as fs from "fs"; - -// import * as input from "../data/transferVerifier/1/public.json"; -// import * as secret from "../data/transferVerifier/1/secret.json"; - -// const matching_engine_publicKey = fs.readFileSync("./data/matching_engine/public_key_2048.pem", "utf-8"); - -// async function main(): Promise { -// const chainId = (await ethers.provider.getNetwork()).chainId.toString(); -// const signers = await ethers.getSigners(); -// console.log("available signers", signers.length); - -// if (signers.length < 6) { -// throw new Error("Atleast 6 signers are required for deployment"); -// } - -// const configPath = `./config/${chainId}.json`; -// const configurationExists = checkFileExists(configPath); -// if (!configurationExists) { -// throw new Error(`Config doesn't exists for chainId: ${chainId}`); -// } - -// const path = `./addresses/${chainId}.json`; -// const addressesExists = checkFileExists(path); - -// if (!addressesExists) { -// throw new Error(`Address file doesn't exists for ChainId: ${chainId}`); -// } - -// const addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - -// const admin = signers[0]; -// const tokenHolder = signers[1]; -// let prover = signers[6]; - -// console.log("using token holder", await tokenHolder.getAddress()); -// console.log("using prover", await prover.getAddress()); -// const eventsToEmit = 20; -// for (let index = 0; index < eventsToEmit; index++) { -// const mockToken = MockToken__factory.connect(addresses.proxy.payment_token, tokenHolder); - -// let abiCoder = new ethers.AbiCoder(); - -// let inputBytes = abiCoder.encode( -// ["uint256[5]"], -// [[input.root, input.nullifier, input.out_commit, input.delta, input.memo]], -// ); - -// const reward = "1200431"; -// let tx = await mockToken.transfer(prover.address, reward); -// console.log("Send mock tokens to prover", (await tx.wait())?.hash); - -// tx = await mockToken.connect(prover).approve(addresses.proxy.proof_market_place, reward); -// console.log("prover allowance to proof marketplace", (await tx.wait())?.hash); - -// const proof_market_place = ProofMarketplace__factory.connect(addresses.proxy.proof_market_place, prover); - -// const platformFee = new BigNumber((await proof_market_place.costPerInputBytes(1)).toString()).multipliedBy( -// (inputBytes.length - 2) / 2, -// ); - -// const staking_token = MockToken__factory.connect(addresses.proxy.staking_token); -// tx = await staking_token.connect(tokenHolder).transfer(await prover.getAddress(), platformFee.toFixed()); -// console.log("send platform tokens to prover", (await tx.wait())?.hash); - -// tx = await staking_token.connect(prover).approve(await proof_market_place.getAddress(), platformFee.toFixed()); -// console.log("prover allowance of platform token to proof marketplace", (await tx.wait())?.hash); - -// const assignmentExpiry = 10000000; -// const latestBlock = await admin.provider.getBlockNumber(); -// const timeTakenForProofGeneration = 10000000; -// const maxTimeForProofGeneration = 10000000; - -// const secretString = JSON.stringify(secret); -// const result = await secret_operations.encryptDataWithEciesAandAES(secretString, matching_engine_publicKey); -// const aclHex = "0x" + result.aclData.toString("hex"); -// const encryptedSecretInputs = "0x" + result.encryptedData; - -// const askId = await proof_market_place.askCounter(); -// tx = await proof_market_place.connect(prover).createAsk( -// { -// marketId: addresses.zkbMarketId, -// proverData: inputBytes, -// reward, -// expiry: latestBlock + assignmentExpiry, -// timeTakenForProofGeneration, -// deadline: latestBlock + maxTimeForProofGeneration, -// refundAddress: await prover.getAddress(), -// }, -// 1, -// encryptedSecretInputs, -// aclHex, -// ); -// const transactionhash = (await tx.wait())?.hash as string; -// console.log(`create new ask ID: ${askId}`, transactionhash); -// } -// return "Emit Tasks"; -// } - -// main().then(console.log).catch(console.log); diff --git a/scripts/createMarket.ts b/scripts/createMarket.ts deleted file mode 100644 index a261ff8..0000000 --- a/scripts/createMarket.ts +++ /dev/null @@ -1,96 +0,0 @@ -// import { ethers } from "hardhat"; -// import * as fs from "fs"; -// import { MarketData, checkFileExists, marketDataToBytes } from "../helpers"; -// import { MockToken__factory, ProofMarketplace__factory } from "../typechain-types"; - -// async function main(): Promise { -// const chainId = (await ethers.provider.getNetwork()).chainId.toString(); -// console.log("deploying on chain id:", chainId); - -// const signers = await ethers.getSigners(); -// console.log("available signers", signers.length); - -// if (signers.length < 6) { -// throw new Error("Atleast 6 signers are required for deployment"); -// } - -// const configPath = `./config/${chainId}.json`; -// const configurationExists = checkFileExists(configPath); - -// if (!configurationExists) { -// throw new Error(`Config doesn't exists for chainId: ${chainId}`); -// } - -// const config = JSON.parse(fs.readFileSync(configPath, "utf-8")); -// let tokenHolder = signers[1]; -// let marketCreator = signers[3]; - -// const path = `./addresses/${chainId}.json`; -// const addressesExists = checkFileExists(path); - -// if (!addressesExists) { -// throw new Error(`Address file doesn't exists for ChainId: ${chainId}`); -// } - -// let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - -// if (!addresses?.proxy?.proof_market_place) { -// throw new Error("Proof Market Place Is Not Deployed"); -// } -// const proof_market_place = ProofMarketplace__factory.connect(addresses.proxy.proof_market_place, marketCreator); - -// if (!addresses?.proxy?.payment_token) { -// throw new Error("payment_token Is Not Deployed"); -// } - -// if (!addresses?.proxy?.zkb_verifier_wrapper) { -// throw new Error("zkb_verifier_wrapper is not deployed"); -// } - -// addresses = JSON.parse(fs.readFileSync(path, "utf-8")); -// if (!addresses.zkbMarketId) { -// const payment_token = MockToken__factory.connect(addresses.proxy.payment_token, tokenHolder); -// await payment_token.connect(tokenHolder).transfer(await marketCreator.getAddress(), config.marketCreationCost); -// await payment_token -// .connect(marketCreator) -// .approve(await proof_market_place.getAddress(), config.marketCreationCost); - -// const marketSetupData: MarketData = { -// zkAppName: "transfer verifier arb sepolia", -// proverCode: "url of the zkbob prover code", -// verifierCode: "url of the verifier zkbob code", -// proverOysterImage: "oyster image link for the zkbob prover", -// setupCeremonyData: ["first phase", "second phase", "third phase"], -// inputOuputVerifierUrl: "http://localhost:3030/", -// }; - -// const marketSetupBytes = marketDataToBytes(marketSetupData); -// const zkbMarketId = await proof_market_place.marketCounter(); - -// const knownPubkey = -// "0x6af9fff439e147a2dfc1e5cf83d63389a74a8cddeb1c18ecc21cb83aca9ed5fa222f055073e4c8c81d3c7a9cf8f2fa2944855b43e6c84ab8e16177d45698c843"; -// let abiCoder = new ethers.AbiCoder(); -// let inputBytes = abiCoder.encode( -// ["bytes", "address", "bytes", "bytes", "bytes", "bytes", "uint256", "uint256"], -// ["0x00", await marketCreator.getAddress(), knownPubkey, "0x00", "0x00", "0x00", "0x00", "0x00"], -// ); - -// const tx = await proof_market_place -// .connect(marketCreator) -// .createMarketplace( -// marketSetupBytes, -// addresses.proxy.transfer_verifier_wrapper, -// config.generatorSlashingPenalty, -// true, -// inputBytes, -// Buffer.from(marketSetupData.inputOuputVerifierUrl, "ascii"), -// ); -// await tx.wait(); -// addresses.zkbMarketId = zkbMarketId.toString(); -// fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); -// } - -// return "Done"; -// } - -// main().then(console.log).catch(console.log); diff --git a/scripts/deploy.ts b/scripts/deploy.ts deleted file mode 100644 index fd93460..0000000 --- a/scripts/deploy.ts +++ /dev/null @@ -1,294 +0,0 @@ -import { ethers, upgrades } from "hardhat"; -import * as fs from "fs"; - -import { - GeneratorRegistry__factory, - InputAndProofFormatRegistry__factory, - MockAttestationVerifier__factory, - MockToken__factory, - PriorityLog__factory, - EntityKeyRegistry__factory, - TransferVerifier__factory, - Transfer_verifier_wrapper__factory, - ZkbVerifier__factory, - AttestationVerifier__factory, - Dispute__factory, -} from "../typechain-types"; -import { checkFileExists, createFileIfNotExists } from "../helpers"; - -import * as transfer_verifier_inputs from "../helpers/sample/transferVerifier/transfer_inputs.json"; -import * as transfer_verifier_proof from "../helpers/sample/transferVerifier/transfer_proof.json"; - -import * as zkb_verifier_inputs from "../helpers/sample/zkbVerifier/transfer_input.json"; -import * as zkb_verifier_proof from "../helpers/sample/zkbVerifier/transfer_proof.json"; - -const abiCoder = new ethers.AbiCoder(); - -async function main(): Promise { - const chainId = (await ethers.provider.getNetwork()).chainId.toString(); - console.log("deploying on chain id:", chainId); - - const signers = await ethers.getSigners(); - console.log("available signers", signers.length); - - if (signers.length < 6) { - throw new Error("Atleast 6 signers are required for deployment"); - } - - const configPath = `./config/${chainId}.json`; - const configurationExists = checkFileExists(configPath); - - if (!configurationExists) { - throw new Error(`Config doesn't exists for chainId: ${chainId}`); - } - - const config = JSON.parse(fs.readFileSync(configPath, "utf-8")); - let admin = signers[0]; - let tokenHolder = signers[1]; - let treasury = signers[2]; - // let marketCreator = signers[3]; - // let generator = signers[4]; - let sampleSigner = signers[5]; - - const path = `./addresses/${chainId}.json`; - createFileIfNotExists(path); - - let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - - if (!addresses.proxy.payment_token) { - const payment_token = await new MockToken__factory(admin).deploy( - await tokenHolder.getAddress(), - config.tokenSupply, - "Payment Token", - "PT", - ); - await payment_token.waitForDeployment(); - addresses.proxy.payment_token = await payment_token.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.staking_token) { - const staking_token = await new MockToken__factory(admin).deploy( - await tokenHolder.getAddress(), - config.tokenSupply, - "Staking Token", - "ST", - ); - await staking_token.waitForDeployment(); - addresses.proxy.staking_token = await staking_token.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.mock_attestation_verifier) { - const mock_attestation_verifier = await new MockAttestationVerifier__factory(admin).deploy(); - await mock_attestation_verifier.waitForDeployment(); - - addresses.proxy.mock_attestation_verifier = await mock_attestation_verifier.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.attestation_verifier) { - const attestationVerifierFactory = await ethers.getContractFactory("AttestationVerifier"); - const attestationVerifierProxy = await upgrades.deployProxy(attestationVerifierFactory, [], { - kind: "uups", - constructorArgs: [], - initializer: false, - }); - await attestationVerifierProxy.waitForDeployment(); - - addresses.proxy.attestation_verifier = await attestationVerifierProxy.getAddress(); - addresses.implementation.attestation_verifier = await upgrades.erc1967.getImplementationAddress(addresses.proxy.attestation_verifier); - const attestation_verifier = AttestationVerifier__factory.connect(addresses.proxy.attestation_verifier, admin); - const tx = await attestation_verifier.initialize( - [ - { - PCR0: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - PCR1: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002", - PCR2: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003", - }, - ], - ["0x0000000000000000000000000000000000000001"], - await admin.getAddress(), - ); - await tx.wait(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.entity_registry) { - const EntityKeyRegistryContract = await ethers.getContractFactory("EntityKeyRegistry"); - const _entityKeyRegistry = await upgrades.deployProxy(EntityKeyRegistryContract, [await admin.getAddress(), []], { - kind: "uups", - constructorArgs: [addresses.proxy.attestation_verifier], - }); - await _entityKeyRegistry.waitForDeployment(); - const entity_registry = EntityKeyRegistry__factory.connect(await _entityKeyRegistry.getAddress(), admin); - - addresses.proxy.entity_registry = await entity_registry.getAddress(); - addresses.implementation.entity_registry = await upgrades.erc1967.getImplementationAddress(addresses.proxy.entity_registry); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.generator_registry) { - const generator_registryContract = await ethers.getContractFactory("GeneratorRegistry"); - const generatorProxy = await upgrades.deployProxy(generator_registryContract, [], { - kind: "uups", - constructorArgs: [addresses.proxy.staking_token, addresses.proxy.entity_registry], - initializer: false, - }); - - await generatorProxy.waitForDeployment(); - - addresses.proxy.generator_registry = await generatorProxy.getAddress(); - addresses.implementation.generator_registry = await upgrades.erc1967.getImplementationAddress(addresses.proxy.generator_registry); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - - const entityRegistry = EntityKeyRegistry__factory.connect(addresses.proxy.entity_registry, admin); - const roleToGive = await entityRegistry.KEY_REGISTER_ROLE(); - let tx = await entityRegistry.grantRole(roleToGive, addresses.proxy.generator_registry); - tx.wait(); - } - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - - if (!addresses.proxy.dispute) { - const dispute = await new Dispute__factory(admin).deploy(addresses.proxy.entity_registry); - await dispute.waitForDeployment(); - addresses.proxy.dispute = await dispute.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.proof_market_place) { - const proof_market_place = await ethers.getContractFactory("ProofMarketplace"); - const proxy = await upgrades.deployProxy(proof_market_place, [await admin.getAddress()], { - kind: "uups", - constructorArgs: [ - addresses.proxy.payment_token, - config.marketCreationCost, - await treasury.getAddress(), - addresses.proxy.generator_registry, - addresses.proxy.entity_registry, - ], - }); - await proxy.waitForDeployment(); - - addresses.proxy.proof_market_place = await proxy.getAddress(); - addresses.implementation.proof_market_place = await upgrades.erc1967.getImplementationAddress(addresses.proxy.proof_market_place); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - - const entityRegistry = EntityKeyRegistry__factory.connect(addresses.proxy.entity_registry, admin); - const roleToGive = await entityRegistry.KEY_REGISTER_ROLE(); - let tx = await entityRegistry.grantRole(roleToGive, addresses.proxy.proof_market_place); - tx.wait(); - - const generator_registry = GeneratorRegistry__factory.connect(addresses.proxy.generator_registry, admin); - tx = await generator_registry.initialize(await admin.getAddress(), addresses.proxy.proof_market_place); - await tx.wait(); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.transfer_verifier_wrapper) { - const TransferVerifer = await new TransferVerifier__factory(admin).deploy(); - await TransferVerifer.waitForDeployment(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - - let proofBytes = abiCoder.encode( - ["uint256[8]"], - [ - [ - transfer_verifier_proof.a[0], - transfer_verifier_proof.a[1], - transfer_verifier_proof.b[0][0], - transfer_verifier_proof.b[0][1], - transfer_verifier_proof.b[1][0], - transfer_verifier_proof.b[1][1], - transfer_verifier_proof.c[0], - transfer_verifier_proof.c[1], - ], - ], - ); - - const transfer_verifier_wrapper = await new Transfer_verifier_wrapper__factory(admin).deploy( - await TransferVerifer.getAddress(), - inputBytes, - proofBytes, - ); - await transfer_verifier_wrapper.waitForDeployment(); - addresses.proxy.transfer_verifier_wrapper = await transfer_verifier_wrapper.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.zkb_verifier_wrapper) { - const ZkbVerifier = await new ZkbVerifier__factory(admin).deploy(); - await ZkbVerifier.waitForDeployment(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [[zkb_verifier_inputs[0], zkb_verifier_inputs[1], zkb_verifier_inputs[2], zkb_verifier_inputs[3], zkb_verifier_inputs[4]]], - ); - - let proofBytes = abiCoder.encode( - ["uint256[8]"], - [ - [ - zkb_verifier_proof.a[0], - zkb_verifier_proof.a[1], - zkb_verifier_proof.b[0][0], - zkb_verifier_proof.b[0][1], - zkb_verifier_proof.b[1][0], - zkb_verifier_proof.b[1][1], - zkb_verifier_proof.c[0], - zkb_verifier_proof.c[1], - ], - ], - ); - - const zkb_verifier_wrapper = await new Transfer_verifier_wrapper__factory(admin).deploy( - await ZkbVerifier.getAddress(), - inputBytes, - proofBytes, - ); - await zkb_verifier_wrapper.waitForDeployment(); - addresses.proxy.zkb_verifier_wrapper = await zkb_verifier_wrapper.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.priority_list) { - const priority_list = await new PriorityLog__factory(admin).deploy(); - await priority_list.waitForDeployment(); - addresses.proxy.priority_list = await priority_list.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.input_and_proof_format) { - const input_and_proof_format = await new InputAndProofFormatRegistry__factory(admin).deploy(await admin.getAddress()); - await input_and_proof_format.waitForDeployment(); - - addresses.proxy.input_and_proof_format = await input_and_proof_format.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - - addresses = JSON.parse(fs.readFileSync(path, "utf-8")); // for next steps - return "done"; -} - -main().then(console.log).catch(console.log); diff --git a/scripts/deployMockVerifier.ts b/scripts/deployMockVerifier.ts deleted file mode 100644 index 15190d9..0000000 --- a/scripts/deployMockVerifier.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { ethers } from "hardhat"; -import * as fs from "fs"; - -import { MockVerifier__factory } from "../typechain-types"; -import { checkFileExists } from "../helpers"; - -async function main(): Promise { - const chainId = (await ethers.provider.getNetwork()).chainId.toString(); - console.log("deploying on chain id:", chainId); - - const signers = await ethers.getSigners(); - console.log("available signers", signers.length); - - if (signers.length < 6) { - throw new Error("Atleast 6 signers are required for deployment"); - } - - const configPath = `./config/${chainId}.json`; - const configurationExists = checkFileExists(configPath); - - if (!configurationExists) { - throw new Error(`Config doesn't exists for chainId: ${chainId}`); - } - - let admin = signers[0]; - - const path = `./addresses/${chainId}.json`; - - let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.mockVerifier) { - const mockVerifier = await new MockVerifier__factory(admin).deploy(); - await mockVerifier.waitForDeployment(); - addresses.proxy.mock_verifier = await mockVerifier.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - return "Added mockVerifier Deployer"; -} - -main().then(console.log).catch(console.log); diff --git a/scripts/deployTeeVerifier.ts b/scripts/deployTeeVerifier.ts deleted file mode 100644 index a32b863..0000000 --- a/scripts/deployTeeVerifier.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { ethers } from "hardhat"; -import * as fs from "fs"; - -import { Tee_verifier_wrapper_factory__factory } from "../typechain-types"; -import { checkFileExists } from "../helpers"; - -async function main(): Promise { - const chainId = (await ethers.provider.getNetwork()).chainId.toString(); - console.log("deploying on chain id:", chainId); - - const signers = await ethers.getSigners(); - console.log("available signers", signers.length); - - if (signers.length < 6) { - throw new Error("Atleast 6 signers are required for deployment"); - } - - const configPath = `./config/${chainId}.json`; - const configurationExists = checkFileExists(configPath); - - if (!configurationExists) { - throw new Error(`Config doesn't exists for chainId: ${chainId}`); - } - - let admin = signers[0]; - - const path = `./addresses/${chainId}.json`; - - let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.tee_verifier_deployer) { - const TeeVerifierCreator = await new Tee_verifier_wrapper_factory__factory(admin).deploy(); - await TeeVerifierCreator.waitForDeployment(); - addresses.proxy.tee_verifier_deployer = await TeeVerifierCreator.getAddress(); - fs.writeFileSync(path, JSON.stringify(addresses, null, 4), "utf-8"); - } - return "Added Tee Verifier Deployer"; -} - -main().then(console.log).catch(console.log); diff --git a/scripts/distributeEth.ts b/scripts/distributeEth.ts deleted file mode 100644 index 69294ef..0000000 --- a/scripts/distributeEth.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ethers } from "hardhat"; - -async function main(): Promise { - const signers = await ethers.getSigners(); - for (let index = 1; index < signers.length; index++) { - const element = signers[index]; - const tx = await signers[0].sendTransaction({ to: element.address, value: "10000000000000000" }); - const receipt = await tx.wait(); - console.log("receipt", receipt?.hash); - } - return "Done"; -} - -// async function main(): Promise { -// let address = "0xCc9F0defA87Ecba1dFb6D7C9103F01fEAF547dba"; -// const signers = await ethers.getSigners(); - -// const tx = await signers[0].sendTransaction({ to: address, value: "1500000000000000000" }); -// const receipt = await tx.wait(); -// console.log("receipt", receipt?.hash); -// return "Done"; -// } - -main().then(console.log).catch(console.log); diff --git a/scripts/emitTasks.ts b/scripts/emitTasks.ts deleted file mode 100644 index 12f8523..0000000 --- a/scripts/emitTasks.ts +++ /dev/null @@ -1,227 +0,0 @@ -// import { ethers } from "hardhat"; -// import { gzip, ungzip } from "node-gzip"; -// import { randomBytes } from "crypto"; -// import { -// bytesToHexString, -// checkFileExists, -// generateRandomBytes, -// generatorDataToBytes, -// jsonToBytes, -// secret_operations, -// splitHexString, -// utf8ToHex, -// } from "../helpers"; -// import { -// GeneratorRegistry__factory, -// MockToken__factory, -// ProofMarketplace__factory, -// EntityKeyRegistry__factory, -// } from "../typechain-types"; - -// import BigNumber from "bignumber.js"; - -// import * as fs from "fs"; - -// import * as input from "../data/transferVerifier/1/public.json"; -// import * as secret from "../data/transferVerifier/1/secret.json"; -// import { BytesLike } from "ethers"; - -// const matching_engine_publicKey = fs.readFileSync("./data/matching_engine/public_key_2048.pem", "utf-8"); -// const matching_engine_privatekey = fs.readFileSync("./data/matching_engine/private_key_2048.pem", "utf-8"); - -// const generator_publickey = fs.readFileSync("./data/demo_generator/public_key.pem", "utf-8"); -// const generator_privatekey = fs.readFileSync("./data/demo_generator/private_key.pem", "utf-8"); - -// async function main(): Promise { -// const chainId = (await ethers.provider.getNetwork()).chainId.toString(); -// const signers = await ethers.getSigners(); -// console.log("available signers", signers.length); - -// if (signers.length < 6) { -// throw new Error("Atleast 6 signers are required for deployment"); -// } - -// const configPath = `./config/${chainId}.json`; -// const configurationExists = checkFileExists(configPath); -// if (!configurationExists) { -// throw new Error(`Config doesn't exists for chainId: ${chainId}`); -// } -// const config = JSON.parse(fs.readFileSync(configPath, "utf-8")); - -// const path = `./addresses/${chainId}.json`; -// const addressesExists = checkFileExists(path); - -// if (!addressesExists) { -// throw new Error(`Address file doesn't exists for ChainId: ${chainId}`); -// } - -// const addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - -// const admin = signers[0]; -// const tokenHolder = signers[1]; -// // let treasury = signers[2]; -// // let marketCreator = signers[3]; -// let generator = signers[4]; -// let matchingEngine = signers[5]; -// let prover = signers[6]; - -// const eventsToEmit = 1; -// for (let index = 0; index < eventsToEmit; index++) { -// const id = randomBytes(32).toString("hex"); -// const privateKey = "0x" + id; -// console.log("SAVE BUT DO NOT SHARE THIS:", privateKey); - -// var wallet = new ethers.Wallet(privateKey, admin.provider); -// console.log("Address: " + wallet.address); - -// let tx = await admin.sendTransaction({ to: wallet.address, value: "5000000000000000" }); -// console.log("send dust ether to newly created wallet", (await tx.wait())?.hash); - -// const mockToken = MockToken__factory.connect(addresses.proxy.mockToken, tokenHolder); -// tx = await mockToken.connect(tokenHolder).transfer(wallet.address, config.generatorStakingAmount); -// console.log("send mock tokens to newly created wallet", (await tx.wait())?.hash); - -// console.log("start registering", index); -// tx = await mockToken.connect(wallet).approve(addresses.proxy.generator_registry, config.generatorStakingAmount); -// console.log("complete approval", (await tx.wait())?.hash); - -// const today = new Date(); -// const generatorData = { -// name: `Generator Index ${today.toDateString()} - ${index}`, -// time: 10000, -// generatorOysterPubKey: "0x" + bytesToHexString(await generateRandomBytes(64)), -// computeAllocation: 100, -// }; - -// const geneatorDataString = generatorDataToBytes(generatorData); -// const generator_registry = GeneratorRegistry__factory.connect(addresses.proxy.generator_registry, admin); -// tx = await generator_registry.connect(wallet).register(await wallet.getAddress(), 100, geneatorDataString); -// await tx.wait(); -// tx = await generator_registry.connect(wallet).stake(await wallet.getAddress(), config.generatorStakingAmount); -// await tx.wait(); -// tx = await generator_registry.connect(wallet).joinMarketplace( -// addresses.zkbMarketId, -// new BigNumber(10) -// .pow(19) -// .multipliedBy(index + 1) -// .toFixed(), -// 1000, -// index + 1, -// ); - -// // console.log({estimate: estimate.toString(), bal: await ethers.provider.getBalance(wallet.address)}) -// console.log("generator registration transaction", (await tx.wait())?.hash); - -// const entity_registry = EntityKeyRegistry__factory.connect(addresses.proxy.entity_registry, wallet); -// const pubBytes = utf8ToHex(generator_publickey); -// tx = await entity_registry.updatePubkey(await generator.getAddress(), "0x" + pubBytes, "0x"); -// console.log("generator broadcast pubkey transaction", (await tx.wait())?.hash); - -// let abiCoder = new ethers.AbiCoder(); - -// let inputBytes = abiCoder.encode( -// ["uint256[5]"], -// [[input.root, input.nullifier, input.out_commit, input.delta, input.memo]], -// ); - -// const reward = "1000001"; -// tx = await mockToken.transfer(prover.address, reward); -// console.log("Send mock tokens to prover", (await tx.wait())?.hash); - -// tx = await mockToken.connect(prover).approve(addresses.proxy.proof_market_place, reward); -// console.log("prover allowance to proof marketplace", (await tx.wait())?.hash); - -// const proof_market_place = ProofMarketplace__factory.connect(addresses.proxy.proof_market_place, prover); - -// const platformFee = new BigNumber((await proof_market_place.costPerInputBytes(1)).toString()).multipliedBy( -// (inputBytes.length - 2) / 2, -// ); - -// const platformToken = MockToken__factory.connect(addresses.proxy.platformToken); -// tx = await platformToken.connect(tokenHolder).transfer(await prover.getAddress(), platformFee.toFixed()); -// console.log("prover allowance of platform token to proof marketplace", (await tx.wait())?.hash); - -// tx = await platformToken.connect(prover).approve(await proof_market_place.getAddress(), platformFee.toFixed()); -// console.log("prover allowance of platform token to proof marketplace", (await tx.wait())?.hash); - -// const assignmentExpiry = 10000000; -// const latestBlock = await admin.provider.getBlockNumber(); -// const timeTakenForProofGeneration = 10000000; -// const maxTimeForProofGeneration = 10000000; - -// const secretString = JSON.stringify(secret); -// const result = await secret_operations.encryptDataWithEciesAandAES(secretString, matching_engine_publicKey); -// const aclHex = "0x" + secret_operations.base64ToHex(result.aclData.toString("hex")); -// const encryptedSecretInputs = "0x" + result.encryptedData; -// const secretCompressed = await gzip(encryptedSecretInputs); - -// const askId = await proof_market_place.askCounter(); -// tx = await proof_market_place.connect(prover).createAsk( -// { -// marketId: addresses.zkbMarketId, -// proverData: inputBytes, -// reward, -// expiry: latestBlock + assignmentExpiry, -// timeTakenForProofGeneration, -// deadline: latestBlock + maxTimeForProofGeneration, -// refundAddress: await prover.getAddress(), -// }, -// 1, -// secretCompressed, -// aclHex, -// ); -// const transactionhash = (await tx.wait())?.hash as string; -// console.log(`create new ask ID: ${askId}`, transactionhash); - -// const transaction = await admin.provider.getTransaction(transactionhash); -// const decodedData = proof_market_place.interface.decodeFunctionData("createAsk", transaction?.data as BytesLike); -// const secretDataComp = decodedData[decodedData.length - 2].toString(); -// const buffer_decoded = Buffer.from(secretDataComp.split("x")[1], "hex"); -// const recovered_secret = await ungzip(buffer_decoded); -// const secretData = recovered_secret.toString(); -// const aclData = decodedData[decodedData.length - 1]; - -// const decryptedData = await secret_operations.decryptDataWithEciesandAES( -// secretData.split("x")[1], -// aclData.split("x")[1], -// matching_engine_privatekey, -// ); - -// console.log("************** data seen by matching engine (start) *************"); -// console.log(JSON.parse(decryptedData)); -// console.log("************** data seen by matching engine (end) *************"); - -// const cipher = await secret_operations.decryptEcies(matching_engine_privatekey, aclData.split("x")[1]); -// const new_acl_hex = "0x" + (await secret_operations.encryptECIES(generator_publickey, cipher)).toString("hex"); - -// const taskId = await proof_market_place.taskCounter(); -// tx = await proof_market_place -// .connect(matchingEngine) -// .assignTask(askId.toString(), taskId, wallet.address, new_acl_hex); -// const assignTxHash = (await tx.wait())?.hash; -// console.log(`Created Task taskId ${taskId}`, assignTxHash); - -// const assignTransaction = await admin.provider.getTransaction(assignTxHash as string); -// const generatorDecodedData = proof_market_place.interface.decodeFunctionData( -// "assignTask", -// assignTransaction?.data as BytesLike, -// ); -// const generator_acl = generatorDecodedData[generatorDecodedData.length - 1]; - -// const decryptedDataForGenerator = await secret_operations.decryptDataWithEciesandAES( -// secretData.split("x")[1], -// generator_acl.split("x")[1], -// generator_privatekey, -// ); - -// console.log("************** data seen by generator (start) *************"); -// console.log(JSON.parse(decryptedDataForGenerator)); -// console.log("************** data seen by generator (end) *************"); -// // let proofBytes = abiCoder.encode(["bytes"], [plonkProof]); -// // tx = await proof_market_place.connect(admin).submitProof(taskId, proofBytes); -// // console.log("Proof Submitted", (await tx.wait())?.hash, "index", index); -// } -// return "Emit Tasks"; -// } - -// main().then(console.log).catch(console.log); diff --git a/scripts/foundry/DeployArbitrumSepolia.s.sol b/scripts/foundry/DeployArbitrumSepolia.s.sol deleted file mode 100644 index 5391f55..0000000 --- a/scripts/foundry/DeployArbitrumSepolia.s.sol +++ /dev/null @@ -1,263 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.26; - -/* Foundry */ -import {Script} from "forge-std/Script.sol"; -import {console} from "forge-std/Test.sol"; - -/* Contracts */ -import {USDC} from "./mocks/USDC.sol"; -import {POND} from "./mocks/POND.sol"; -import {WETH} from "./mocks/WETH.sol"; - -import {AttestationVerifier} from "../../contracts/periphery/AttestationVerifier.sol"; -import {ProofMarketplace} from "../../contracts/ProofMarketplace.sol"; -import {EntityKeyRegistry} from "../../contracts/EntityKeyRegistry.sol"; -import {GeneratorRegistry} from "../../contracts/GeneratorRegistry.sol"; -import {StakingManager} from "../../contracts/staking/l2_contracts/StakingManager.sol"; -import {NativeStaking} from "../../contracts/staking/l2_contracts/NativeStaking.sol"; -import {SymbioticStaking} from "../../contracts/staking/l2_contracts/SymbioticStaking.sol"; -import {SymbioticStakingReward} from "../../contracts/staking/l2_contracts/SymbioticStakingReward.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; - -/* Interfaces */ -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - -contract DeployArbitrumSepolia is Script { - uint256 public constant INFLATION_REWARD_EPOCH_SIZE = 1 hours; // 60*60 seconds - uint256 public constant INFLATION_REWARD_PER_EPOCH = 100 ether; // 100 POND - uint256 public constant SUBMISSION_COOLDOWN = 5 minutes; // snapshot submission cooldown delay - address public constant ATTESTATION_VERIFIER = 0x63EEf1576b477Aa60Bfd7300B2C85b887639Ac1b; - - uint256 constant public FIFTEEN_PERCENT = 15; - uint256 constant public TWENTY_PERCENT = 20; - uint256 constant public THIRTY_PERCENT = 30; - uint256 constant public FORTY_PERCENT = 40; - uint256 constant public FIFTY_PERCENT = 50; - uint256 constant public SIXTY_PERCENT = 60; - uint256 constant public HUNDRED_PERCENT = 100; - - uint256 admin_key = vm.envUint("ARBITRUM_SEPOLIA_ADMIN_KEY"); - - /* Tokens */ - address usdc; - address pond; - address weth; - - /* Contract Implementations */ - // address attestationVerifierImpl; - address proofMarketplaceImpl; - address entityKeyRegistryImpl; - address generatorRegistryImpl; - address stakingManagerImpl; - address nativeStakingImpl; - address symbioticStakingImpl; - address symbioticStakingRewardImpl; - - /* Proxies */ - // address attestationVerifier; - address proofMarketplace; - address entityKeyRegistry; - address generatorRegistry; - address stakingManager; - address nativeStaking; - address symbioticStaking; - address symbioticStakingReward; - - // TODO: config for each contracts - function run() public { - address admin = 0x7C046645E21B811780Cf420021E6701A9E66935C; - /* God Enclave PCRS */ - // AttestationVerifier.EnclaveImage[] memory GOD_ENCLAVE = new AttestationVerifier.EnclaveImage[](1); - // GOD_ENCLAVE[0] = AttestationVerifier.EnclaveImage({ - // PCR0: bytes(hex"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000065"), - // PCR1: bytes(hex"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036"), - // PCR2: bytes(hex"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000093") - // }); - - // bytes[] memory GOD_ENCLAVE_KEYS = new bytes[](1); - // GOD_ENCLAVE_KEYS[0] = bytes(hex"6bf5eaebfb44393f4b39351e8dd7bf49e2adfe0c6b639126783132b871bf164d049b27ad2d0ba4206a0e82be1c4bdfe38f853a99b13361cf7b42b68a4dd4530f"); - - - - - vm.startBroadcast(admin_key); - - /* deploy tokens */ - usdc = address(new USDC(admin)); - pond = address(new POND(admin)); - weth = address(new WETH(admin)); - - address feeToken = usdc; - // address inflationRewardToken = pond; - - /* Impls */ - stakingManagerImpl = address(new StakingManager()); - nativeStakingImpl = address(new NativeStaking()); - symbioticStakingImpl = address(new SymbioticStaking()); - symbioticStakingRewardImpl = address(new SymbioticStakingReward()); - - /* Proxies */ - stakingManager = address(new ERC1967Proxy(stakingManagerImpl, "")); - nativeStaking = address(new ERC1967Proxy(nativeStakingImpl, "")); - symbioticStaking = address(new ERC1967Proxy(symbioticStakingImpl, "")); - symbioticStakingReward = address(new ERC1967Proxy(symbioticStakingRewardImpl, "")); - - // AttestationVerifier - // attestationVerifierImpl = address(new AttestationVerifier()); - // attestationVerifier = address(new ERC1967Proxy(attestationVerifierImpl, "")); - - // EntityKeyRegistry - entityKeyRegistryImpl = address(new EntityKeyRegistry(AttestationVerifier(ATTESTATION_VERIFIER))); - entityKeyRegistry = address(new ERC1967Proxy(entityKeyRegistryImpl, "")); - - // GeneratorRegistry - generatorRegistryImpl = address(new GeneratorRegistry(EntityKeyRegistry(entityKeyRegistry))); - generatorRegistry = address(new ERC1967Proxy(generatorRegistryImpl, "")); - - // ProofMarketplace - proofMarketplaceImpl = address( - new ProofMarketplace( - IERC20(usdc), - 100 ether, - admin, - GeneratorRegistry(generatorRegistry), - EntityKeyRegistry(entityKeyRegistry) - ) - ); - proofMarketplace = address(new ERC1967Proxy(proofMarketplaceImpl, "")); - - /* initialize */ - - // ProofMarketplace - ProofMarketplace(address(proofMarketplace)).initialize(admin); - - // ATTESTATION_VERIFIER - // AttestationVerifier(address(attestationVerifier)).initialize(GOD_ENCLAVE, GOD_ENCLAVE_KEYS, admin); - - // EntityKeyRegistry - EntityKeyRegistry.EnclaveImage[] memory initWhitelistImages; - EntityKeyRegistry(address(entityKeyRegistry)).initialize(admin, initWhitelistImages); - - // GeneratorRegistry - GeneratorRegistry(address(generatorRegistry)).initialize(admin, proofMarketplace, stakingManager); - - // StakingManager - StakingManager(address(stakingManager)).initialize( - admin, address(proofMarketplace), address(symbioticStaking), address(feeToken) - ); - - // NativeStaking - NativeStaking(address(nativeStaking)).initialize( - admin, - address(stakingManager), - 2 days, // withdrawalDuration - address(feeToken) - ); - - // SymbioticStaking - SymbioticStaking(address(symbioticStaking)).initialize( - admin, address(proofMarketplace), address(symbioticStaking), address(symbioticStakingReward), feeToken - ); - - // SymbioticStakingReward - SymbioticStakingReward(address(symbioticStakingReward)).initialize( - admin, address(proofMarketplace), address(symbioticStaking), feeToken - ); - - // Grant `GENERATOR_REGISTRY_ROLE` to StakingManager - StakingManager(address(stakingManager)).grantRole( - StakingManager(address(stakingManager)).GENERATOR_REGISTRY_ROLE(), address(generatorRegistry) - ); - - // Grant `KEY_REGISTER_ROLE` to GeneratorRegistry, ProofMarketplace - bytes32 register_role = EntityKeyRegistry(address(entityKeyRegistry)).KEY_REGISTER_ROLE(); - EntityKeyRegistry(address(entityKeyRegistry)).grantRole(register_role, address(generatorRegistry)); - EntityKeyRegistry(address(entityKeyRegistry)).grantRole(register_role, address(proofMarketplace)); - - // Grant `UPDATER_ROLE` to admin - ProofMarketplace(address(proofMarketplace)).grantRole(ProofMarketplace(address(proofMarketplace)).UPDATER_ROLE(), admin); - - - /*==================== Config & Setup ====================*/ - - /*-------------------------------- StakingManager Config --------------------------------*/ - // Add NativeStaking, SymbioticStaking - StakingManager(stakingManager).addStakingPool(nativeStaking); - StakingManager(stakingManager).addStakingPool(symbioticStaking); - - // Set reward shares - address[] memory pools = new address[](2); - pools[0] = nativeStaking; - pools[1] = symbioticStaking; - uint256[] memory shares = new uint256[](2); - shares[0] = 0; - shares[1] = _calculatePercent(HUNDRED_PERCENT); - StakingManager(stakingManager).setPoolRewardShare(pools, shares); - - // Enable pools - StakingManager(stakingManager).setEnabledPool(nativeStaking, true); - StakingManager(stakingManager).setEnabledPool(symbioticStaking, true); - - /*-------------------------------- NativeStaking Config --------------------------------*/ - NativeStaking(nativeStaking).addStakeToken(pond, _calculatePercent(HUNDRED_PERCENT)); - NativeStaking(nativeStaking).setAmountToLock(pond, 1 ether); - console.log("Native Staking: AmountToLock per job: 1 POND"); - console.log(""); - - /*-------------------------------- SymbioticStaking Config --------------------------------*/ - SymbioticStaking(symbioticStaking).addStakeToken(pond, _calculatePercent(SIXTY_PERCENT)); - console.log("Symbiotic Staking: POND selection weight: 60%"); - SymbioticStaking(symbioticStaking).addStakeToken(weth, _calculatePercent(FORTY_PERCENT)); - console.log("Symbiotic Staking: WETH selection weight: 40%"); - /* amount to lock */ - SymbioticStaking(symbioticStaking).setAmountToLock(pond, 2 ether); - console.log("Symbiotic Staking: POND amount to lock (per job): 2 POND"); - SymbioticStaking(symbioticStaking).setAmountToLock(weth, 2 ether); - console.log("Symbiotic Staking: WETH amount to lock (per job): 2 WETH"); - SymbioticStaking(symbioticStaking).setBaseTransmitterComissionRate(_calculatePercent(TWENTY_PERCENT)); - console.log("Symbiotic Staking: Base Transmitter Comission Rate: 20%"); - SymbioticStaking(symbioticStaking).setSubmissionCooldown(SUBMISSION_COOLDOWN); - console.log("Symbiotic Staking: Submission Cooldown: 5 minutes"); - console.log(""); - - vm.stopBroadcast(); - - console.log("admin: \t\t\t", admin); - console.log("ATTESTATION_VERIFIER: \t", ATTESTATION_VERIFIER); - console.log(""); - - console.log("< Impls Deployed >\n"); - // console.log("attestationVerifierImpl: \t", address(attestationVerifierImpl)); - console.log("entityKeyRegistryImpl: \t", address(entityKeyRegistryImpl)); - console.log("generatorRegistryImpl: \t", address(generatorRegistryImpl)); - console.log("stakingManagerImpl: \t\t", address(stakingManagerImpl)); - console.log("nativeStakingImpl: \t\t", address(nativeStakingImpl)); - console.log("symbioticStakingImpl: \t", address(symbioticStakingImpl)); - console.log("symbioticStakingRewardImpl: \t", address(symbioticStakingRewardImpl)); - console.log(""); - - console.log("< Proxies Deployed >\n"); - - console.log("proofMarketplace: \t\t", address(proofMarketplace)); - // console.log("attestationVerifier: \t\t", address(attestationVerifier)); - console.log("entityKeyRegistry: \t\t", address(entityKeyRegistry)); - console.log("generatorRegistry: \t\t", address(generatorRegistry)); - console.log("stakingManager: \t\t", address(stakingManager)); - console.log("nativeStaking: \t\t", address(nativeStaking)); - console.log("symbioticStaking: \t\t", address(symbioticStaking)); - console.log("symbioticStakingReward: \t", address(symbioticStakingReward)); - console.log(""); - - console.log("< Tokens >\n"); - - console.log("USDC (feeToken): \t\t", usdc); - console.log("POND: \t\t\t", pond); - console.log("WETH: \t\t\t", weth); - } - - function _calculatePercent(uint256 percent) internal pure returns (uint256) { - return Math.mulDiv(percent, 1e18, 100); - } -} diff --git a/scripts/foundry/mocks/POND.sol b/scripts/foundry/mocks/POND.sol deleted file mode 100644 index ad0b9ec..0000000 --- a/scripts/foundry/mocks/POND.sol +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.26; - -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract POND is ERC20 { - - address public owner; - - uint256 constant INITIAL_SUPPLY = 100_000_000e18; - - constructor(address admin) ERC20("POND", "POND") { - _mint(admin, INITIAL_SUPPLY); - owner = admin; - } - - function mint(address to, uint256 amount) public { - require(msg.sender == owner, "Only owner can mint"); - - _mint(to, amount); - } -} diff --git a/scripts/foundry/mocks/USDC.sol b/scripts/foundry/mocks/USDC.sol deleted file mode 100644 index 7e0a297..0000000 --- a/scripts/foundry/mocks/USDC.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.26; - -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract USDC is ERC20 { - - uint256 constant INITIAL_SUPPLY = 100_000_000e6; - - address public owner; - - constructor(address admin) ERC20("USDC", "USDC") { - _mint(admin, INITIAL_SUPPLY); - } - - function decimals() public pure override returns (uint8) { - return 6; - } - - function mint(address to, uint256 amount) public { - _mint(to, amount); - } -} diff --git a/scripts/foundry/mocks/WETH.sol b/scripts/foundry/mocks/WETH.sol deleted file mode 100644 index 1605bea..0000000 --- a/scripts/foundry/mocks/WETH.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.26; - -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract WETH is ERC20 { - - uint256 constant INITIAL_SUPPLY = 100_000_000e18; - - address public owner; - - constructor(address admin) ERC20("WETH", "WETH") { - _mint(admin, INITIAL_SUPPLY); - } - - function mint(address to, uint256 amount) public { - _mint(to, amount); - } -} diff --git a/scripts/readMarketData.ts b/scripts/readMarketData.ts deleted file mode 100644 index c9dfb36..0000000 --- a/scripts/readMarketData.ts +++ /dev/null @@ -1,38 +0,0 @@ -// import { ethers } from "hardhat"; -// import { checkFileExists, hexStringToMarketData } from "../helpers"; - -// import * as fs from "fs"; -// import { ProofMarketplace__factory } from "../typechain-types"; - -// async function main(): Promise { -// const chainId = (await ethers.provider.getNetwork()).chainId.toString(); -// console.log("deploying on chain id:", chainId); - -// const path = `./addresses/${chainId}.json`; -// const addressesExists = checkFileExists(path); - -// if (!addressesExists) { -// throw new Error(`Address file doesn't exists for ChainId: ${chainId}`); -// } - -// let signers = await ethers.getSigners(); -// let admin = signers[0]; - -// let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - -// const proof_market_place = ProofMarketplace__factory.connect(addresses.proxy.proof_market_place, admin); - -// const marketIdsToRead = [addresses.zkbMarketId]; - -// for (let index = 0; index < marketIdsToRead.length; index++) { -// const marketId = marketIdsToRead[index]; -// const marketDataBytes = (await proof_market_place.marketData(marketId)).marketmetadata; -// const marketData = hexStringToMarketData(marketDataBytes); -// console.log("******* start market data *******"); -// console.log(marketData); -// console.log("******* end market data *******"); -// } -// return "Done"; -// } - -// main().then(console.log).catch(console.log); diff --git a/scripts/registerGenerator.ts b/scripts/registerGenerator.ts deleted file mode 100644 index 992d97e..0000000 --- a/scripts/registerGenerator.ts +++ /dev/null @@ -1,106 +0,0 @@ -// import { ethers } from "hardhat"; -// import * as fs from "fs"; -// import { bytesToHexString, checkFileExists, generateRandomBytes, generatorDataToBytes } from "../helpers"; -// import { GeneratorRegistry__factory, MockToken__factory } from "../typechain-types"; -// import BigNumber from "bignumber.js"; - -// // Add priv of generator in array. These generators will be registers on market place -// const generatorPrivKeys: string[] = []; - -// async function main(): Promise { -// const chainId = (await ethers.provider.getNetwork()).chainId.toString(); -// console.log("transacting on chain id:", chainId); - -// const signers = await ethers.getSigners(); -// console.log("available signers", signers.length); - -// if (signers.length < 6) { -// throw new Error("Atleast 6 signers are required for deployment"); -// } - -// const configPath = `./config/${chainId}.json`; -// const configurationExists = checkFileExists(configPath); - -// if (!configurationExists) { -// throw new Error(`Config doesn't exists for chainId: ${chainId}`); -// } - -// const config = JSON.parse(fs.readFileSync(configPath, "utf-8")); -// let admin = signers[0]; -// let tokenHolder = signers[1]; -// // let treasury = signers[2]; -// // let marketCreator = signers[3]; -// // let generator = signers[4]; -// // let matchingEngine = signers[5]; - -// const generators = generatorPrivKeys.map((a) => new ethers.Wallet(a, admin.provider)); - -// const path = `./addresses/${chainId}.json`; -// const addressesExists = checkFileExists(path); - -// if (!addressesExists) { -// throw new Error(`Address file doesn't exists for ChainId: ${chainId}`); -// } - -// let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); -// if (!addresses.proxy.staking_token) { -// throw new Error("token contract not deployed"); -// } - -// if (!addresses.proxy.generator_registry) { -// throw new Error("generator_registry contract not deployed"); -// } - -// if (!addresses.zkbMarketId) { -// throw new Error("Market not created"); -// } - -// const generator_registry = GeneratorRegistry__factory.connect(addresses.proxy.generator_registry, admin); - -// const generatorAddress = await Promise.all(generators.map(async (a) => await a.getAddress())); -// console.log("generator Addresses", generatorAddress); - -// const staking_token = MockToken__factory.connect(addresses.proxy.staking_token, tokenHolder); -// for (let index = 0; index < generatorAddress.length; index++) { -// const generator = generators[index]; -// let tx = await staking_token.transfer(await generator.getAddress(), "2000000000000000000000"); -// console.log("token transfer transaction", (await tx.wait())?.hash); - -// const transferTx = await tokenHolder.sendTransaction({ -// to: await generator.getAddress(), -// value: "10000000000000000", -// }); -// console.log("ethers transfer transaction", (await transferTx.wait())?.hash); - -// tx = await staking_token -// .connect(generator) -// .approve(await generator_registry.getAddress(), config.generatorStakingAmount); -// console.log("market approval transaction", (await tx.wait())?.hash); - -// const generatorData = { -// name: `Generator Index ${index}`, -// time: 10000, -// generatorOysterPubKey: "0x" + bytesToHexString(await generateRandomBytes(64)), -// computeAllocation: 100, -// }; -// const geneatorDataString = generatorDataToBytes(generatorData); -// tx = await generator_registry -// .connect(generator) -// .register(await generator.getAddress(), 100, config.generatorStakingAmount, geneatorDataString); -// await tx.wait(); -// await generator_registry.connect(generator).joinMarketplace( -// addresses.zkbMarketId, -// new BigNumber(10) -// .pow(19) -// .multipliedBy(index + 1) -// .toFixed(), -// 1000, -// index + 1, -// ); - -// console.log("generator registration transaction", (await tx.wait())?.hash); -// } -// return "Done"; -// } - -// main().then(console.log).catch(console.log); diff --git a/scripts/setInputFormat.ts b/scripts/setInputFormat.ts deleted file mode 100644 index 494c859..0000000 --- a/scripts/setInputFormat.ts +++ /dev/null @@ -1,57 +0,0 @@ -// import { ethers } from "hardhat"; -// import * as fs from "fs"; - -// import { InputAndProofFormatRegistry__factory } from "../typechain-types"; -// import { createFileIfNotExists } from "../helpers"; - -// async function main(): Promise { -// const chainId = (await ethers.provider.getNetwork()).chainId.toString(); -// console.log("deploying on chain id:", chainId); - -// const signers = await ethers.getSigners(); -// console.log("available signers", signers.length); - -// if (signers.length < 6) { -// throw new Error("Atleast 6 signers are required for deployment"); -// } - -// let admin = signers[0]; - -// const path = `./addresses/${chainId}.json`; -// createFileIfNotExists(path); - -// let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - -// if (addresses?.proxy?.inputAndProofFormat) { -// const inputAndProofFormat = InputAndProofFormatRegistry__factory.connect( -// addresses.proxy.inputAndProofFormat, -// admin, -// ); -// const zkbMarketId = addresses.zkbMarketId; -// let tx = await inputAndProofFormat.connect(admin).setInputFormat(zkbMarketId, ["uint256[5]"]); -// await tx.wait(); - -// tx = await inputAndProofFormat.connect(admin).setProofFormat(zkbMarketId, ["uint256[8]"]); -// await tx.wait(); - -// const inputsArrayLength = await inputAndProofFormat.inputArrayLength(zkbMarketId); -// const proofArrayLength = await inputAndProofFormat.proofArrayLength(zkbMarketId); - -// const inputFormat: string[] = []; //type of input is stored as string here -// const proofFormat: string[] = []; // type of proof is stored as string here - -// for (let index = 0; index < inputsArrayLength; index++) { -// inputFormat.push(await inputAndProofFormat.inputs(zkbMarketId, index)); -// } - -// for (let index = 0; index < proofArrayLength; index++) { -// proofFormat.push(await inputAndProofFormat.proofs(zkbMarketId, index)); -// } - -// return { inputFormat, proofFormat }; -// } - -// throw new Error("Market Id, or contract missing"); -// } - -// main().then(console.log).catch(console.log); diff --git a/scripts/transferTokens.ts b/scripts/transferTokens.ts deleted file mode 100644 index 39b92d4..0000000 --- a/scripts/transferTokens.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { ethers } from "hardhat"; -import * as fs from "fs"; -import { checkFileExists } from "../helpers"; -import { MockToken__factory } from "../typechain-types"; -import BigNumber from "bignumber.js"; - -async function main(): Promise { - const chainId = (await ethers.provider.getNetwork()).chainId.toString(); - console.log("transacting on chain id:", chainId); - - const signers = await ethers.getSigners(); - console.log("available signers", signers.length); - - if (signers.length < 6) { - throw new Error("Atleast 6 signers are required for deployment"); - } - - let admin = signers[0]; - let tokenHolder = signers[1]; - let treasury = signers[2]; - // let marketCreator = signers[3]; - // let generator = signers[4]; - // let matchingEngine = signers[5]; - - const transferTo = "0x26a1b8104374096d88E34Ab48ec276F6018E444D"; - const path = `./addresses/${chainId}.json`; - const addressesExists = checkFileExists(path); - - if (!addressesExists) { - throw new Error(`Address file doesn't exists for ChainId: ${chainId}`); - } - - let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - if (!addresses.proxy.payment_token) { - throw new Error("token contract not deployed"); - } - - if (!addresses.proxy.staking_token) { - throw new Error("token contract not deployed"); - } - - const ethBalance = await admin.provider.getBalance(transferTo); - if (new BigNumber(ethBalance.toString()).lt("100000000000000000")) { - (await treasury.sendTransaction({ to: transferTo, value: "100000000000000000" })).wait(); - } - - const payment_token = MockToken__factory.connect(addresses.proxy.payment_token, tokenHolder); - let tx = await payment_token.connect(tokenHolder).transfer(transferTo, "100000000000000000000000"); - let receipt = await tx.wait(); - console.log(`Done: ${receipt?.hash}`); - - const staking_token = MockToken__factory.connect(addresses.proxy.staking_token, tokenHolder); - tx = await staking_token.connect(tokenHolder).transfer(transferTo, "100000000000000000000000"); - receipt = await tx.wait(); - console.log(`Done: ${receipt?.hash}`); - - return "Done"; -} - -main().then(console.log).catch(console.log); diff --git a/scripts/verify.ts b/scripts/verify.ts deleted file mode 100644 index 79d12c7..0000000 --- a/scripts/verify.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { run, ethers } from "hardhat"; -import { checkFileExists } from "../helpers"; -import * as fs from "fs"; - -async function main() { - const chainId = (await ethers.provider.getNetwork()).chainId.toString(); - console.log("deploying on chain id:", chainId); - - const signers = await ethers.getSigners(); - console.log("available signers", signers.length); - - let treasury = signers[2]; - - if (signers.length < 6) { - throw new Error("Atleast 6 signers are required for deployment"); - } - - const configPath = `./config/${chainId}.json`; - const configurationExists = checkFileExists(configPath); - - if (!configurationExists) { - throw new Error(`Config doesn't exists for chainId: ${chainId}`); - } - - const config = JSON.parse(fs.readFileSync(configPath, "utf-8")); - - const path = `./addresses/${chainId}.json`; - const addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - - let verificationResult; - - verificationResult = await run("verify:verify", { - address: addresses.implementation.generator_registry, - constructorArguments: [addresses.proxy.staking_token, addresses.proxy.entity_registry], - }); - console.log({ verificationResult }); - - verificationResult = await run("verify:verify", { - address: addresses.implementation.proof_market_place, - constructorArguments: [ - addresses.proxy.payment_token, - config.marketCreationCost, - await treasury.getAddress(), - addresses.proxy.generator_registry, - addresses.proxy.entity_registry, - ], - }); - console.log({ verificationResult }); - - verificationResult = await run("verify:verify", { - address: addresses.implementation.entity_registry, - constructorArguments: [addresses.proxy.attestation_verifier], - }); - console.log({ verificationResult }); - - verificationResult = await run("verify:verify", { - address: addresses.proxy.generator_registry, - }); - console.log({ verificationResult }); - - verificationResult = await run("verify:verify", { - address: addresses.proxy.proof_market_place, - }); - console.log({ verificationResult }); - - verificationResult = await run("verify:verify", { - address: addresses.proxy.tee_verifier_deployer, - }); - - return "String"; -} - -main().then(console.log); diff --git a/scripts/verifyMockVerifier.ts b/scripts/verifyMockVerifier.ts deleted file mode 100644 index 5e2fee5..0000000 --- a/scripts/verifyMockVerifier.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { run, ethers } from "hardhat"; -import { checkFileExists } from "../helpers"; -import * as fs from "fs"; - -async function main() { - const chainId = (await ethers.provider.getNetwork()).chainId.toString(); - console.log("deploying on chain id:", chainId); - - const signers = await ethers.getSigners(); - console.log("available signers", signers.length); - - let treasury = signers[2]; - - if (signers.length < 6) { - throw new Error("Atleast 6 signers are required for deployment"); - } - - const configPath = `./config/${chainId}.json`; - const configurationExists = checkFileExists(configPath); - - if (!configurationExists) { - throw new Error(`Config doesn't exists for chainId: ${chainId}`); - } - - let verificationResult; - - verificationResult = await run("verify:verify", { - address: "0xABBF9E6674e741656D718431B275EB2c951Aa184", - constructorArguments: [], - }); - console.log({ verificationResult }); - - return "String"; -} - -main().then(console.log); diff --git a/scripts/verifyTeeVerifier.ts b/scripts/verifyTeeVerifier.ts deleted file mode 100644 index 061a0de..0000000 --- a/scripts/verifyTeeVerifier.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { run, ethers } from "hardhat"; -import { checkFileExists } from "../helpers"; -import * as fs from "fs"; - -async function main() { - const chainId = (await ethers.provider.getNetwork()).chainId.toString(); - console.log("deploying on chain id:", chainId); - - const signers = await ethers.getSigners(); - console.log("available signers", signers.length); - - let treasury = signers[2]; - - if (signers.length < 6) { - throw new Error("Atleast 6 signers are required for deployment"); - } - - const configPath = `./config/${chainId}.json`; - const configurationExists = checkFileExists(configPath); - - if (!configurationExists) { - throw new Error(`Config doesn't exists for chainId: ${chainId}`); - } - - const config = JSON.parse(fs.readFileSync(configPath, "utf-8")); - - const path = `./addresses/${chainId}.json`; - const addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - - let verificationResult; - - verificationResult = await run("verify:verify", { - address: "0xb70cfd05B57a1e9b7E1217d53493C1C4B7cacb98", - constructorArguments: ["0x7376026b2638829aB4F58B9a1a0801485048A328", "0x63EEf1576b477Aa60Bfd7300B2C85b887639Ac1b"], - }); - console.log({ verificationResult }); - - return "String"; -} - -main().then(console.log); diff --git a/scripts/whitelistKeyAv.ts b/scripts/whitelistKeyAv.ts deleted file mode 100644 index 43333bd..0000000 --- a/scripts/whitelistKeyAv.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { ethers } from "hardhat"; -import * as fs from "fs"; - -import { AttestationVerifier__factory } from "../typechain-types"; -import { GodEnclavePCRS, MockEnclave, MockGeneratorPCRS, MockIVSPCRS, checkFileExists } from "../helpers"; - -async function main(): Promise { - const chainId = (await ethers.provider.getNetwork()).chainId.toString(); - console.log("deploying on chain id:", chainId); - - const signers = await ethers.getSigners(); - console.log("available signers", signers.length); - - if (signers.length < 6) { - throw new Error("Atleast 6 signers are required for deployment"); - } - - const configPath = `./config/${chainId}.json`; - const configurationExists = checkFileExists(configPath); - - if (!configurationExists) { - throw new Error(`Config doesn't exists for chainId: ${chainId}`); - } - - let admin = signers[0]; - - const path = `./addresses/${chainId}.json`; - let addresses = JSON.parse(fs.readFileSync(path, "utf-8")); - - const address = "0x0C0C472801Cc624815874C01383F824805c5d4Bd"; - - console.log({ address }); - - const attestation_verifier = AttestationVerifier__factory.connect(addresses.proxy.attestation_verifier, admin); - - const mockEnclave = new MockEnclave([MockGeneratorPCRS[2], GodEnclavePCRS[0], MockIVSPCRS[2]]); - try { - let tx = await attestation_verifier.whitelistImage(MockGeneratorPCRS[2], GodEnclavePCRS[0], MockIVSPCRS[2]); - let receipt = await tx.wait(); - console.log(receipt?.hash); - } catch (ex) { - console.log(ex); - } - - try { - let tx = await attestation_verifier.whitelistEnclave(mockEnclave.getImageId(), address); - let receipt = await tx.wait(); - console.log(receipt?.hash); - } catch (ex) { - console.log(ex); - } - - return "Done"; -} - -main().then(console.log).catch(console.log); diff --git a/test/EntityKeyRegistry.ts b/test/EntityKeyRegistry.ts deleted file mode 100644 index e856fd8..0000000 --- a/test/EntityKeyRegistry.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { expect } from "chai"; -import { ethers, upgrades } from "hardhat"; -import { Signer } from "ethers"; - -import { MockEnclave, MockGeneratorPCRS, generatorFamilyId } from "../helpers"; -import { - Error, - Error__factory, - EntityKeyRegistry, - EntityKeyRegistry__factory, - MockAttestationVerifier__factory, - MockAttestationVerifier, -} from "../typechain-types"; - -describe("Entity key registry tests", () => { - let signers: Signer[]; - let admin: Signer; - let randomUser: Signer; - - let entityKeyRegistry: EntityKeyRegistry; - let errorLibrary: Error; - let attestationVerifier: MockAttestationVerifier; - - beforeEach(async () => { - signers = await ethers.getSigners(); - admin = signers[0]; - randomUser = signers[5]; - - errorLibrary = await new Error__factory(admin).deploy(); - - attestationVerifier = await new MockAttestationVerifier__factory(admin).deploy(); - const EntityKeyRegistryContract = await ethers.getContractFactory("EntityKeyRegistry"); - const _entityKeyRegistry = await upgrades.deployProxy(EntityKeyRegistryContract, [await admin.getAddress(), []], { - kind: "uups", - constructorArgs: [await attestationVerifier.getAddress()], - }); - entityKeyRegistry = EntityKeyRegistry__factory.connect(await _entityKeyRegistry.getAddress(), admin); - - const register_role = await entityKeyRegistry.KEY_REGISTER_ROLE(); - await entityKeyRegistry.grantRole(register_role, await admin.getAddress()); - // console.log({ entityKeyRegistry: await entityKeyRegistry.getAddress() }); - }); - - it("Update key should revert for address without key_register_role", async () => { - await expect(entityKeyRegistry.connect(randomUser).updatePubkey(randomUser.getAddress(), 0, "0x", "0x")).to.be.reverted; - }); - - it("Updating with invalid key should revert", async () => { - await expect(entityKeyRegistry.updatePubkey(randomUser.getAddress(), 1, "0x", "0x")).to.be.revertedWithCustomError( - entityKeyRegistry, - "InvalidEnclaveKey", - ); - }); - - it("Update key", async () => { - const generator_enclave = new MockEnclave(MockGeneratorPCRS); - await entityKeyRegistry.connect(admin).whitelistImageUsingPcrs(generatorFamilyId(1), generator_enclave.getPcrRlp()); - await expect( - entityKeyRegistry.updatePubkey( - randomUser.getAddress(), - 0, - generator_enclave.getUncompressedPubkey(), - await generator_enclave.getVerifiedAttestation(generator_enclave), - ), - ) - .to.emit(entityKeyRegistry, "UpdateKey") - .withArgs(await randomUser.getAddress(), 0); - }); - - it("Remove key", async () => { - // Adding key to registry - const generator_enclave = new MockEnclave(MockGeneratorPCRS); - await entityKeyRegistry.connect(admin).whitelistImageUsingPcrs(generatorFamilyId(1), generator_enclave.getPcrRlp()); - await expect( - entityKeyRegistry.updatePubkey( - randomUser.getAddress(), - 8, - generator_enclave.getUncompressedPubkey(), - await generator_enclave.getVerifiedAttestation(generator_enclave), - ), - ) - .to.emit(entityKeyRegistry, "UpdateKey") - .withArgs(await randomUser.getAddress(), 8); - - // Checking key in registry - const pub_key = await entityKeyRegistry.pub_key(randomUser.getAddress(), 8); - expect(pub_key).to.eq(generator_enclave.getUncompressedPubkey()); - - // Removing key from registry - await expect(entityKeyRegistry.removePubkey(randomUser.getAddress(), 9)) - .to.emit(entityKeyRegistry, "RemoveKey") - .withArgs(await randomUser.getAddress(), 9); - }); - - it("Test Attestation to pubkey and address", async () => { - let abiCoder = new ethers.AbiCoder(); - let signerToUser = admin; - //actually it is. 04 has been removed to support keccak hash in contracts - // 046af9fff439e147a2dfc1e5cf83d63389a74a8cddeb1c18ecc21cb83aca9ed5fa222f055073e4c8c81d3c7a9cf8f2fa2944855b43e6c84ab8e16177d45698c843 - const knownPubkey = - "0x6af9fff439e147a2dfc1e5cf83d63389a74a8cddeb1c18ecc21cb83aca9ed5fa222f055073e4c8c81d3c7a9cf8f2fa2944855b43e6c84ab8e16177d45698c843"; - const expectedAddress = "0xe511c2c747Fa2F46e8786cbF4d66b015d1FCfaC1"; - - let inputBytes = abiCoder.encode( - ["bytes", "bytes", "bytes", "bytes", "bytes", "uint256"], - ["0x00", knownPubkey, "0x00", "0x00", "0x00", new Date().valueOf()], - ); - - const info = MockEnclave.getPubKeyAndAddressFromAttestation(inputBytes); - expect(info.uncompressedPublicKey).to.eq(knownPubkey); - expect(info.address.toLowerCase()).to.eq(expectedAddress.toLowerCase()); - }); -}); diff --git a/test/Generator.ts b/test/Generator.ts deleted file mode 100644 index 525cfa6..0000000 --- a/test/Generator.ts +++ /dev/null @@ -1,901 +0,0 @@ -import { BigNumber } from 'bignumber.js'; -import { expect } from 'chai'; -import { - Provider, - Signer, -} from 'ethers'; -import { ethers } from 'hardhat'; - -import { - GeneratorData, - generatorDataToBytes, - GodEnclavePCRS, - MarketData, - marketDataToBytes, - MockEnclave, - MockGeneratorPCRS, - MockIVSPCRS, - MockMEPCRS, - setup, - skipBlocks, -} from '../helpers'; -import * as transfer_verifier_inputs - from '../helpers/sample/transferVerifier/transfer_inputs.json'; -import * as transfer_verifier_proof - from '../helpers/sample/transferVerifier/transfer_proof.json'; -import * as invalid_transfer_verifier_proof - from '../helpers/sample/zkbVerifier/transfer_proof.json'; -import { - EntityKeyRegistry, - Error, - GeneratorRegistry, - IVerifier, - IVerifier__factory, - MockToken, - NativeStaking, - POND, - PriorityLog, - ProofMarketplace, - StakingManager, - SymbioticStaking, - SymbioticStakingReward, - Transfer_verifier_wrapper__factory, - TransferVerifier__factory, - USDC, - WETH, -} from '../typechain-types'; -import { generatorSelfStake, stakingContractConfig, stakingSetup, submistVaultSnapshot, VaultSnapshotData } from '../helpers/setup'; - -describe("Checking Generator's multiple compute", () => { - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let tokenToUse: MockToken; - let priorityLog: PriorityLog; - let errorLibrary: Error; - let entityKeyRegistry: EntityKeyRegistry; - let iverifier: IVerifier; - - let stakingManager: StakingManager; - let nativeStaking: NativeStaking; - let symbioticStaking: SymbioticStaking; - let symbioticStakingReward: SymbioticStakingReward; - - let POND: POND; - let WETH: WETH; - let USDC: USDC; - - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let prover: Signer; - let generator: Signer; - let vault1: Signer; - let vault2: Signer; - - let marketCreator: Signer; - let marketSetupData: MarketData; - let marketId: string; - - let generatorData: GeneratorData; - - const ivsEnclave = new MockEnclave(MockIVSPCRS); - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - - const godEnclave = new MockEnclave(GodEnclavePCRS); - - const totalTokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(9); - const generatorStakingAmount: BigNumber = new BigNumber(10).pow(18).multipliedBy(1000).multipliedBy(2).minus(1231); // use any random number - const generatorSlashingPenalty: BigNumber = new BigNumber(10).pow(16).multipliedBy(93).minus(182723423); // use any random number - const marketCreationCost: BigNumber = new BigNumber(10).pow(18).multipliedBy(1213).minus(23746287365); // use any random number - const generatorComputeAllocation = new BigNumber(10).pow(19).minus("12782387").div(123).multipliedBy(98); - - const computeGivenToNewMarket = new BigNumber(10).pow(19).minus("98897").div(9233).multipliedBy(98); - - const rewardForProofGeneration = new BigNumber(10).pow(18).multipliedBy(200); - const minRewardByGenerator = new BigNumber(10).pow(18).multipliedBy(199); - - const refreshSetup = async ( - modifiedComputeGivenToNewMarket = computeGivenToNewMarket, - modifiedGeneratorStakingAmount = generatorStakingAmount, - ): Promise => { - signers = await ethers.getSigners(); - admin = signers[0]; - tokenHolder = signers[1]; - treasury = signers[2]; - marketCreator = signers[3]; - prover = signers[4]; - generator = signers[5]; - - marketSetupData = { - zkAppName: "transfer verifier", - proverCode: "url of the prover code", - verifierCode: "url of the verifier code", - proverOysterImage: "oyster image link for the prover", - setupCeremonyData: ["first phase", "second phase", "third phase"], - inputOuputVerifierUrl: "this should be nclave url", - }; - - generatorData = { - name: "some custom name for the generator", - }; - - await admin.sendTransaction({ to: ivsEnclave.getAddress(), value: "1000000000000000000" }); - await admin.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); - - const transferVerifier = await new TransferVerifier__factory(admin).deploy(); - - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - - let proofBytes = abiCoder.encode( - ["uint256[8]"], - [ - [ - transfer_verifier_proof.a[0], - transfer_verifier_proof.a[1], - transfer_verifier_proof.b[0][0], - transfer_verifier_proof.b[0][1], - transfer_verifier_proof.b[1][0], - transfer_verifier_proof.b[1][1], - transfer_verifier_proof.c[0], - transfer_verifier_proof.c[1], - ], - ], - ); - const transferVerifierWrapper = await new Transfer_verifier_wrapper__factory(admin).deploy( - await transferVerifier.getAddress(), - inputBytes, - proofBytes, - ); - - iverifier = IVerifier__factory.connect(await transferVerifierWrapper.getAddress(), admin); - - let treasuryAddress = await treasury.getAddress(); - - let data = await setup.rawSetup( - admin, - tokenHolder, - totalTokenSupply, - modifiedGeneratorStakingAmount, - generatorSlashingPenalty, - treasuryAddress, - marketCreationCost, - marketCreator, - marketDataToBytes(marketSetupData), - marketSetupData.inputOuputVerifierUrl, - iverifier, - generator, - generatorDataToBytes(generatorData), - ivsEnclave, - matchingEngineEnclave, - generatorEnclave, - minRewardByGenerator, - generatorComputeAllocation, - modifiedComputeGivenToNewMarket, - godEnclave, - ); - - proofMarketplace = data.proofMarketplace; - generatorRegistry = data.generatorRegistry; - tokenToUse = data.mockToken; - priorityLog = data.priorityLog; - errorLibrary = data.errorLibrary; - entityKeyRegistry = data.entityKeyRegistry; - - /* Staking Contracts */ - stakingManager = data.stakingManager; - nativeStaking = data.nativeStaking; - symbioticStaking = data.symbioticStaking; - symbioticStakingReward = data.symbioticStakingReward; - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).minus(1).toFixed(); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }; - - beforeEach(async () => { - await refreshSetup(); - - vault1 = signers[6]; - vault2 = signers[7]; - ({ POND, WETH, USDC } = await stakingSetup(admin, stakingManager, nativeStaking, symbioticStaking, symbioticStakingReward)); - - await generatorSelfStake(nativeStaking, admin, generator, POND, new BigNumber(10).pow(18).multipliedBy(10000)); - - /* Submitting Vault Snapshots */ - const snapshotData: VaultSnapshotData[] = [ - // vault1 -> generator (10000 POND) - { - operator: await generator.getAddress(), - vault: await vault1.getAddress(), - stakeToken: await POND.getAddress(), - stakeAmount: new BigNumber(10).pow(18).multipliedBy(10000).toFixed(0), - }, - // vault2 -> generator (10000 WETH) - { - operator: await generator.getAddress(), - vault: await vault2.getAddress(), - stakeToken: await WETH.getAddress(), - stakeAmount: new BigNumber(10).pow(18).multipliedBy(10000).toFixed(0), - }, - ]; - - await submistVaultSnapshot(generator, symbioticStaking, snapshotData); - }); - - it("Using Simple Transfer Verifier", async () => { - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider as Provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - askId, - generator, - ); - - let proofBytes = abiCoder.encode( - ["uint256[8]"], - [ - [ - transfer_verifier_proof.a[0], - transfer_verifier_proof.a[1], - transfer_verifier_proof.b[0][0], - transfer_verifier_proof.b[0][1], - transfer_verifier_proof.b[1][0], - transfer_verifier_proof.b[1][1], - transfer_verifier_proof.c[0], - transfer_verifier_proof.c[1], - ], - ], - ); - await expect(proofMarketplace.submitProof(askId, proofBytes)).to.emit(proofMarketplace, "ProofCreated").withArgs(askId, proofBytes); - }); - - it("Should Fail invalid Proof: Simple Transfer Verifier, but proof generated for some other request", async () => { - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider as Provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - askId, - generator, - ); - - let proofBytes = abiCoder.encode( - ["uint256[8]"], - [ - [ - invalid_transfer_verifier_proof.a[0], - invalid_transfer_verifier_proof.a[1], - invalid_transfer_verifier_proof.b[0][0], - invalid_transfer_verifier_proof.b[0][1], - invalid_transfer_verifier_proof.b[1][0], - invalid_transfer_verifier_proof.b[1][1], - invalid_transfer_verifier_proof.c[0], - invalid_transfer_verifier_proof.c[1], - ], - ], - ); - await expect(proofMarketplace.submitProof(askId, proofBytes)) - .to.revertedWithCustomError(proofMarketplace, "InvalidProof") - .withArgs(askId); - }); - - it("Task Assignment fails if it exceeds compute capacity", async () => { - const max_asks = generatorComputeAllocation.div(computeGivenToNewMarket).toFixed(0); - - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - // console.log({ inputBytes }); - - for (let index = 0; index < parseInt(max_asks) + 2; index++) { - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - if (index >= parseInt(max_asks)) { - const ask = { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }; - - await tokenToUse.connect(tokenHolder).transfer(await prover.getAddress(), ask.reward.toString()); - - await tokenToUse.connect(prover).approve(await proofMarketplace.getAddress(), ask.reward.toString()); - - const askId = await proofMarketplace.askCounter(); - - await proofMarketplace.connect(prover).createAsk(ask, marketId, "0x", "0x"); - - const matchingEngine: Signer = new ethers.Wallet(matchingEngineEnclave.getPrivateKey(true), admin.provider); - - await expect( - proofMarketplace.connect(matchingEngine).assignTask(askId, await generator.getAddress(), "0x1234"), - ).to.be.revertedWithCustomError(errorLibrary, "InsufficientGeneratorComputeAvailable"); - } else { - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider as Provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - askId, - generator, - ); - - // console.log({ taskId, index }); - } - } - }); - - it("Leave Market Place with active request", async () => { - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider as Provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - askId, - generator, - ); - - await expect(generatorRegistry.connect(generator).leaveMarketplace(marketId)).to.revertedWithCustomError( - generatorRegistry, - "CannotLeaveMarketWithActiveRequest", - ); - }); - - it("Invalid arguments in leave market place", async () => { - await expect(generatorRegistry.connect(admin).leaveMarketplace(marketId)).to.revertedWithCustomError( - generatorRegistry, - "InvalidGeneratorStatePerMarket", - ); - - // some random market id number - await expect(generatorRegistry.connect(generator).leaveMarketplace("287")).to.revertedWithoutReason; // actual reason probably is array-out-of-bonds - }); - - it("Task Assignment fails if it exceeds maximum parallel requests per generators", async () => { - const MAX_PARALLEL_REQUESTS = new BigNumber((await generatorRegistry.PARALLEL_REQUESTS_UPPER_LIMIT()).toString()); - - const newComputeGivenToMarket = generatorComputeAllocation.div(MAX_PARALLEL_REQUESTS).div(105).multipliedBy(100); - - await refreshSetup(newComputeGivenToMarket); - const max_asks = generatorComputeAllocation.div(newComputeGivenToMarket).toFixed(0); - - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - // console.log({ inputBytes }); - - for (let index = 0; index < parseInt(max_asks); index++) { - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - if (index > MAX_PARALLEL_REQUESTS.toNumber()) { - const ask = { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }; - - await tokenToUse.connect(tokenHolder).transfer(await prover.getAddress(), ask.reward.toString()); - - await tokenToUse.connect(prover).approve(await proofMarketplace.getAddress(), ask.reward.toString()); - - const askId = await proofMarketplace.askCounter(); - - await proofMarketplace.connect(prover).createAsk(ask, marketId, "0x", "0x"); - - const matchingEngine: Signer = new ethers.Wallet(matchingEngineEnclave.getPrivateKey(true), admin.provider); - - await expect( - proofMarketplace.connect(matchingEngine).assignTask(askId, await generator.getAddress(), "0x1234"), - ).to.be.revertedWithCustomError(generatorRegistry, "MaxParallelRequestsPerMarketExceeded"); - } else { - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider as Provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - askId, - generator, - ); - } - } - }); - - it("Task Assignment fails if generator doesn't have sufficient stake", async () => { - const max_restricted_requests_by_stake = 3; - const newGeneratorStake = generatorSlashingPenalty.multipliedBy(max_restricted_requests_by_stake); - await refreshSetup(computeGivenToNewMarket, newGeneratorStake); - - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - - for (let index = 0; index < max_restricted_requests_by_stake + 12; index++) { - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - if (index >= max_restricted_requests_by_stake) { - const ask = { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }; - - await tokenToUse.connect(tokenHolder).transfer(await prover.getAddress(), ask.reward.toString()); - - await tokenToUse.connect(prover).approve(await proofMarketplace.getAddress(), ask.reward.toString()); - - const askId = await proofMarketplace.askCounter(); - - await proofMarketplace.connect(prover).createAsk(ask, marketId, "0x", "0x"); - - const matchingEngine: Signer = new ethers.Wallet(matchingEngineEnclave.getPrivateKey(true), admin.provider); - - // await expect( - // proofMarketplace.connect(matchingEngine).assignTask(askId, await generator.getAddress(), "0x1234"), - // ).to.be.revertedWithCustomError(generatorRegistry, "InsufficientStakeToLock"); - } else { - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider as Provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - stakingManager, - nativeStaking, - symbioticStaking, - symbioticStakingReward, - }, - askId, - generator, - ); - } - } - }); - - it("Only registered generator should be able to add/update entity keys", async () => { - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - - let generatorAttestationBytes = await generatorEnclave.getVerifiedAttestation(godEnclave); - - let types = ["bytes", "address"]; - - let values = [generatorAttestationBytes, await generator.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await generatorEnclave.signMessage(ethers.getBytes(digest)); - - await expect(generatorRegistry.connect(generator).updateEncryptionKey(marketId, generatorAttestationBytes, signature)) - .to.emit(entityKeyRegistry, "UpdateKey") - .withArgs(await generator.getAddress(), marketId); - }); - - it("Only admin can set the generator registry role", async () => { - const generatorRole = await entityKeyRegistry.KEY_REGISTER_ROLE(); - await expect(entityKeyRegistry.connect(treasury).addGeneratorRegistry(await proofMarketplace.getAddress())).to.be.reverted; - - await entityKeyRegistry.addGeneratorRegistry(await proofMarketplace.getAddress()); - expect(await entityKeyRegistry.hasRole(generatorRole, await proofMarketplace.getAddress())).to.eq(true); - }); - - it("Updating with invalid key should revert", async () => { - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - const invalidPubkey = "0x1234"; - - let abiCoder = new ethers.AbiCoder(); - let validAttesationWithInvalidKey = abiCoder.encode( - ["bytes", "bytes", "bytes", "bytes", "bytes", "uint256"], - ["0x00", invalidPubkey, MockGeneratorPCRS[0], MockGeneratorPCRS[1], MockGeneratorPCRS[2], new Date().valueOf()], - ); - - let types = ["bytes", "address"]; - let values = [validAttesationWithInvalidKey, await generator.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await generatorEnclave.signMessage(ethers.getBytes(digest)); - - await expect( - generatorRegistry.connect(generator).updateEncryptionKey(marketId, validAttesationWithInvalidKey, signature), - ).to.be.revertedWithCustomError(errorLibrary, "InvalidEnclaveKey"); - }); - - it("Remove key", async () => { - // Adding key to registry - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - let newAttesationBytes = await generatorEnclave.getVerifiedAttestation(godEnclave); - - let types = ["bytes", "address"]; - - let values = [newAttesationBytes, await generator.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await generatorEnclave.signMessage(ethers.getBytes(digest)); - - await expect(generatorRegistry.connect(generator).updateEncryptionKey(marketId, newAttesationBytes, signature)) - .to.emit(entityKeyRegistry, "UpdateKey") - .withArgs(await generator.getAddress(), marketId); - - // Checking key in registry - const pub_key = await entityKeyRegistry.pub_key(generator.getAddress(), marketId); - // console.log({ pub_key: pub_key }); - // console.log({pubBytes: pubBytes }); - expect(pub_key).to.eq(generatorEnclave.getUncompressedPubkey()); - - // Removing key from registry - await expect(generatorRegistry.connect(generator).removeEncryptionKey(marketId)) - .to.emit(entityKeyRegistry, "RemoveKey") - .withArgs(await generator.getAddress(), marketId); - }); - - it("Generator Prechecks", async () => { - const exponent = new BigNumber(10).pow(18).toFixed(0); - - const generatorData = await generatorRegistry.generatorRegistry(await generator.getAddress()); - expect(generatorComputeAllocation.toFixed(0)).to.eq(generatorData.declaredCompute.toString()); - expect(generatorData.computeConsumed).to.eq(0); - // expect(generatorData.totalStake).to.eq(generatorStakingAmount.toFixed(0)); - // expect(generatorData.stakeLocked).to.eq(0); - expect(generatorData.activeMarketplaces).to.eq(1); - expect(generatorData.intendedComputeUtilization).to.eq(exponent); - // expect(generatorData.intendedStakeUtilization).to.eq(exponent); - - const marketId = 0; // likely to be 0, if failed change it - const generatorDataPerMarket = await generatorRegistry.generatorInfoPerMarket(await generator.getAddress(), marketId); - - expect(generatorDataPerMarket.state).to.not.eq(0); // 0 means no generator - expect(generatorDataPerMarket.computePerRequestRequired).to.eq(computeGivenToNewMarket.toFixed(0)); - expect(generatorDataPerMarket.proofGenerationCost).to.eq(minRewardByGenerator.toFixed(0)); - expect(generatorDataPerMarket.activeRequests).to.eq(0); - }); -}); diff --git a/test/PrivateMarket.ts b/test/PrivateMarket.ts deleted file mode 100644 index f8c19df..0000000 --- a/test/PrivateMarket.ts +++ /dev/null @@ -1,481 +0,0 @@ -import { expect } from "chai"; -import { ethers } from "hardhat"; -import { Provider, Signer } from "ethers"; -import { BigNumber } from "bignumber.js"; -import { - Error, - GeneratorRegistry, - MockToken, - PriorityLog, - ProofMarketplace, - TransferVerifier__factory, - EntityKeyRegistry, - Transfer_verifier_wrapper__factory, - IVerifier__factory, - IVerifier, -} from "../typechain-types"; - -import { - GeneratorData, - GodEnclavePCRS, - MarketData, - MockEnclave, - MockGeneratorPCRS, - MockMEPCRS, - generatorDataToBytes, - generatorFamilyId, - ivsFamilyId, - marketDataToBytes, - setup, - skipBlocks, -} from "../helpers"; - -import * as transfer_verifier_inputs from "../helpers/sample/transferVerifier/transfer_inputs.json"; -import * as transfer_verifier_proof from "../helpers/sample/transferVerifier/transfer_proof.json"; - -describe("Checking Case where generator and ivs image is same", () => { - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let tokenToUse: MockToken; - let priorityLog: PriorityLog; - let errorLibrary: Error; - let entityKeyRegistry: EntityKeyRegistry; - let iverifier: IVerifier; - - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let prover: Signer; - let generator: Signer; - - let marketCreator: Signer; - let marketSetupData: MarketData; - let marketId: string; - - let generatorData: GeneratorData; - - const ivsAndGeneratorEnclaveCombined = new MockEnclave(MockGeneratorPCRS); - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - - const godEnclave = new MockEnclave(GodEnclavePCRS); - - const totalTokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(9); - const generatorStakingAmount: BigNumber = new BigNumber(10).pow(18).multipliedBy(1000).multipliedBy(2).minus(1231); // use any random number - const generatorSlashingPenalty: BigNumber = new BigNumber(10).pow(16).multipliedBy(93).minus(182723423); // use any random number - const marketCreationCost: BigNumber = new BigNumber(10).pow(18).multipliedBy(1213).minus(23746287365); // use any random number - const generatorComputeAllocation = new BigNumber(10).pow(19).minus("12782387").div(123).multipliedBy(98); - - const computeGivenToNewMarket = new BigNumber(10).pow(19).minus("98897").div(9233).multipliedBy(98); - - const rewardForProofGeneration = new BigNumber(10).pow(18).multipliedBy(200); - const minRewardByGenerator = new BigNumber(10).pow(18).multipliedBy(199); - - beforeEach(async () => { - signers = await ethers.getSigners(); - admin = signers[0]; - tokenHolder = signers[1]; - treasury = signers[2]; - marketCreator = signers[3]; - prover = signers[4]; - generator = signers[5]; - - marketSetupData = { - zkAppName: "transfer verifier", - proverCode: "url of the prover code", - verifierCode: "url of the verifier code", - proverOysterImage: "oyster image link for the prover", - setupCeremonyData: ["first phase", "second phase", "third phase"], - inputOuputVerifierUrl: "this should be nclave url", - }; - - generatorData = { - name: "some custom name for the generator", - }; - - await admin.sendTransaction({ to: ivsAndGeneratorEnclaveCombined.getAddress(), value: "1000000000000000000" }); - await admin.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); - - const transferVerifier = await new TransferVerifier__factory(admin).deploy(); - - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - - let proofBytes = abiCoder.encode( - ["uint256[8]"], - [ - [ - transfer_verifier_proof.a[0], - transfer_verifier_proof.a[1], - transfer_verifier_proof.b[0][0], - transfer_verifier_proof.b[0][1], - transfer_verifier_proof.b[1][0], - transfer_verifier_proof.b[1][1], - transfer_verifier_proof.c[0], - transfer_verifier_proof.c[1], - ], - ], - ); - const transferVerifierWrapper = await new Transfer_verifier_wrapper__factory(admin).deploy( - await transferVerifier.getAddress(), - inputBytes, - proofBytes, - ); - - iverifier = IVerifier__factory.connect(await transferVerifierWrapper.getAddress(), admin); - - let treasuryAddress = await treasury.getAddress(); - - let data = await setup.rawSetup( - admin, - tokenHolder, - totalTokenSupply, - generatorStakingAmount, - generatorSlashingPenalty, - treasuryAddress, - marketCreationCost, - marketCreator, - marketDataToBytes(marketSetupData), - marketSetupData.inputOuputVerifierUrl, - iverifier, - generator, - generatorDataToBytes(generatorData), - ivsAndGeneratorEnclaveCombined, // USED AS IVS HERE - matchingEngineEnclave, - ivsAndGeneratorEnclaveCombined, // USED AS GENERATOR HERE - minRewardByGenerator, - generatorComputeAllocation, - computeGivenToNewMarket, - godEnclave, - ); - - proofMarketplace = data.proofMarketplace; - generatorRegistry = data.generatorRegistry; - tokenToUse = data.mockToken; - priorityLog = data.priorityLog; - errorLibrary = data.errorLibrary; - entityKeyRegistry = data.entityKeyRegistry; - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).minus(1).toFixed(); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }); - - it("Add new images for generators and ivs", async () => { - const newGeneratorImages = [MockEnclave.someRandomPcrs(), MockEnclave.someRandomPcrs(), MockEnclave.someRandomPcrs()].map( - (a) => new MockEnclave(a), - ); - - const newIvsImages = [MockEnclave.someRandomPcrs(), MockEnclave.someRandomPcrs(), MockEnclave.someRandomPcrs()].map( - (a) => new MockEnclave(a), - ); - - await expect(proofMarketplace.connect(admin).addExtraImages(marketId, [], [])).to.be.revertedWithCustomError( - proofMarketplace, - "OnlyMarketCreator", - ); - await expect(proofMarketplace.connect(marketCreator).addExtraImages(marketId, [], [])).to.not.be.reverted; - - await proofMarketplace.connect(marketCreator).addExtraImages( - marketId, - newGeneratorImages.map((a) => a.getPcrRlp()), - newIvsImages.map((a) => a.getPcrRlp()), - ); - - for (let index = 0; index < newGeneratorImages.length; index++) { - const generator = newGeneratorImages[index]; - const isAllowed = await entityKeyRegistry.isImageInFamily(generator.getImageId(), generatorFamilyId(marketId)); - expect(isAllowed).is.true; - } - - for (let index = 0; index < newIvsImages.length; index++) { - const ivs = newIvsImages[index]; - const isAllowed = await entityKeyRegistry.isImageInFamily(ivs.getImageId(), ivsFamilyId(marketId)); - expect(isAllowed).is.true; - } - }); - - it("Check events during adding and removing extra images", async () => { - const newGenerator = new MockEnclave(MockEnclave.someRandomPcrs()); - const newIvs = new MockEnclave(MockEnclave.someRandomPcrs()); - - await expect(proofMarketplace.connect(marketCreator).addExtraImages(marketId, [newGenerator.getPcrRlp()], [newIvs.getPcrRlp()])) - .to.emit(proofMarketplace, "AddExtraProverImage") - .withArgs(marketId, newGenerator.getImageId()) - .to.emit(proofMarketplace, "AddExtraIVSImage") - .withArgs(marketId, newIvs.getImageId()); - - await expect(proofMarketplace.connect(marketCreator).removeExtraImages(marketId, [newGenerator.getPcrRlp()], [newIvs.getPcrRlp()])) - .to.emit(proofMarketplace, "RemoveExtraProverImage") - .withArgs(marketId, newGenerator.getImageId()) - .to.emit(proofMarketplace, "RemoveExtraIVSImage") - .withArgs(marketId, newIvs.getImageId()); - }); - - it("Cannot remove default market id", async () => { - await expect(proofMarketplace.connect(admin).removeExtraImages(marketId, [], [])).to.revertedWithCustomError( - proofMarketplace, - "OnlyMarketCreator", - ); - - await expect( - proofMarketplace.connect(marketCreator).removeExtraImages(marketId, [ivsAndGeneratorEnclaveCombined.getPcrRlp()], []), - ).to.revertedWithCustomError(proofMarketplace, "CannotRemoveDefaultImageFromMarket"); - await expect( - proofMarketplace.connect(marketCreator).removeExtraImages(marketId, [], [ivsAndGeneratorEnclaveCombined.getPcrRlp()]), - ).to.revertedWithCustomError(proofMarketplace, "CannotRemoveDefaultImageFromMarket"); - }); - - describe("Submit Proof For invalid request", () => { - let askId: string; - const updateIvsKey = async (ivsEnclave: MockEnclave) => { - // use any enclave here as AV is mocked - let ivsAttestationBytes = await ivsEnclave.getVerifiedAttestation(godEnclave); // means ivs should get verified attestation from noUseEnclave - - let types = ["bytes", "address"]; - let values = [ivsAttestationBytes, await generator.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await ivsEnclave.signMessage(ethers.getBytes(digest)); - - // use any enclave to get verfied attestation as mockAttesationVerifier is used here - await expect(generatorRegistry.connect(generator).addIvsKey(marketId, ivsAttestationBytes, signature)) - .to.emit(generatorRegistry, "AddIvsKey") - .withArgs(marketId, ivsEnclave.getAddress()); - }; - - beforeEach(async () => { - let abiCoder = new ethers.AbiCoder(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - const latestBlock = await ethers.provider.getBlockNumber(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - - askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider as Provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - }); - it("Submit proof for invalid requests directly from generator", async () => { - const askData = await proofMarketplace.listOfAsk(askId); - const types = ["uint256", "bytes"]; - - const values = [askId, askData.ask.proverData]; - - const abicode = new ethers.AbiCoder(); - const encoded = abicode.encode(types, values); - const digest = ethers.keccak256(encoded); - const signature = await ivsAndGeneratorEnclaveCombined.signMessage(ethers.getBytes(digest)); - - await proofMarketplace.flush(await treasury.getAddress()); // remove anything if is already there - - await expect(proofMarketplace.submitProofForInvalidInputs(askId, signature)).to.emit(proofMarketplace, "InvalidInputsDetected"); - }); - - it("Submit proof for invalid requests directly from new generators added by market maker", async () => { - const newGeneratorImage = new MockEnclave(MockEnclave.someRandomPcrs()); - await proofMarketplace - .connect(marketCreator) - .addExtraImages(marketId, [newGeneratorImage.getPcrRlp()], [newGeneratorImage.getPcrRlp()]); - - await updateIvsKey(newGeneratorImage); - - const askData = await proofMarketplace.listOfAsk(askId); - const types = ["uint256", "bytes"]; - - const values = [askId, askData.ask.proverData]; - - const abicode = new ethers.AbiCoder(); - const encoded = abicode.encode(types, values); - const digest = ethers.keccak256(encoded); - const signature = await newGeneratorImage.signMessage(ethers.getBytes(digest)); - - await proofMarketplace.flush(await treasury.getAddress()); // remove anything if is already there - - await expect(proofMarketplace.submitProofForInvalidInputs(askId, signature)).to.emit(proofMarketplace, "InvalidInputsDetected"); - }); - - it("Should fail to ecies key when the generator image is not added by market creator", async () => { - const newGeneratorImage = new MockEnclave(MockEnclave.someRandomPcrs()); - let generatorAttestationBytes = await newGeneratorImage.getVerifiedAttestation(godEnclave); - - let types = ["bytes", "address"]; - - let values = [generatorAttestationBytes, await generator.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await newGeneratorImage.signMessage(ethers.getBytes(digest)); - - await expect( - generatorRegistry.connect(generator).updateEncryptionKey(marketId, generatorAttestationBytes, signature), - ).to.be.revertedWithCustomError(generatorRegistry, "IncorrectImageId"); - }); - - it("Can't add same extra image twice", async () => { - const newGeneratorImage = new MockEnclave(MockEnclave.someRandomPcrs()); - await proofMarketplace - .connect(marketCreator) - .addExtraImages(marketId, [newGeneratorImage.getPcrRlp()], [newGeneratorImage.getPcrRlp()]); - - await expect( - proofMarketplace.connect(marketCreator).addExtraImages(marketId, [newGeneratorImage.getPcrRlp()], [newGeneratorImage.getPcrRlp()]), - ) - .to.be.revertedWithCustomError(proofMarketplace, "ImageAlreadyInFamily") - .withArgs(newGeneratorImage.getImageId(), generatorFamilyId(marketId)); - }); - - it("Can't add same extra ivs image twice", async () => { - const newIvsImage = new MockEnclave(MockEnclave.someRandomPcrs()); - await proofMarketplace.connect(marketCreator).addExtraImages(marketId, [], [newIvsImage.getPcrRlp()]); - - await expect(proofMarketplace.connect(marketCreator).addExtraImages(marketId, [], [newIvsImage.getPcrRlp()])) - .to.be.revertedWithCustomError(proofMarketplace, "ImageAlreadyInFamily") - .withArgs(newIvsImage.getImageId(), ivsFamilyId(marketId)); - }); - - it("Update Ecies key when the generator image is updated", async () => { - const newGeneratorImage = new MockEnclave(MockEnclave.someRandomPcrs()); - await proofMarketplace - .connect(marketCreator) - .addExtraImages(marketId, [newGeneratorImage.getPcrRlp()], [newGeneratorImage.getPcrRlp()]); - - let generatorAttestationBytes = await newGeneratorImage.getVerifiedAttestation(godEnclave); - - let types = ["bytes", "address"]; - - let values = [generatorAttestationBytes, await generator.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await newGeneratorImage.signMessage(ethers.getBytes(digest)); - - await expect(generatorRegistry.connect(generator).updateEncryptionKey(marketId, generatorAttestationBytes, signature)) - .to.emit(entityKeyRegistry, "UpdateKey") - .withArgs(await generator.getAddress(), marketId); - }); - - describe("Only New IVS added by market maker", () => { - const newIvsImage = new MockEnclave(MockEnclave.someRandomPcrs()); - beforeEach(async () => { - await proofMarketplace.connect(marketCreator).addExtraImages(marketId, [], [newIvsImage.getPcrRlp()]); - - await updateIvsKey(newIvsImage); - }); - - it("Submit proof for invalid requests directly from if only new ivs added by market maker", async () => { - const askData = await proofMarketplace.listOfAsk(askId); - const types = ["uint256", "bytes"]; - - const values = [askId, askData.ask.proverData]; - - const abicode = new ethers.AbiCoder(); - const encoded = abicode.encode(types, values); - const digest = ethers.keccak256(encoded); - const signature = await newIvsImage.signMessage(ethers.getBytes(digest)); - - await proofMarketplace.flush(await treasury.getAddress()); // remove anything if is already there - - await expect(proofMarketplace.submitProofForInvalidInputs(askId, signature)).to.emit(proofMarketplace, "InvalidInputsDetected"); - }); - - it("Should Fail: can't submit proofs if signature os invalid", async () => { - const signature = - "0x0000111100001111000011110000111100001111000011110000111100001111000011110000111100001111000011110000111100001111000011110000ddddff"; - - await proofMarketplace.flush(await treasury.getAddress()); // remove anything if is already there - - await expect(proofMarketplace.submitProofForInvalidInputs(askId, signature)).to.revertedWithCustomError( - proofMarketplace, - "ECDSAInvalidSignature", - ); - }); - - it("Submit proof for invalid requests, should fail if the image is revoked by market maker", async () => { - await expect(proofMarketplace.connect(marketCreator).removeExtraImages(marketId, [], [newIvsImage.getPcrRlp()])) - .to.emit(entityKeyRegistry, "EnclaveImageRemovedFromFamily") - .withArgs(newIvsImage.getImageId(), ivsFamilyId(marketId)); - - const askData = await proofMarketplace.listOfAsk(askId); - const types = ["uint256", "bytes"]; - - const values = [askId, askData.ask.proverData]; - - const abicode = new ethers.AbiCoder(); - const encoded = abicode.encode(types, values); - const digest = ethers.keccak256(encoded); - const signature = await newIvsImage.signMessage(ethers.getBytes(digest)); - - await proofMarketplace.flush(await treasury.getAddress()); // remove anything if is already there - - await expect(proofMarketplace.submitProofForInvalidInputs(askId, signature)).to.revertedWithCustomError( - entityKeyRegistry, - "AttestationAutherImageNotInFamily", - ); - }); - }); - }); -}); diff --git a/test/ProofMarketPlaceBasic.ts b/test/ProofMarketPlaceBasic.ts deleted file mode 100644 index bbdf06d..0000000 --- a/test/ProofMarketPlaceBasic.ts +++ /dev/null @@ -1,1146 +0,0 @@ -import { BigNumber } from 'bignumber.js'; -import { expect } from 'chai'; -import { Signer } from 'ethers'; -import { - ethers, - upgrades, -} from 'hardhat'; - -import { mine } from '@nomicfoundation/hardhat-network-helpers'; - -import { - bytesToHexString, - generateRandomBytes, - GodEnclavePCRS, - matchingEngineFamilyId, - MockEnclave, - MockGeneratorPCRS, - MockIVSPCRS, - MockMEPCRS, - skipBlocks, -} from '../helpers'; -import { - Dispute__factory, - EntityKeyRegistry, - EntityKeyRegistry__factory, - Error, - Error__factory, - GeneratorRegistry, - GeneratorRegistry__factory, - MockAttestationVerifier__factory, - MockToken, - MockToken__factory, - MockVerifier, - MockVerifier__factory, - ProofMarketplace, - ProofMarketplace__factory, - StakingManager, - StakingManager__factory, - SymbioticStaking, - SymbioticStaking__factory, - SymbioticStakingReward, - SymbioticStakingReward__factory, -} from '../typechain-types'; - -describe("Proof market place", () => { - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let marketCreator: Signer; - - let mockToken: MockToken; - - let tokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(4); - let marketCreationCost: BigNumber = new BigNumber(10).pow(20).multipliedBy(5); - - let generatorStakingAmount = new BigNumber(10).pow(21).multipliedBy(6); - - let minRewardForGenerator = new BigNumber(10).pow(18).multipliedBy(100); - - let stakingManager: StakingManager; - let symbioticStaking: SymbioticStaking; - let symbioticStakingReward: SymbioticStakingReward; - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let entityRegistry: EntityKeyRegistry; - let mockVerifier: MockVerifier; - - let errorLibrary: Error; - - const exponent = new BigNumber(10).pow(18); - const penaltyForNotComputingProof = exponent.div(100).toFixed(0); - - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - const ivsEnclave = new MockEnclave(MockIVSPCRS); - - let matchingEngineSigner: Signer; - - beforeEach(async () => { - signers = await ethers.getSigners(); - admin = signers[1]; - tokenHolder = signers[2]; - treasury = signers[3]; - marketCreator = signers[4]; - - matchingEngineSigner = new ethers.Wallet(matchingEngineEnclave.getPrivateKey(true), admin.provider); - await admin.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); - - errorLibrary = await new Error__factory(admin).deploy(); - - mockToken = await new MockToken__factory(admin).deploy(await tokenHolder.getAddress(), tokenSupply.toFixed(), "Payment Token", "PT"); - mockVerifier = await new MockVerifier__factory(admin).deploy(); - - const SymbioticStaking = await ethers.getContractFactory("SymbioticStaking"); - const _symbioticStaking = await upgrades.deployProxy(SymbioticStaking, [], { - kind: "uups", - initializer: false, - }); - symbioticStaking = SymbioticStaking__factory.connect(await _symbioticStaking.getAddress(), admin); - - const SymbioticStakingReward = await ethers.getContractFactory("SymbioticStakingReward"); - const _symbioticStakingReward = await upgrades.deployProxy(SymbioticStakingReward, [], { - kind: "uups", - initializer: false, - }); - symbioticStakingReward = SymbioticStakingReward__factory.connect(await _symbioticStakingReward.getAddress(), admin); - - const StakingManager = await ethers.getContractFactory("StakingManager"); - const _stakingManager = await upgrades.deployProxy(StakingManager, [], { - kind: "uups", - initializer: false, - }); - stakingManager = StakingManager__factory.connect(await _stakingManager.getAddress(), admin); - - const mockAttestationVerifier = await new MockAttestationVerifier__factory(admin).deploy(); - const EntityKeyRegistryContract = await ethers.getContractFactory("EntityKeyRegistry"); - const _entityKeyRegistry = await upgrades.deployProxy(EntityKeyRegistryContract, [await admin.getAddress(), []], { - kind: "uups", - constructorArgs: [await mockAttestationVerifier.getAddress()], - }); - entityRegistry = EntityKeyRegistry__factory.connect(await _entityKeyRegistry.getAddress(), admin); - - const GeneratorRegistryContract = await ethers.getContractFactory("GeneratorRegistry"); - const generatorProxy = await upgrades.deployProxy(GeneratorRegistryContract, [], { - kind: "uups", - constructorArgs: [await mockToken.getAddress(), await entityRegistry.getAddress()], - initializer: false, - }); - generatorRegistry = GeneratorRegistry__factory.connect(await generatorProxy.getAddress(), signers[0]); - - const ProofMarketplace = await ethers.getContractFactory("ProofMarketplace"); - const proxy = await upgrades.deployProxy(ProofMarketplace, [], { - kind: "uups", - constructorArgs: [ - await mockToken.getAddress(), - marketCreationCost.toString(), - await treasury.getAddress(), - await generatorRegistry.getAddress(), - await entityRegistry.getAddress(), - ], - initializer: false, - }); - - proofMarketplace = ProofMarketplace__factory.connect(await proxy.getAddress(), signers[0]); - - const dispute = await new Dispute__factory(admin).deploy(await entityRegistry.getAddress()); - - await stakingManager.initialize( - await admin.getAddress(), - await proofMarketplace.getAddress(), - await symbioticStaking.getAddress(), - await mockToken.getAddress(), - ); - await stakingManager.grantRole(await stakingManager.GENERATOR_REGISTRY_ROLE(), await generatorRegistry.getAddress()); - await symbioticStaking.initialize( - await admin.getAddress(), - await proofMarketplace.getAddress(), - await stakingManager.getAddress(), - await symbioticStakingReward.getAddress(), - await mockToken.getAddress(), - ); - await symbioticStakingReward.initialize( - await admin.getAddress(), - await proofMarketplace.getAddress(), - await symbioticStaking.getAddress(), - await mockToken.getAddress(), - ); - await generatorRegistry.initialize(await admin.getAddress(), await proofMarketplace.getAddress(), await stakingManager.getAddress()); - await proofMarketplace.initialize(await admin.getAddress()); - - expect(ethers.isAddress(await proofMarketplace.getAddress())).is.true; - await mockToken.connect(tokenHolder).transfer(await marketCreator.getAddress(), marketCreationCost.toFixed()); - - await entityRegistry.connect(admin).grantRole(await entityRegistry.KEY_REGISTER_ROLE(), await proofMarketplace.getAddress()); - - await entityRegistry.connect(admin).grantRole(await entityRegistry.KEY_REGISTER_ROLE(), await generatorRegistry.getAddress()); - - await proofMarketplace.connect(admin).grantRole(await proofMarketplace.UPDATER_ROLE(), await admin.getAddress()); - await proofMarketplace.connect(admin).grantRole(await proofMarketplace.SYMBIOTIC_STAKING_ROLE(), await symbioticStaking.getAddress()); - await proofMarketplace - .connect(admin) - .grantRole(await proofMarketplace.SYMBIOTIC_STAKING_REWARD_ROLE(), await symbioticStakingReward.getAddress()); - }); - - it("Create Market", async () => { - const marketBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 10)); // 10 MB - - const marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).toFixed(); - - await mockToken.connect(marketCreator).approve(await proofMarketplace.getAddress(), marketCreationCost.toFixed()); - - const mockGenerator = new MockEnclave(MockGeneratorPCRS); - - const tx = proofMarketplace - .connect(marketCreator) - .createMarketplace( - marketBytes, - await mockVerifier.getAddress(), - penaltyForNotComputingProof, - mockGenerator.getPcrRlp(), - ivsEnclave.getPcrRlp(), - ); - - await expect(tx) - .to.emit(proofMarketplace, "MarketplaceCreated") - .withArgs(marketId) - .to.emit(entityRegistry, "EnclaveImageWhitelisted") - .withArgs(mockGenerator.getImageId(), ...mockGenerator.pcrs) - .to.emit(entityRegistry, "EnclaveImageWhitelisted") - .withArgs(ivsEnclave.getImageId(), ...ivsEnclave.pcrs); - - expect((await proofMarketplace.marketData(marketId)).verifier).to.eq(await mockVerifier.getAddress()); - }); - - describe("Public Market", () => { - let marketBytes: string; - let marketId: string; - let mockGenerator: MockEnclave; - beforeEach(async () => { - marketBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 10)); // 10 MB - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).toFixed(); - await mockToken.connect(marketCreator).approve(await proofMarketplace.getAddress(), marketCreationCost.toFixed()); - mockGenerator = new MockEnclave(); // pcrs will be 00 - - const tx = proofMarketplace - .connect(marketCreator) - .createMarketplace( - marketBytes, - await mockVerifier.getAddress(), - penaltyForNotComputingProof, - mockGenerator.getPcrRlp(), - ivsEnclave.getPcrRlp(), - ); - - await expect(tx) - .to.emit(proofMarketplace, "MarketplaceCreated") - .withArgs(marketId) - .to.emit(entityRegistry, "EnclaveImageWhitelisted") - .withArgs(ivsEnclave.getImageId(), ...ivsEnclave.pcrs); - }); - - it("Check: Create Public Marketion", async () => { - expect((await proofMarketplace.marketData(marketId)).verifier).to.eq(await mockVerifier.getAddress()); - }); - - it("cant add any provers to public markets as it is not an enclave", async () => { - await expect( - proofMarketplace.connect(marketCreator).addExtraImages(marketId, [mockGenerator.getPcrRlp()], []), - ).to.revertedWithCustomError(proofMarketplace, "CannotModifyImagesForPublicMarkets"); - }); - - it("IVS must be an enclave", async () => { - await expect( - proofMarketplace.connect(marketCreator).addExtraImages(marketId, [], [mockGenerator.getPcrRlp()]), - ).to.revertedWithCustomError(entityRegistry, "MustBeAnEnclave"); - }); - }); - - it("Should Fail: Create Market With non enclave IVS:", async () => { - const marketBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 10)); // 10 MB - - await mockToken.connect(marketCreator).approve(await proofMarketplace.getAddress(), marketCreationCost.toFixed()); - - const mockGenerator = new MockEnclave(MockGeneratorPCRS); - const non_enclave_ivs = new MockEnclave(); - - const tx = proofMarketplace - .connect(marketCreator) - .createMarketplace( - marketBytes, - await mockVerifier.getAddress(), - penaltyForNotComputingProof, - mockGenerator.getPcrRlp(), - non_enclave_ivs.getPcrRlp(), - ); - - await expect(tx).to.revertedWithCustomError(entityRegistry, "MustBeAnEnclave").withArgs(non_enclave_ivs.getImageId()); - }); - - it("Can't create a marketplace if generator/ivs enclave is blacklisted", async () => { - await entityRegistry.connect(admin).grantRole(await entityRegistry.MODERATOR_ROLE(), await admin.getAddress()); - - await entityRegistry.connect(admin).blacklistImage(ivsEnclave.getImageId()); - const marketBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 10)); // 10 MB - - await mockToken.connect(marketCreator).approve(await proofMarketplace.getAddress(), marketCreationCost.toFixed()); - - const tempGenerator = new MockEnclave(MockGeneratorPCRS); - - await expect( - proofMarketplace - .connect(marketCreator) - .createMarketplace( - marketBytes, - await mockVerifier.getAddress(), - penaltyForNotComputingProof, - tempGenerator.getPcrRlp(), - ivsEnclave.getPcrRlp(), - ), - ) - .to.be.revertedWithCustomError(entityRegistry, "BlacklistedImage") - .withArgs(ivsEnclave.getImageId()); - - await entityRegistry.connect(admin).blacklistImage(tempGenerator.getImageId()); - - await expect( - proofMarketplace - .connect(marketCreator) - .createMarketplace( - marketBytes, - await mockVerifier.getAddress(), - penaltyForNotComputingProof, - tempGenerator.getPcrRlp(), - ivsEnclave.getPcrRlp(), - ), - ) - .to.be.revertedWithCustomError(entityRegistry, "BlacklistedImage") - .withArgs(tempGenerator.getImageId()); - }); - - it("Update Marketplace address", async () => { - let attestationBytes = await matchingEngineEnclave.getVerifiedAttestation(matchingEngineEnclave); - - let types = ["bytes", "address"]; - let values = [attestationBytes, await proofMarketplace.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await matchingEngineEnclave.signMessage(ethers.getBytes(digest)); - - await proofMarketplace.connect(admin).setMatchingEngineImage(matchingEngineEnclave.getPcrRlp()); - await proofMarketplace.connect(admin).verifyMatchingEngine(attestationBytes, signature); - - expect( - await entityRegistry.allowOnlyVerifiedFamily( - matchingEngineFamilyId(await proofMarketplace.MATCHING_ENGINE_ROLE()), - matchingEngineEnclave.getAddress(), - ), - ).to.not.be.reverted; - }); - - it("Update Marketplace address with timeout attesation should fail", async () => { - const oldtimestamp = 1000; - let attestationBytes = await matchingEngineEnclave.getVerifiedAttestation(matchingEngineEnclave, oldtimestamp); - - let types = ["bytes", "address"]; - let values = [attestationBytes, await proofMarketplace.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await matchingEngineEnclave.signMessage(ethers.getBytes(digest)); - - await proofMarketplace.connect(admin).setMatchingEngineImage(matchingEngineEnclave.getPcrRlp()); - await expect(proofMarketplace.connect(admin).verifyMatchingEngine(attestationBytes, signature)).to.be.revertedWithCustomError( - entityRegistry, - "AttestationAutherAttestationTooOld", - ); - }); - - describe("Ask: Private Market", () => { - let prover: Signer; - let reward = new BigNumber(10).pow(20).multipliedBy(3); - let marketId: string; - - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 1000; // in blocks - let maxTimeForProofGeneration = 10000; // in blocks - - beforeEach(async () => { - prover = signers[5]; - await mockToken.connect(tokenHolder).transfer(await prover.getAddress(), reward.toFixed()); - - const marketBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 10)); // 10 MB - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).toFixed(); - - await mockToken.connect(marketCreator).approve(await proofMarketplace.getAddress(), marketCreationCost.toFixed()); - - await proofMarketplace - .connect(marketCreator) - .createMarketplace( - marketBytes, - await mockVerifier.getAddress(), - penaltyForNotComputingProof, - new MockEnclave(MockGeneratorPCRS).getPcrRlp(), - ivsEnclave.getPcrRlp(), - ); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }); - - it("Create Ask Request", async () => { - const latestBlock = await ethers.provider.getBlockNumber(); - - const askIdToBeGenerated = await proofMarketplace.askCounter(); - - const proverBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 1)); // 1 MB - const askRequest = { - marketId, - proverData: proverBytes, - reward: reward.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }; - - const secretInfo = "0x2345"; - const aclInfo = "0x21"; - - await proofMarketplace.connect(admin).grantRole(await proofMarketplace.UPDATER_ROLE(), await admin.getAddress()); - await proofMarketplace.connect(admin).updateCostPerBytes(1, 1000); - - const platformFee = await proofMarketplace.getPlatformFee(1, askRequest, secretInfo, aclInfo); - await mockToken.connect(tokenHolder).transfer(await prover.getAddress(), platformFee); - - await mockToken - .connect(prover) - .approve(await proofMarketplace.getAddress(), new BigNumber(platformFee.toString()).plus(reward).toFixed()); - - await expect(proofMarketplace.connect(prover).createAsk(askRequest, 1, secretInfo, aclInfo)) - .to.emit(proofMarketplace, "AskCreated") - .withArgs(askIdToBeGenerated, true, "0x2345", "0x21") - .to.emit(mockToken, "Transfer") - .withArgs(await prover.getAddress(), await proofMarketplace.getAddress(), new BigNumber(platformFee.toString()).plus(reward)); - - expect((await proofMarketplace.listOfAsk(askIdToBeGenerated)).state).to.equal(1); // 1 means create state - }); - }); - describe("Ask: Public Market", () => { - let prover: Signer; - let reward = new BigNumber(10).pow(20).multipliedBy(3); - let marketId: string; - - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 1000; // in blocks - let maxTimeForProofGeneration = 10000; // in blocks - - const computeUnitsRequired = 100; // temporary absolute number - - beforeEach(async () => { - prover = signers[5]; - await mockToken.connect(tokenHolder).transfer(await prover.getAddress(), reward.toFixed()); - - const marketBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 10)); // 10 MB - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).toFixed(); - - await mockToken.connect(marketCreator).approve(await proofMarketplace.getAddress(), marketCreationCost.toFixed()); - - await proofMarketplace.connect(marketCreator).createMarketplace( - marketBytes, - await mockVerifier.getAddress(), - penaltyForNotComputingProof, - new MockEnclave().getPcrRlp(), // no pcrs means not enclave - ivsEnclave.getPcrRlp(), - ); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }); - - it("Create Ask Request", async () => { - const latestBlock = await ethers.provider.getBlockNumber(); - - const askIdToBeGenerated = await proofMarketplace.askCounter(); - - const proverBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 1)); // 1 MB - const askRequest = { - marketId, - proverData: proverBytes, - reward: reward.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }; - - const secretInfo = "0x2345"; - const aclInfo = "0x21"; - - await proofMarketplace.connect(admin).grantRole(await proofMarketplace.UPDATER_ROLE(), await admin.getAddress()); - await proofMarketplace.connect(admin).updateCostPerBytes(1, 1000); - - const platformFee = await proofMarketplace.getPlatformFee(1, askRequest, secretInfo, aclInfo); - await mockToken.connect(tokenHolder).transfer(await prover.getAddress(), platformFee); - - await mockToken - .connect(prover) - .approve(await proofMarketplace.getAddress(), new BigNumber(platformFee.toString()).plus(reward).toFixed()); - - await expect(proofMarketplace.connect(prover).createAsk(askRequest, 1, secretInfo, aclInfo)) - .to.emit(proofMarketplace, "AskCreated") - .withArgs(askIdToBeGenerated, false, "0x", "0x") - .to.emit(mockToken, "Transfer") - .withArgs(await prover.getAddress(), await proofMarketplace.getAddress(), new BigNumber(platformFee.toString()).plus(reward)); - - expect((await proofMarketplace.listOfAsk(askIdToBeGenerated)).state).to.equal(1); // 1 means create state - }); - - it("Should Fail: when try creating market in invalid market", async () => { - await mockToken.connect(prover).approve(await proofMarketplace.getAddress(), reward.toFixed()); - const proverBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 1)); // 1 MB - - const latestBlock = await ethers.provider.getBlockNumber(); - - const marketBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 2)); // 10 MB - const invalidMarketId = ethers.keccak256(marketBytes); - - await expect( - proofMarketplace.connect(prover).createAsk( - { - marketId: invalidMarketId, - proverData: proverBytes, - reward: reward.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - 0, - "0x", - "0x", - ), - ).to.be.revertedWithPanic(0x32); // 0x32 mean array out of bounds // market is not created - }); - - describe("Generator", () => { - let generatorData: string; - let generator: Signer; - - beforeEach(async () => { - generator = await signers[12]; - generatorData = "0x" + bytesToHexString(await generateRandomBytes(1024 * 1)); // 1 MB - await mockToken.connect(tokenHolder).transfer(await generator.getAddress(), generatorStakingAmount.toFixed()); - - // await mockToken.connect(generator).approve(await generatorRegistry.getAddress(), generatorStakingAmount.toFixed()); - // amount locked can be anything, it get overrides within the contract - }); - - it("Check generator data", async () => { - await expect(generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData)) - .to.emit(generatorRegistry, "RegisteredGenerator") - .withArgs(await generator.getAddress(), computeUnitsRequired); - - let generatorEnclave = new MockEnclave(MockGeneratorPCRS); - await expect( - generatorRegistry - .connect(generator) - .joinMarketplace( - marketId, - computeUnitsRequired, - minRewardForGenerator.toFixed(), - 100, - false, - await generatorEnclave.getVerifiedAttestation(generatorEnclave), - "0x", - ), - ) - .to.emit(generatorRegistry, "JoinedMarketplace") - .withArgs(await generator.getAddress(), marketId, computeUnitsRequired); - - const rewardAddress = (await generatorRegistry.generatorRegistry(await generator.getAddress())).rewardAddress; - expect(rewardAddress).to.eq(await generator.getAddress()); - - expect((await generatorRegistry.generatorInfoPerMarket(await generator.getAddress(), marketId)).state).to.eq(1); //1 means JOINED - }); - - it("request for market place exit", async () => { - await generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData); - - await generatorRegistry - .connect(generator) - .joinMarketplace(marketId, computeUnitsRequired, minRewardForGenerator.toFixed(), 100, false, "0x", "0x"); - - await expect(generatorRegistry.connect(generator).requestForExitMarketplace(marketId)) - .to.emit(generatorRegistry, "RequestExitMarketplace") - .withArgs(await generator.getAddress(), marketId) - .to.emit(generatorRegistry, "LeftMarketplace") - .withArgs(await generator.getAddress(), marketId); - }); - - it("request for market place exit: array", async () => { - await generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData); - - await generatorRegistry - .connect(generator) - .joinMarketplace(marketId, computeUnitsRequired, minRewardForGenerator.toFixed(), 100, false, "0x", "0x"); - - await expect(generatorRegistry.connect(generator).requestForExitMarketplaces([marketId])) - .to.emit(generatorRegistry, "RequestExitMarketplace") - .withArgs(await generator.getAddress(), marketId); - }); - - it("leave market place", async () => { - await generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData); - - await generatorRegistry - .connect(generator) - .joinMarketplace(marketId, computeUnitsRequired, minRewardForGenerator.toFixed(), 100, false, "0x", "0x"); - - await expect(generatorRegistry.connect(generator).leaveMarketplace(marketId)) - .to.emit(generatorRegistry, "LeftMarketplace") - .withArgs(await generator.getAddress(), marketId); - }); - - it("leave multiple markets", async () => { - await generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData); - - await generatorRegistry - .connect(generator) - .joinMarketplace(marketId, computeUnitsRequired, minRewardForGenerator.toFixed(), 100, false, "0x", "0x"); - - await expect(generatorRegistry.connect(generator).leaveMarketplaces([marketId])) - .to.emit(generatorRegistry, "LeftMarketplace") - .withArgs(await generator.getAddress(), marketId); - }); - - it("Can't de-register if generator is active part of proof market", async () => { - await generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData); - - await generatorRegistry - .connect(generator) - .joinMarketplace(marketId, computeUnitsRequired, minRewardForGenerator.toFixed(), 100, false, "0x", "0x"); - - await expect(generatorRegistry.connect(generator).deregister()).to.be.revertedWithCustomError( - errorLibrary, - "CannotLeaveWithActiveMarket", - ); - }); - - it("Deregister generator data", async () => { - await generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData); - - await expect(generatorRegistry.connect(generator).deregister()) - .to.emit(generatorRegistry, "DeregisteredGenerator") - .withArgs(await generator.getAddress()); - }); - - // it("extra stash can be added to generator by anyone", async () => { - // await generatorRegistry - // .connect(generator) - // .register(await generator.getAddress(), computeUnitsRequired, generatorData); - - // const extraStash = "112987298347983"; - // await mockToken.connect(tokenHolder).approve(await generatorRegistry.getAddress(), extraStash); - - // await expect(generatorRegistry.connect(tokenHolder).stake(await generator.getAddress(), extraStash)) - // .to.emit(generatorRegistry, "AddedStake") - // .withArgs(await generator.getAddress(), extraStash) - // .to.emit(mockToken, "Transfer") - // .withArgs(await tokenHolder.getAddress(), await generatorRegistry.getAddress(), extraStash); - // }); - - describe("Generator After Staking", () => { - const extraStash = "112987298347983"; - beforeEach(async () => { - await generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData); - - await mockToken.connect(tokenHolder).approve(await generatorRegistry.getAddress(), extraStash); - - // await expect(generatorRegistry.connect(tokenHolder).stake(await generator.getAddress(), extraStash)) - // .to.emit(generatorRegistry, "AddedStake") - // .withArgs(await generator.getAddress(), extraStash) - // .to.emit(mockToken, "Transfer") - // .withArgs(await tokenHolder.getAddress(), await generatorRegistry.getAddress(), extraStash); - }); - - // it("unstake should fail without request", async () => { - // await expect(generatorRegistry.connect(generator).unstake(await generator.getAddress())).to.be.revertedWithCustomError( - // errorLibrary, - // "UnstakeRequestNotInPlace", - // ); - // }); - - it("Decrease Compute should fail without request", async () => { - await expect(generatorRegistry.connect(generator).decreaseDeclaredCompute()).to.be.revertedWithCustomError( - errorLibrary, - "ReduceComputeRequestNotInPlace", - ); - }); - - // describe("Request to Decrease Stake", () => { - // const updatedGeneratorStakingAmount = generatorStakingAmount.plus(extraStash); - - // const stakeToReduce = updatedGeneratorStakingAmount.multipliedBy(9).div(10); - // const expectedNewTotalStake = updatedGeneratorStakingAmount.minus(stakeToReduce); - // const newUtilization = expectedNewTotalStake.multipliedBy(exponent).dividedBy(updatedGeneratorStakingAmount).minus(1); // to offset the uint256 thing in solidity - - // beforeEach(async () => { - // await expect(generatorRegistry.connect(generator).intendToReduceStake(stakeToReduce.toFixed(0))) - // .to.emit(generatorRegistry, "RequestStakeDecrease") - // .withArgs(await generator.getAddress(), newUtilization.toFixed(0)); - // }); - - // it("Generator utilization check and unstake", async () => { - // const generatorData = await generatorRegistry.generatorRegistry(await generator.getAddress()); - // expect(generatorData.intendedStakeUtilization).to.eq(newUtilization); - - // const totalStakeBefore = generatorData.totalStake; - // const expectedStakeAfter = new BigNumber(totalStakeBefore.toString()).multipliedBy(newUtilization).div(exponent); - // const expectedAmountRelease = new BigNumber(totalStakeBefore.toString()).minus(expectedStakeAfter).toFixed(0); - - // await expect(generatorRegistry.connect(generator).unstake(await generator.getAddress())) - // .to.emit(generatorRegistry, "RemovedStake") - // .withArgs(await generator.getAddress(), expectedAmountRelease) - // .to.emit(mockToken, "Transfer") - // .withArgs(await generatorRegistry.getAddress(), await generator.getAddress(), expectedAmountRelease); - // }); - - // it("Should fail if unstake is called more than once per request", async () => { - // await generatorRegistry.connect(generator).unstake(await generator.getAddress()); - // await expect(generatorRegistry.connect(generator).unstake(await generator.getAddress())).to.be.revertedWithCustomError( - // errorLibrary, - // "UnstakeRequestNotInPlace", - // ); - // }); - // }); - - describe("Request to reduce compute", () => { - const computeToReduce = new BigNumber(computeUnitsRequired).multipliedBy(9).div(10).toFixed(0); - const newUtilization = exponent.dividedBy(10); // should be 10% of if compute is reduced by 90% - beforeEach(async () => { - await expect(generatorRegistry.connect(generator).intendToReduceCompute(computeToReduce)) - .to.emit(generatorRegistry, "RequestComputeDecrease") - .withArgs(await generator.getAddress(), newUtilization.toFixed(0)); - }); - - it("Generator utilization check and reduce compute", async () => { - const generatorData = await generatorRegistry.generatorRegistry(await generator.getAddress()); - expect(generatorData.intendedComputeUtilization).to.eq(newUtilization); - - const totalComputeBefore = generatorData.declaredCompute; - const expectedComputeAfter = new BigNumber(totalComputeBefore.toString()).multipliedBy(newUtilization).div(exponent); - const expectedComputeToRelease = new BigNumber(totalComputeBefore.toString()).minus(expectedComputeAfter).toFixed(0); - - await expect(generatorRegistry.connect(generator).decreaseDeclaredCompute()) - .to.emit(generatorRegistry, "DecreaseCompute") - .withArgs(await generator.getAddress(), expectedComputeToRelease); - }); - - it("Should fail if decrease compute is called more than once per request", async () => { - await generatorRegistry.connect(generator).decreaseDeclaredCompute(); - await expect(generatorRegistry.connect(generator).decreaseDeclaredCompute()).to.be.revertedWithCustomError( - errorLibrary, - "ReduceComputeRequestNotInPlace", - ); - }); - }); - }); - - describe("Task", () => { - let proverBytes: string; - let latestBlock: number; - - let askId: BigNumber; - beforeEach(async () => { - proverBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 1)); // 1 MB - latestBlock = await ethers.provider.getBlockNumber(); - - let meAttestationBytes = await matchingEngineEnclave.getVerifiedAttestation(matchingEngineEnclave); - - let types = ["bytes", "address"]; - let values = [meAttestationBytes, await proofMarketplace.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await matchingEngineEnclave.signMessage(ethers.getBytes(digest)); - - await proofMarketplace.connect(admin).setMatchingEngineImage(matchingEngineEnclave.getPcrRlp()); - await proofMarketplace.connect(admin).verifyMatchingEngine(meAttestationBytes, signature); - - askId = new BigNumber((await proofMarketplace.askCounter()).toString()); - - await mockToken.connect(prover).approve(await proofMarketplace.getAddress(), reward.toFixed()); - await proofMarketplace.connect(prover).createAsk( - { - marketId, - proverData: proverBytes, - reward: reward.toFixed(), - expiry: latestBlock + assignmentExpiry, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - 0, - "0x", - "0x", - ); - - await generatorRegistry.connect(generator).register(await generator.getAddress(), computeUnitsRequired, generatorData); - - await generatorRegistry - .connect(generator) - .joinMarketplace(marketId, computeUnitsRequired, minRewardForGenerator.toFixed(), 100, false, "0x", "0x"); - }); - - it("Can't discard request before assignment (by anyone)", async () => { - await expect(proofMarketplace.connect(generator).discardRequest(askId.toString())) - .to.revertedWithCustomError(proofMarketplace, "ShouldBeInAssignedState") - .withArgs(askId); - - await expect(proofMarketplace.connect(treasury).discardRequest(askId.toString())) - .to.revertedWithCustomError(proofMarketplace, "ShouldBeInAssignedState") - .withArgs(askId); - }); - - it("Matching engine assignment", async () => { - await expect(proofMarketplace.connect(matchingEngineSigner).assignTask(askId.toString(), await generator.getAddress(), "0x1234")) - .to.emit(proofMarketplace, "TaskCreated") - .withArgs(askId, await generator.getAddress(), "0x1234") - .to.emit(generatorRegistry, "ComputeLockImposed") - .withArgs(await generator.getAddress(), computeUnitsRequired); - - expect((await proofMarketplace.listOfAsk(askId.toString())).state).to.eq(3); // 3 means ASSIGNED - - // in store it will be 1 - expect((await generatorRegistry.generatorInfoPerMarket(await generator.getAddress(), marketId)).state).to.eq(1); - - // but via function it should be 2 - const data = await generatorRegistry.getGeneratorState(await generator.getAddress(), marketId); - expect(data[0]).to.eq(2); - }); - - it("Matching Engine should assign using relayers [multiple tasks]", async () => { - const types = ["uint256[]", "address[]", "bytes[]"]; - - const values = [[askId.toFixed(0)], [await generator.getAddress()], ["0x1234"]]; - - const abicode = new ethers.AbiCoder(); - const encoded = abicode.encode(types, values); - const digest = ethers.keccak256(encoded); - const signature = await matchingEngineEnclave.signMessage(ethers.getBytes(digest)); - - const someRandomRelayer = admin; - - await expect( - proofMarketplace - .connect(someRandomRelayer) - .relayBatchAssignTasks([askId.toString()], [await generator.getAddress()], ["0x1234"], signature), - ) - .to.emit(proofMarketplace, "TaskCreated") - .withArgs(askId, await generator.getAddress(), "0x1234"); - - expect((await proofMarketplace.listOfAsk(askId.toString())).state).to.eq(3); // 3 means ASSIGNED - - // in store it will be 1 - expect((await generatorRegistry.generatorInfoPerMarket(await generator.getAddress(), marketId)).state).to.eq(1); - - // but via function it should be 2 - const data = await generatorRegistry.getGeneratorState(await generator.getAddress(), marketId); - expect(data[0]).to.eq(2); - }); - - it("Matching Engine can't assign more than vcpus", async () => { - await proofMarketplace.connect(matchingEngineSigner).assignTask(askId.toString(), await generator.getAddress(), "0x1234"); - - let anotherAskId = new BigNumber((await proofMarketplace.askCounter()).toString()); - let anotherProverBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 1)); // 1 MB - - await mockToken.connect(tokenHolder).transfer(await prover.getAddress(), reward.toFixed()); - await mockToken.connect(prover).approve(await proofMarketplace.getAddress(), reward.toFixed()); - await proofMarketplace.connect(prover).createAsk( - { - marketId, - proverData: anotherProverBytes, - reward: reward.toFixed(), - expiry: latestBlock + assignmentExpiry, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - 0, - "0x", - "0x", - ); - - await expect( - proofMarketplace.connect(matchingEngineSigner).assignTask(anotherAskId.toString(), await generator.getAddress(), "0x1234"), - ).to.be.revertedWithCustomError(errorLibrary, "AssignOnlyToIdleGenerators"); - }); - - it("Should fail: Matching engine will not be able to assign task if ask is expired", async () => { - await mine(assignmentExpiry); - await expect( - proofMarketplace.connect(matchingEngineSigner).assignTask(askId.toString(), await generator.getAddress(), "0x"), - ).to.be.revertedWithCustomError(errorLibrary, "ShouldBeInCreateState"); - }); - - it("Can cancel ask once the ask is expired", async () => { - await mine(assignmentExpiry); - await expect(proofMarketplace.connect(admin).cancelAsk(askId.toString())) - .to.emit(proofMarketplace, "AskCancelled") - .withArgs(askId); - - // await expect(proofMarketplace.flush(await prover.getAddress())) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), await prover.getAddress(), reward.toFixed()); - }); - - it("Matching can't assign task if it image is blacklisted by moderator", async () => { - await entityRegistry.connect(admin).grantRole(await entityRegistry.MODERATOR_ROLE(), await admin.getAddress()); - await entityRegistry.connect(admin).blacklistImage(matchingEngineEnclave.getImageId()); - - await expect( - proofMarketplace.connect(matchingEngineSigner).assignTask(askId.toString(), await generator.getAddress(), "0x"), - ).to.be.revertedWithCustomError(entityRegistry, "AttestationAutherImageNotWhitelisted"); - }); - - it("Matching can't assign task if it image is removed from family", async () => { - await entityRegistry.connect(admin).grantRole(await entityRegistry.KEY_REGISTER_ROLE(), await admin.getAddress()); - await entityRegistry - .connect(admin) - .removeEnclaveImageFromFamily( - matchingEngineEnclave.getImageId(), - matchingEngineFamilyId(await proofMarketplace.MATCHING_ENGINE_ROLE()), - ); - - await expect( - proofMarketplace.connect(matchingEngineSigner).assignTask(askId.toString(), await generator.getAddress(), "0x"), - ).to.be.revertedWithCustomError(entityRegistry, "AttestationAutherImageNotInFamily"); - }); - - describe("Submit Proof", () => { - let proof: string; - let newIvsEnclave: MockEnclave; - - beforeEach(async () => { - newIvsEnclave = new MockEnclave(MockIVSPCRS); - proof = "0x" + bytesToHexString(await generateRandomBytes(1024 * 1)); // 1 MB - - await proofMarketplace.connect(matchingEngineSigner).assignTask(askId.toString(), await generator.getAddress(), "0x"); - - // generator should register his ivs for invalid inputs - await updateIvsKey(newIvsEnclave); - }); - - const updateIvsKey = async (ivsEnclave: MockEnclave) => { - // use any enclave here as AV is mocked - const noUseEnclave = new MockEnclave([MockIVSPCRS[2], MockGeneratorPCRS[2], GodEnclavePCRS[2]]); - let ivsAttestationBytes = await ivsEnclave.getVerifiedAttestation(noUseEnclave); // means ivs should get verified attestation from noUseEnclave - - let types = ["bytes", "address"]; - let values = [ivsAttestationBytes, await generator.getAddress()]; - - let abicode = new ethers.AbiCoder(); - let encoded = abicode.encode(types, values); - let digest = ethers.keccak256(encoded); - let signature = await ivsEnclave.signMessage(ethers.getBytes(digest)); - - // console.log("let ivs_attestation = \""+ivsAttestationBytes+"\";") - // console.log("let expected_signature = \""+signature+"\";") - // console.log("let recovery_address = \""+ivsEnclave.getAddress()+"\";") - // console.log("let private_key = \""+ivsEnclave.getPrivateKey(true)+"\";") - // console.log("let address_to_sign = \""+await generator.getAddress()+"\";") - - // use any enclave to get verfied attestation as mockAttesationVerifier is used here - await expect(generatorRegistry.connect(generator).addIvsKey(marketId, ivsAttestationBytes, signature)) - .to.emit(generatorRegistry, "AddIvsKey") - .withArgs(marketId, ivsEnclave.getAddress()); - }; - - it("submit proof", async () => { - const generatorAddress = await generator.getAddress(); - const expectedGeneratorReward = (await generatorRegistry.generatorInfoPerMarket(generatorAddress, marketId)) - .proofGenerationCost; - const proverRefundAddress = await prover.getAddress(); - const expectedProverRefund = new BigNumber(reward).minus(expectedGeneratorReward.toString()); - - await expect(proofMarketplace.submitProof(askId.toString(), proof)) - .to.emit(proofMarketplace, "ProofCreated") - .withArgs(askId, proof) - .to.emit(generatorRegistry, "ComputeLockReleased") - .withArgs(await generator.getAddress(), computeUnitsRequired); - - // await expect(proofMarketplace.flush(generatorAddress)) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), generatorAddress, expectedGeneratorReward); - - // await expect(proofMarketplace.flush(proverRefundAddress)) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), proverRefundAddress, expectedProverRefund); - - expect((await proofMarketplace.listOfAsk(askId.toString())).state).to.eq(4); // 4 means COMPLETE - expect((await generatorRegistry.generatorInfoPerMarket(await generator.getAddress(), marketId)).state).to.eq(1); // 1 means JOINED and idle now - }); - - it("Submit Proof via array", async () => { - const generatorAddress = await generator.getAddress(); - const expectedGeneratorReward = (await generatorRegistry.generatorInfoPerMarket(generatorAddress, marketId)) - .proofGenerationCost; - const proverRefundAddress = await prover.getAddress(); - const expectedProverRefund = new BigNumber(reward).minus(expectedGeneratorReward.toString()); - - await expect(proofMarketplace.submitProofs([askId.toString()], [proof])) - .to.emit(proofMarketplace, "ProofCreated") - .withArgs(askId, proof); - - // await expect(proofMarketplace.flush(generatorAddress)) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), generatorAddress, expectedGeneratorReward); - - // await expect(proofMarketplace.flush(proverRefundAddress)) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), proverRefundAddress, expectedProverRefund); - - expect((await proofMarketplace.listOfAsk(askId.toString())).state).to.eq(4); // 4 means COMPLETE - expect((await generatorRegistry.generatorInfoPerMarket(await generator.getAddress(), marketId)).state).to.eq(1); // 1 means JOINED and idle now - }); - - it("Submit Proof for invalid request: using own ivs", async () => { - const askData = await proofMarketplace.listOfAsk(askId.toFixed(0)); - const types = ["uint256", "bytes"]; - - const values = [askId.toFixed(0), askData.ask.proverData]; - - const abicode = new ethers.AbiCoder(); - const encoded = abicode.encode(types, values); - const digest = ethers.keccak256(encoded); - const signature = await newIvsEnclave.signMessage(ethers.getBytes(digest)); - - const generatorAddress = await generator.getAddress(); - const expectedGeneratorReward = (await generatorRegistry.generatorInfoPerMarket(generatorAddress, marketId)) - .proofGenerationCost; - const treasuryRefundAddress = await treasury.getAddress(); - const expectedRefund = new BigNumber(reward).minus(expectedGeneratorReward.toString()); - - await proofMarketplace.flush(await treasury.getAddress()); // remove anything if is already there - - await expect(proofMarketplace.submitProofForInvalidInputs(askId.toFixed(0), signature)) - .to.emit(proofMarketplace, "InvalidInputsDetected") - .withArgs(askId); - - // await expect(proofMarketplace.flush(generatorAddress)) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), generatorAddress, expectedGeneratorReward); - - // await expect(proofMarketplace.flush(await treasury.getAddress())) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), treasuryRefundAddress, expectedRefund); - }); - - it("Submit Proof for invalid request, from another ivs enclave with same image id", async () => { - const askData = await proofMarketplace.listOfAsk(askId.toFixed(0)); - const types = ["uint256", "bytes"]; - - const values = [askId.toFixed(0), askData.ask.proverData]; - - const abicode = new ethers.AbiCoder(); - const encoded = abicode.encode(types, values); - const digest = ethers.keccak256(encoded); - const anotherIvsEnclave = new MockEnclave(MockIVSPCRS); - const signature = await anotherIvsEnclave.signMessage(ethers.getBytes(digest)); - - const generatorAddress = await generator.getAddress(); - const expectedGeneratorReward = (await generatorRegistry.generatorInfoPerMarket(generatorAddress, marketId)) - .proofGenerationCost; - const treasuryRefundAddress = await treasury.getAddress(); - const expectedRefund = new BigNumber(reward).minus(expectedGeneratorReward.toString()); - - await proofMarketplace.flush(await treasury.getAddress()); // remove anything if is already there - - // because enclave key for new enclave is not verified yet - await expect(proofMarketplace.submitProofForInvalidInputs(askId.toFixed(0), signature)).to.be.revertedWithCustomError( - entityRegistry, - "AttestationAutherKeyNotVerified", - ); - await updateIvsKey(anotherIvsEnclave); - - await expect(proofMarketplace.submitProofForInvalidInputs(askId.toFixed(0), signature)) - .to.emit(proofMarketplace, "InvalidInputsDetected") - .withArgs(askId); - - // await expect(proofMarketplace.flush(generatorAddress)) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), generatorAddress, expectedGeneratorReward); - - // await expect(proofMarketplace.flush(await treasury.getAddress())) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), treasuryRefundAddress, expectedRefund); - }); - - it("Generator can ignore the request", async () => { - await expect(proofMarketplace.connect(generator).discardRequest(askId.toString())) - .to.emit(proofMarketplace, "ProofNotGenerated") - .withArgs(askId); - // await expect(proofMarketplace.flush(await prover.getAddress())) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), await prover.getAddress(), reward.toFixed(0)); - }); - - it("Should Fail: No one other than generator discard his own request", async () => { - await expect(proofMarketplace.connect(treasury).discardRequest(askId.toString())) - .to.revertedWithCustomError(proofMarketplace, "OnlyGeneratorCanDiscardRequest") - .withArgs(askId); - }); - - // it("Can't slash request before deadline", async () => { - // await expect( - // proofMarketplace.connect(admin).slashGenerator(askId.toString(), await admin.getAddress()), - // ).to.be.revertedWithCustomError(errorLibrary, "ShouldBeInCrossedDeadlineState"); - // }); - - describe("Failed submiited proof", () => { - let slasher: Signer; - - beforeEach(async () => { - slasher = signers[19]; - await mine(maxTimeForProofGeneration); - }); - - it("State should be deadline crossed", async () => { - expect(await proofMarketplace.getAskState(askId.toString())).to.eq(5); // 5 means deadline crossed - }); - - it("Generator can't discard request when deadline crossed", async () => { - await expect(proofMarketplace.connect(generator).discardRequest(askId.toString())) - .to.revertedWithCustomError(proofMarketplace, "ShouldBeInAssignedState") - .withArgs(askId); - }); - - // it("When deadline is crossed, it is slashable by anyone", async () => { - // await expect(proofMarketplace.connect(admin).slashGenerator(askId.toString(), await admin.getAddress())) - // .to.emit(proofMarketplace, "ProofNotGenerated") - // .withArgs(askId); - - // await expect(proofMarketplace.flush(await prover.getAddress())) - // .to.emit(mockToken, "Transfer") - // .withArgs(await proofMarketplace.getAddress(), await prover.getAddress(), reward.toFixed(0)); - // }); - - it("Should fail: Submit proof after deadline", async () => { - await expect(proofMarketplace.submitProofs([askId.toString()], [proof])) - .to.revertedWithCustomError(proofMarketplace, "OnlyAssignedAsksCanBeProved") - .withArgs(askId); - }); - }); - }); - }); - }); - }); -}); diff --git a/test/ProorMarketPlaceWithCircomVerifier.ts b/test/ProorMarketPlaceWithCircomVerifier.ts deleted file mode 100644 index b6ff06e..0000000 --- a/test/ProorMarketPlaceWithCircomVerifier.ts +++ /dev/null @@ -1,205 +0,0 @@ -import { expect } from "chai"; -import { ethers, upgrades } from "hardhat"; -import { Signer } from "ethers"; -import { BigNumber } from "bignumber.js"; -import { - GeneratorRegistry, - IVerifier, - IVerifier__factory, - MockToken, - ProofMarketplace, - XorVerifier__factory, - Xor2_verifier_wrapper__factory, - PriorityLog, - Error, - EntityKeyRegistry, -} from "../typechain-types"; - -import { - GeneratorData, - GodEnclavePCRS, - MarketData, - MockEnclave, - MockGeneratorPCRS, - MockIVSPCRS, - MockMEPCRS, - generatorDataToBytes, - marketDataToBytes, - setup, - skipBlocks, -} from "../helpers"; - -import * as circom_verifier_inputs from "../helpers/sample/circomVerifier/input.json"; -import * as circom_verifier_proof from "../helpers/sample/circomVerifier/proof.json"; - -describe("Proof Market Place for Circom Verifier", () => { - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let tokenToUse: MockToken; - let priorityLog: PriorityLog; - let errorLibrary: Error; - let entityKeyRegistry: EntityKeyRegistry; - - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let prover: Signer; - let generator: Signer; - - let marketCreator: Signer; - let marketSetupData: MarketData; - let marketId: string; - - let generatorData: GeneratorData; - - let iverifier: IVerifier; - - const ivsEnclave = new MockEnclave(MockIVSPCRS); - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - const godEnclave = new MockEnclave(GodEnclavePCRS); - - const totalTokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(9); - const generatorStakingAmount: BigNumber = new BigNumber(10).pow(18).multipliedBy(1000).multipliedBy(2).minus(1231); // use any random number - const generatorSlashingPenalty: BigNumber = new BigNumber(10).pow(16).multipliedBy(93).minus(182723423); // use any random number - const marketCreationCost: BigNumber = new BigNumber(10).pow(18).multipliedBy(1213).minus(23746287365); // use any random number - - const rewardForProofGeneration = new BigNumber(10).pow(18).multipliedBy(200); - const minRewardByGenerator = new BigNumber(10).pow(18).multipliedBy(199); - const generatorComputeAllocation = new BigNumber(10).pow(19).minus("12782387").div(123).multipliedBy(98); - - const computeGivenToNewMarket = new BigNumber(10).pow(19).minus("98897").div(9233).multipliedBy(98); - - beforeEach(async () => { - signers = await ethers.getSigners(); - admin = signers[0]; - tokenHolder = signers[1]; - treasury = signers[2]; - marketCreator = signers[3]; - prover = signers[4]; - generator = signers[5]; - - marketSetupData = { - zkAppName: "circom addition", - proverCode: "url of the prover code", - verifierCode: "url of the verifier code", - proverOysterImage: "oyster image link for the prover", - setupCeremonyData: ["first phase", "second phase", "third phase"], - inputOuputVerifierUrl: "this should be nclave url", - }; - - generatorData = { - name: "some custom name for the generator", - }; - - const circomVerifier = await new XorVerifier__factory(admin).deploy(); - let abiCoder = new ethers.AbiCoder(); - let inputBytes = abiCoder.encode(["uint[1]"], [[circom_verifier_inputs[0]]]); - let proofBytes = abiCoder.encode( - ["uint[2]", "uint[2][2]", "uint[2]"], - [circom_verifier_proof[0], circom_verifier_proof[1], circom_verifier_proof[2]], - ); - - const circomVerifierWrapper = await new Xor2_verifier_wrapper__factory(admin).deploy( - await circomVerifier.getAddress(), - inputBytes, - proofBytes, - ); - - iverifier = IVerifier__factory.connect(await circomVerifierWrapper.getAddress(), admin); - - let treasuryAddress = await treasury.getAddress(); - await treasury.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); - - let data = await setup.rawSetup( - admin, - tokenHolder, - totalTokenSupply, - generatorStakingAmount, - generatorSlashingPenalty, - treasuryAddress, - marketCreationCost, - marketCreator, - marketDataToBytes(marketSetupData), - marketSetupData.inputOuputVerifierUrl, - iverifier, - generator, - generatorDataToBytes(generatorData), - ivsEnclave, - matchingEngineEnclave, - generatorEnclave, - minRewardByGenerator, - generatorComputeAllocation, - computeGivenToNewMarket, - godEnclave, - ); - proofMarketplace = data.proofMarketplace; - generatorRegistry = data.generatorRegistry; - tokenToUse = data.mockToken; - priorityLog = data.priorityLog; - errorLibrary = data.errorLibrary; - entityKeyRegistry = data.entityKeyRegistry; - - await circomVerifierWrapper.setProofMarketplaceContract(await proofMarketplace.getAddress()); - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).minus(1).toFixed(); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }); - it("Check circom verifier", async () => { - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode(["uint[1]"], [[circom_verifier_inputs[0]]]); - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - let proofBytes = abiCoder.encode( - ["uint[2]", "uint[2][2]", "uint[2]"], - [circom_verifier_proof[0], circom_verifier_proof[1], circom_verifier_proof[2]], - ); - await expect(proofMarketplace.submitProof(askId, proofBytes)).to.emit(proofMarketplace, "ProofCreated").withArgs(askId, proofBytes); - }); -}); diff --git a/test/ProorMarketPlaceWithPlonk.ts b/test/ProorMarketPlaceWithPlonk.ts deleted file mode 100644 index e5ef08a..0000000 --- a/test/ProorMarketPlaceWithPlonk.ts +++ /dev/null @@ -1,202 +0,0 @@ -import { expect } from "chai"; -import { ethers, upgrades } from "hardhat"; -import { Signer } from "ethers"; -import { BigNumber } from "bignumber.js"; -import { - GeneratorRegistry, - IVerifier, - IVerifier__factory, - MockToken, - PriorityLog, - ProofMarketplace, - UltraVerifier__factory, - Plonk_verifier_wrapper__factory, - Error, - EntityKeyRegistry, -} from "../typechain-types"; - -import { - GeneratorData, - GodEnclavePCRS, - MarketData, - MockEnclave, - MockGeneratorPCRS, - MockIVSPCRS, - MockMEPCRS, - generatorDataToBytes, - marketDataToBytes, - setup, - skipBlocks, -} from "../helpers"; -import * as fs from "fs"; - -import { a as plonkInputs } from "../helpers/sample/plonk/verification_params.json"; -const plonkProof = "0x" + fs.readFileSync("helpers/sample/plonk/p.proof", "utf-8"); - -describe("Proof Market Place for Plonk Verifier", () => { - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let tokenToUse: MockToken; - let priorityLog: PriorityLog; - let errorLibrary: Error; - let entityKeyRegistry: EntityKeyRegistry; - - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let prover: Signer; - let generator: Signer; - - let marketCreator: Signer; - let marketSetupData: MarketData; - let marketId: string; - - let generatorData: GeneratorData; - - let iverifier: IVerifier; - - const ivsEnclave = new MockEnclave(MockIVSPCRS); - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - const godEnclave = new MockEnclave(GodEnclavePCRS); - - const totalTokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(9); - const generatorStakingAmount: BigNumber = new BigNumber(10).pow(18).multipliedBy(1000).multipliedBy(2).minus(1231); // use any random number - const generatorSlashingPenalty: BigNumber = new BigNumber(10).pow(16).multipliedBy(93).minus(182723423); // use any random number - const marketCreationCost: BigNumber = new BigNumber(10).pow(18).multipliedBy(1213).minus(23746287365); // use any random number - const generatorComputeAllocation = new BigNumber(10).pow(19).minus("12782387").div(123).multipliedBy(98); - - const computeGivenToNewMarket = new BigNumber(10).pow(19).minus("98897").div(9233).multipliedBy(98); - - const rewardForProofGeneration = new BigNumber(10).pow(18).multipliedBy(200); - const minRewardByGenerator = new BigNumber(10).pow(18).multipliedBy(199); - - beforeEach(async () => { - signers = await ethers.getSigners(); - admin = signers[0]; - tokenHolder = signers[1]; - treasury = signers[2]; - marketCreator = signers[3]; - prover = signers[4]; - generator = signers[5]; - - marketSetupData = { - zkAppName: "plonk verifier", - proverCode: "url of the prover code", - verifierCode: "url of the verifier code", - proverOysterImage: "oyster image link for the prover", - setupCeremonyData: ["first phase", "second phase", "third phase"], - inputOuputVerifierUrl: "this should be nclave url", - }; - - generatorData = { - name: "some custom name for the generator", - }; - - const plonkVerifier = await new UltraVerifier__factory(admin).deploy(); - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode(["bytes32[]"], [[plonkInputs]]); - let proofBytes = abiCoder.encode(["bytes"], [plonkProof]); - - const plonkVerifierWrapper = await new Plonk_verifier_wrapper__factory(admin).deploy( - await plonkVerifier.getAddress(), - inputBytes, - proofBytes, - ); - - iverifier = IVerifier__factory.connect(await plonkVerifierWrapper.getAddress(), admin); - - let treasuryAddress = await treasury.getAddress(); - await treasury.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); - - let data = await setup.rawSetup( - admin, - tokenHolder, - totalTokenSupply, - generatorStakingAmount, - generatorSlashingPenalty, - treasuryAddress, - marketCreationCost, - marketCreator, - marketDataToBytes(marketSetupData), - marketSetupData.inputOuputVerifierUrl, - iverifier, - generator, - generatorDataToBytes(generatorData), - ivsEnclave, - matchingEngineEnclave, - generatorEnclave, - minRewardByGenerator, - generatorComputeAllocation, - computeGivenToNewMarket, - godEnclave, - ); - proofMarketplace = data.proofMarketplace; - generatorRegistry = data.generatorRegistry; - tokenToUse = data.mockToken; - priorityLog = data.priorityLog; - errorLibrary = data.errorLibrary; - entityKeyRegistry = data.entityKeyRegistry; - - await plonkVerifierWrapper.setProofMarketplaceContract(await proofMarketplace.getAddress()); - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).minus(1).toFixed(); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }); - it("Check plonk verifier", async () => { - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode(["bytes32[]"], [[plonkInputs]]); - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - // console.log({ plonkProof }); - let proofBytes = abiCoder.encode(["bytes"], [plonkProof]); - await expect(proofMarketplace.submitProof(askId, proofBytes)).to.emit(proofMarketplace, "ProofCreated").withArgs(askId, proofBytes); - }); -}); diff --git a/test/ProorMarketPlaceWithTransferVerifier.ts b/test/ProorMarketPlaceWithTransferVerifier.ts deleted file mode 100644 index 80eaffc..0000000 --- a/test/ProorMarketPlaceWithTransferVerifier.ts +++ /dev/null @@ -1,251 +0,0 @@ -import { expect } from "chai"; -import { ethers, upgrades } from "hardhat"; -import { Signer } from "ethers"; -import { BigNumber } from "bignumber.js"; -import { - EntityKeyRegistry, - Error, - GeneratorRegistry, - IVerifier, - IVerifier__factory, - MockToken, - PriorityLog, - ProofMarketplace, - TransferVerifier__factory, - Transfer_verifier_wrapper__factory, -} from "../typechain-types"; - -import { - GeneratorData, - GodEnclavePCRS, - MarketData, - MockEnclave, - MockGeneratorPCRS, - MockIVSPCRS, - MockMEPCRS, - generatorDataToBytes, - marketDataToBytes, - setup, - skipBlocks, -} from "../helpers"; - -import * as transfer_verifier_inputs from "../helpers/sample/transferVerifier/transfer_inputs.json"; -import * as transfer_verifier_proof from "../helpers/sample/transferVerifier/transfer_proof.json"; - -describe("Proof Market Place for Transfer Verifier", () => { - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let tokenToUse: MockToken; - let priorityLog: PriorityLog; - let errorLibrary: Error; - let entityKeyRegistry: EntityKeyRegistry; - - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let prover: Signer; - let generator: Signer; - - let marketCreator: Signer; - let marketSetupData: MarketData; - let marketId: string; - - let generatorData: GeneratorData; - - let iverifier: IVerifier; - - const ivsEnclave = new MockEnclave(MockIVSPCRS); - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - const godEnclave = new MockEnclave(GodEnclavePCRS); - - const totalTokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(9); - const generatorStakingAmount: BigNumber = new BigNumber(10).pow(18).multipliedBy(1000).multipliedBy(2).minus(1231); // use any random number - const generatorSlashingPenalty: BigNumber = new BigNumber(10).pow(16).multipliedBy(93).minus(182723423); // use any random number - const marketCreationCost: BigNumber = new BigNumber(10).pow(18).multipliedBy(1213).minus(23746287365); // use any random number - const generatorComputeAllocation = new BigNumber(10).pow(19).minus("12782387").div(123).multipliedBy(98); - - const computeGivenToNewMarket = new BigNumber(10).pow(19).minus("98897").div(9233).multipliedBy(98); - - const rewardForProofGeneration = new BigNumber(10).pow(18).multipliedBy(200); - const minRewardByGenerator = new BigNumber(10).pow(18).multipliedBy(199); - - beforeEach(async () => { - signers = await ethers.getSigners(); - admin = signers[0]; - tokenHolder = signers[1]; - treasury = signers[2]; - marketCreator = signers[3]; - prover = signers[4]; - generator = signers[5]; - - marketSetupData = { - zkAppName: "transfer verifier", - proverCode: "url of the prover code", - verifierCode: "url of the verifier code", - proverOysterImage: "oyster image link for the prover", - setupCeremonyData: ["first phase", "second phase", "third phase"], - inputOuputVerifierUrl: "this should be nclave url", - }; - - generatorData = { - name: "some custom name for the generator", - }; - - const transferVerifier = await new TransferVerifier__factory(admin).deploy(); - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - - let proofBytes = abiCoder.encode( - ["uint256[8]"], - [ - [ - transfer_verifier_proof.a[0], - transfer_verifier_proof.a[1], - transfer_verifier_proof.b[0][0], - transfer_verifier_proof.b[0][1], - transfer_verifier_proof.b[1][0], - transfer_verifier_proof.b[1][1], - transfer_verifier_proof.c[0], - transfer_verifier_proof.c[1], - ], - ], - ); - - const transferVerifierWrapper = await new Transfer_verifier_wrapper__factory(admin).deploy( - await transferVerifier.getAddress(), - inputBytes, - proofBytes, - ); - - iverifier = IVerifier__factory.connect(await transferVerifierWrapper.getAddress(), admin); - - let treasuryAddress = await treasury.getAddress(); - await treasury.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); - - let data = await setup.rawSetup( - admin, - tokenHolder, - totalTokenSupply, - generatorStakingAmount, - generatorSlashingPenalty, - treasuryAddress, - marketCreationCost, - marketCreator, - marketDataToBytes(marketSetupData), - marketSetupData.inputOuputVerifierUrl, - iverifier, - generator, - generatorDataToBytes(generatorData), - ivsEnclave, - matchingEngineEnclave, - generatorEnclave, - minRewardByGenerator, - generatorComputeAllocation, - computeGivenToNewMarket, - godEnclave, - ); - proofMarketplace = data.proofMarketplace; - generatorRegistry = data.generatorRegistry; - tokenToUse = data.mockToken; - priorityLog = data.priorityLog; - errorLibrary = data.errorLibrary; - entityKeyRegistry = data.entityKeyRegistry; - - await transferVerifierWrapper.setProofMarketplaceContract(await proofMarketplace.getAddress()); - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).minus(1).toFixed(); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }); - it("Check transfer verifier", async () => { - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode( - ["uint256[5]"], - [ - [ - transfer_verifier_inputs[0], - transfer_verifier_inputs[1], - transfer_verifier_inputs[2], - transfer_verifier_inputs[3], - transfer_verifier_inputs[4], - ], - ], - ); - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - let proofBytes = abiCoder.encode( - ["uint256[8]"], - [ - [ - transfer_verifier_proof.a[0], - transfer_verifier_proof.a[1], - transfer_verifier_proof.b[0][0], - transfer_verifier_proof.b[0][1], - transfer_verifier_proof.b[1][0], - transfer_verifier_proof.b[1][1], - transfer_verifier_proof.c[0], - transfer_verifier_proof.c[1], - ], - ], - ); - await expect(proofMarketplace.submitProof(askId, proofBytes)).to.emit(proofMarketplace, "ProofCreated").withArgs(askId, proofBytes); - }); -}); diff --git a/test/ProorMarketPlaceWithTreeVerifier.ts b/test/ProorMarketPlaceWithTreeVerifier.ts deleted file mode 100644 index 8ba957c..0000000 --- a/test/ProorMarketPlaceWithTreeVerifier.ts +++ /dev/null @@ -1,479 +0,0 @@ -import { expect } from "chai"; -import { ethers, upgrades } from "hardhat"; -import { Signer } from "ethers"; -import { BigNumber } from "bignumber.js"; -import { - AttestationVerifier, - AttestationVerifier__factory, - EntityKeyRegistry, - Error, - GeneratorRegistry, - IVerifier, - IVerifier__factory, - MockToken, - PriorityLog, - ProofMarketplace, - Tee_verifier_wrapper, - Tee_verifier_wrapper__factory, - Tee_verifier_wrapper_factory__factory, -} from "../typechain-types"; - -import { - GeneratorData, - GodEnclavePCRS, - MarketData, - MockEnclave, - MockGeneratorPCRS, - MockIVSPCRS, - MockMEPCRS, - generatorDataToBytes, - marketDataToBytes, - setup, - skipBlocks, -} from "../helpers"; - -describe("Proof Market Place for Tee Verifier", () => { - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let tokenToUse: MockToken; - let priorityLog: PriorityLog; - let errorLibrary: Error; - let entityKeyRegistry: EntityKeyRegistry; - - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let prover: Signer; - let generator: Signer; - - let marketCreator: Signer; - let marketSetupData: MarketData; - let marketId: string; - - let generatorData: GeneratorData; - - let attestationVerifier: AttestationVerifier; - let tee_verifier_wrapper: Tee_verifier_wrapper; - let iverifier: IVerifier; - - const ivsEnclave = new MockEnclave(MockIVSPCRS); - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - const godEnclave = new MockEnclave(GodEnclavePCRS); - - const totalTokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(9); - const generatorStakingAmount: BigNumber = new BigNumber(10).pow(18).multipliedBy(1000).multipliedBy(2).minus(1231); // use any random number - const generatorSlashingPenalty: BigNumber = new BigNumber(10).pow(16).multipliedBy(93).minus(182723423); // use any random number - const marketCreationCost: BigNumber = new BigNumber(10).pow(18).multipliedBy(1213).minus(23746287365); // use any random number - const generatorComputeAllocation = new BigNumber(10).pow(19).minus("12782387").div(123).multipliedBy(98); - - const computeGivenToNewMarket = new BigNumber(10).pow(19).minus("98897").div(9233).multipliedBy(98); - - const rewardForProofGeneration = new BigNumber(10).pow(18).multipliedBy(200); - const minRewardByGenerator = new BigNumber(10).pow(18).multipliedBy(199); - - beforeEach(async () => { - signers = await ethers.getSigners(); - admin = signers[0]; - tokenHolder = signers[1]; - treasury = signers[2]; - marketCreator = signers[3]; - prover = signers[4]; - generator = signers[5]; - - marketSetupData = { - zkAppName: "tee verifier", - proverCode: "url of the prover code", - verifierCode: "url of the verifier code", - proverOysterImage: "oyster image link for the prover", - setupCeremonyData: ["first phase", "second phase", "third phase"], - inputOuputVerifierUrl: "this should be nclave url", - }; - - generatorData = { - name: "some custom name for the generator", - }; - - const AttestationVerifierContract = await ethers.getContractFactory("AttestationVerifier"); - const _attestationVerifier = await upgrades.deployProxy( - AttestationVerifierContract, - [[godEnclave.pcrs], [godEnclave.getUncompressedPubkey()], await admin.getAddress()], - { - kind: "uups", - constructorArgs: [], - }, - ); - attestationVerifier = AttestationVerifier__factory.connect(await _attestationVerifier.getAddress(), admin); - - tee_verifier_wrapper = await new Tee_verifier_wrapper__factory(admin).deploy( - await admin.getAddress(), - await attestationVerifier.getAddress(), - [generatorEnclave.getPcrRlp()], - ); - - let tee_verifier_key_attestation = await generatorEnclave.getVerifiedAttestation(godEnclave); - await tee_verifier_wrapper.verifyKey(tee_verifier_key_attestation); - - iverifier = IVerifier__factory.connect(await tee_verifier_wrapper.getAddress(), admin); - - let treasuryAddress = await treasury.getAddress(); - await treasury.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); - - let data = await setup.rawSetup( - admin, - tokenHolder, - totalTokenSupply, - generatorStakingAmount, - generatorSlashingPenalty, - treasuryAddress, - marketCreationCost, - marketCreator, - marketDataToBytes(marketSetupData), - marketSetupData.inputOuputVerifierUrl, - iverifier, - generator, - generatorDataToBytes(generatorData), - ivsEnclave, - matchingEngineEnclave, - generatorEnclave, - minRewardByGenerator, - generatorComputeAllocation, - computeGivenToNewMarket, - godEnclave, - ); - proofMarketplace = data.proofMarketplace; - generatorRegistry = data.generatorRegistry; - tokenToUse = data.mockToken; - priorityLog = data.priorityLog; - errorLibrary = data.errorLibrary; - entityKeyRegistry = data.entityKeyRegistry; - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).minus(1).toFixed(); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }); - - it("Check tee verifier deployer", async () => { - const tee_verifier_deployer = await new Tee_verifier_wrapper_factory__factory(admin).deploy(); - - // create new tee verifier by code - const tx = tee_verifier_deployer.create_tee_verifier_wrapper(await admin.getAddress(), await attestationVerifier.getAddress(), [ - ivsEnclave.getPcrRlp(), - ]); - await expect(tx).to.emit(tee_verifier_deployer, "TeeVerifierWrapperCreated"); - }); - - it("Check tee verifier", async () => { - let inputBytes = "0x1234"; - let proofBytes = "0x0987"; - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - let abiCoder = new ethers.AbiCoder(); - const messageBytes = abiCoder.encode(["bytes", "bytes"], [inputBytes, proofBytes]); - let digest = ethers.keccak256(messageBytes); - let signature = await generatorEnclave.signMessage(ethers.getBytes(digest)); - - let proofToSend = abiCoder.encode(["bytes", "bytes", "bytes"], [inputBytes, proofBytes, signature]); - - await expect(proofMarketplace.submitProof(askId, proofToSend)).to.emit(proofMarketplace, "ProofCreated").withArgs(askId, proofToSend); - }); - - it("Check tee verifier, after adding new image to tee verifier", async () => { - let inputBytes = "0x1234"; - let proofBytes = "0x0987"; - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - const newGeneratorImage = new MockEnclave(MockEnclave.someRandomPcrs()); - const newGeneratorAttestation = await newGeneratorImage.getVerifiedAttestation(godEnclave); - - await expect(tee_verifier_wrapper.connect(admin).addEnclaveImageToFamily(newGeneratorImage.getPcrRlp())).to.emit( - tee_verifier_wrapper, - "EnclaveImageAddedToFamily", - ); - await expect(tee_verifier_wrapper.connect(treasury).verifyKey(newGeneratorAttestation)).to.emit( - tee_verifier_wrapper, - "EnclaveKeyVerified", - ); - - let abiCoder = new ethers.AbiCoder(); - const messageBytes = abiCoder.encode(["bytes", "bytes"], [inputBytes, proofBytes]); - let digest = ethers.keccak256(messageBytes); - let signature = await newGeneratorImage.signMessage(ethers.getBytes(digest)); - - let proofToSend = abiCoder.encode(["bytes", "bytes", "bytes"], [inputBytes, proofBytes, signature]); - - await expect(proofMarketplace.submitProof(askId, proofToSend)).to.emit(proofMarketplace, "ProofCreated").withArgs(askId, proofToSend); - }); - - it("Shoulf fail: if inputs don't match when used to generate proof", async () => { - let inputBytes = "0x1234"; - let proofBytes = "0x0987"; - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - let abiCoder = new ethers.AbiCoder(); - - let wrongInputs = "0x8888"; - - const messageBytes = abiCoder.encode(["bytes", "bytes"], [wrongInputs, proofBytes]); - let digest = ethers.keccak256(messageBytes); - let signature = await generatorEnclave.signMessage(ethers.getBytes(digest)); - - let proofToSend = abiCoder.encode(["bytes", "bytes", "bytes"], [wrongInputs, proofBytes, signature]); - - await expect(proofMarketplace.submitProof(askId, proofToSend)).to.be.revertedWithCustomError(proofMarketplace, "InvalidInputs"); - }); - - it("Shoulf fail: if wrong signature is provided", async () => { - let inputBytes = "0x1234"; - let proofBytes = "0x0987"; - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - let abiCoder = new ethers.AbiCoder(); - - let wrongInputs = "0x8888"; - - const messageBytes = abiCoder.encode(["bytes", "bytes"], [wrongInputs, proofBytes]); - let digest = ethers.keccak256(messageBytes); - let wrongSignature = await generatorEnclave.signMessage(ethers.getBytes(digest)); - - let proofToSend = abiCoder.encode(["bytes", "bytes", "bytes"], [inputBytes, proofBytes, wrongSignature]); - - await expect(proofMarketplace.submitProof(askId, proofToSend)).to.be.revertedWithCustomError( - tee_verifier_wrapper, - "AttestationAutherKeyNotVerified", - ); - }); - - it("Shoulf fail: proofs generated from some random enclave should fail", async () => { - let inputBytes = "0x1234"; - let proofBytes = "0x0987"; - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - let abiCoder = new ethers.AbiCoder(); - - const messageBytes = abiCoder.encode(["bytes", "bytes"], [inputBytes, proofBytes]); - let digest = ethers.keccak256(messageBytes); - - const randomEnclave = new MockEnclave(MockEnclave.someRandomPcrs()); - let signature = await randomEnclave.signMessage(ethers.getBytes(digest)); - - let proofToSend = abiCoder.encode(["bytes", "bytes", "bytes"], [inputBytes, proofBytes, signature]); - - await expect(proofMarketplace.submitProof(askId, proofToSend)).to.be.revertedWithCustomError( - tee_verifier_wrapper, - "AttestationAutherKeyNotVerified", - ); - }); -}); diff --git a/test/ProorMarketPlaceWithZkSync.ts b/test/ProorMarketPlaceWithZkSync.ts deleted file mode 100644 index a974b41..0000000 --- a/test/ProorMarketPlaceWithZkSync.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { expect } from "chai"; -import { ethers, upgrades } from "hardhat"; -import { Signer } from "ethers"; -import { BigNumber } from "bignumber.js"; -import { - GeneratorRegistry, - IVerifier, - IVerifier__factory, - MockToken, - PriorityLog, - ProofMarketplace, - ZkSyncVerifier__factory, - Zksync_verifier_wrapper__factory, - Error, - EntityKeyRegistry, -} from "../typechain-types"; - -import { - GeneratorData, - GodEnclavePCRS, - MarketData, - MockEnclave, - MockGeneratorPCRS, - MockIVSPCRS, - MockMEPCRS, - generatorDataToBytes, - marketDataToBytes, - setup, - skipBlocks, -} from "../helpers"; - -import * as zksync_data from "../helpers/sample/zksync/data.json"; - -describe("Proof Market Place for zksync Verifier", () => { - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let tokenToUse: MockToken; - let priorityLog: PriorityLog; - let errorLibrary: Error; - let entityKeyRegistry: EntityKeyRegistry; - - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let prover: Signer; - let generator: Signer; - - let marketCreator: Signer; - let marketSetupData: MarketData; - let marketId: string; - - let generatorData: GeneratorData; - - let iverifier: IVerifier; - - const ivsEnclave = new MockEnclave(MockIVSPCRS); - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - const generatorEnclave = new MockEnclave(MockGeneratorPCRS); - const godEnclave = new MockEnclave(GodEnclavePCRS); - - const totalTokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(9); - const generatorStakingAmount: BigNumber = new BigNumber(10).pow(18).multipliedBy(1000).multipliedBy(2).minus(1231); // use any random number - const generatorSlashingPenalty: BigNumber = new BigNumber(10).pow(16).multipliedBy(93).minus(182723423); // use any random number - const marketCreationCost: BigNumber = new BigNumber(10).pow(18).multipliedBy(1213).minus(23746287365); // use any random number - const generatorComputeAllocation = new BigNumber(10).pow(19).minus("12782387").div(123).multipliedBy(98); - - const computeGivenToNewMarket = new BigNumber(10).pow(19).minus("98897").div(9233).multipliedBy(98); - - const rewardForProofGeneration = new BigNumber(10).pow(18).multipliedBy(200); - const minRewardByGenerator = new BigNumber(10).pow(18).multipliedBy(199); - - beforeEach(async () => { - signers = await ethers.getSigners(); - admin = signers[0]; - tokenHolder = signers[1]; - treasury = signers[2]; - marketCreator = signers[3]; - prover = signers[4]; - generator = signers[5]; - - marketSetupData = { - zkAppName: "zksync verifier", - proverCode: "url of the prover code", - verifierCode: "url of the verifier code", - proverOysterImage: "oyster image link for the prover", - setupCeremonyData: ["first phase", "second phase", "third phase"], - inputOuputVerifierUrl: "this should be nclave url", - }; - - generatorData = { - name: "some custom name for the generator", - }; - - const zksyncVerifier = await new ZkSyncVerifier__factory(admin).deploy(); - - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode(["uint256[]"], [zksync_data.publicInputs]); - let proofBytes = abiCoder.encode(["uint256[]", "uint256[]"], [zksync_data.serializedProof, zksync_data.recursiveAggregationInput]); - - const zksyncVerifierWrapper = await new Zksync_verifier_wrapper__factory(admin).deploy( - await zksyncVerifier.getAddress(), - inputBytes, - proofBytes, - ); - - iverifier = IVerifier__factory.connect(await zksyncVerifierWrapper.getAddress(), admin); - - let treasuryAddress = await treasury.getAddress(); - await treasury.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); - - let data = await setup.rawSetup( - admin, - tokenHolder, - totalTokenSupply, - generatorStakingAmount, - generatorSlashingPenalty, - treasuryAddress, - marketCreationCost, - marketCreator, - marketDataToBytes(marketSetupData), - marketSetupData.inputOuputVerifierUrl, - iverifier, - generator, - generatorDataToBytes(generatorData), - ivsEnclave, - matchingEngineEnclave, - generatorEnclave, - minRewardByGenerator, - generatorComputeAllocation, - computeGivenToNewMarket, - godEnclave, - ); - proofMarketplace = data.proofMarketplace; - generatorRegistry = data.generatorRegistry; - tokenToUse = data.mockToken; - priorityLog = data.priorityLog; - errorLibrary = data.errorLibrary; - entityKeyRegistry = data.entityKeyRegistry; - - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).minus(1).toFixed(); - - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - }); - it("Check zksync verifier", async () => { - let abiCoder = new ethers.AbiCoder(); - - let inputBytes = abiCoder.encode(["uint256[]"], [zksync_data.publicInputs]); - // console.log({ inputBytes }); - const latestBlock = await ethers.provider.getBlockNumber(); - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 100000000; // keep a large number, but only for tests - let maxTimeForProofGeneration = 10000; // in blocks - - const askId = await setup.createAsk( - prover, - tokenHolder, - { - marketId, - proverData: inputBytes, - reward: rewardForProofGeneration.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - 1, - ); - - await setup.createTask( - matchingEngineEnclave, - admin.provider, - { - mockToken: tokenToUse, - proofMarketplace, - generatorRegistry, - priorityLog, - errorLibrary, - entityKeyRegistry, - }, - askId, - generator, - ); - - let proofBytes = abiCoder.encode(["uint256[]", "uint256[]"], [zksync_data.serializedProof, zksync_data.recursiveAggregationInput]); - await expect(proofMarketplace.submitProof(askId, proofBytes)).to.emit(proofMarketplace, "ProofCreated").withArgs(askId, proofBytes); - }); -}); diff --git a/test/StakingManager.ts b/test/StakingManager.ts deleted file mode 100644 index c1c8435..0000000 --- a/test/StakingManager.ts +++ /dev/null @@ -1,295 +0,0 @@ -import BigNumber from "bignumber.js"; -import { expect } from "chai"; -import { Signer } from "ethers"; -import { ethers, upgrades } from "hardhat"; - -import { bytesToHexString, generateRandomBytes, MockEnclave, MockGeneratorPCRS, MockIVSPCRS, MockMEPCRS, skipBlocks } from "../helpers"; -import { - Dispute, - Dispute__factory, - EntityKeyRegistry, - EntityKeyRegistry__factory, - Error, - Error__factory, - GeneratorRegistry, - GeneratorRegistry__factory, - MockAttestationVerifier__factory, - MockToken, - MockToken__factory, - MockVerifier, - MockVerifier__factory, - NativeStaking, - NativeStaking__factory, - ProofMarketplace, - ProofMarketplace__factory, - StakingManager, - StakingManager__factory, - SymbioticStaking, - SymbioticStaking__factory, - SymbioticStakingReward, - SymbioticStakingReward__factory, -} from "../typechain-types"; - -describe("Staking manager", () => { - /* Signers */ - let signers: Signer[]; - let admin: Signer; - let tokenHolder: Signer; - let treasury: Signer; - let marketCreator: Signer; - let matchingEngineSigner: Signer; - - /* Constants */ - const tokenSupply: BigNumber = new BigNumber(10).pow(24).multipliedBy(4); // 4 * 10^24 - const marketCreationCost: BigNumber = new BigNumber(10).pow(20).multipliedBy(5); // 5 * 10^20 - const generatorStakingAmount = new BigNumber(10).pow(21).multipliedBy(6); // 6 * 10^21 - const minRewardForGenerator = new BigNumber(10).pow(18).multipliedBy(100); // 100 * 10^18 - const exponent = new BigNumber(10).pow(18); - const penaltyForNotComputingProof = exponent.div(100).toFixed(0); - - /* Contracts */ - let mockToken: MockToken; - let stakingManager: StakingManager; - let nativeStaking: NativeStaking; - let symbioticStaking: SymbioticStaking; - let symbioticStakingReward: SymbioticStakingReward; - let proofMarketplace: ProofMarketplace; - let generatorRegistry: GeneratorRegistry; - let entityRegistry: EntityKeyRegistry; - let mockVerifier: MockVerifier; - let errorLibrary: Error; - - /* Enclaves */ - const matchingEngineEnclave = new MockEnclave(MockMEPCRS); - const ivsEnclave = new MockEnclave(MockIVSPCRS); - - describe("Staking Manager", () => { - beforeEach(async () => { - // Setup signers - signers = await ethers.getSigners(); - admin = signers[1]; - tokenHolder = signers[2]; - treasury = signers[3]; - marketCreator = signers[4]; - matchingEngineSigner = new ethers.Wallet(matchingEngineEnclave.getPrivateKey(true), admin.provider); - await admin.sendTransaction({ to: matchingEngineEnclave.getAddress(), value: "1000000000000000000" }); // Send 1 ETH to Matching Engine - - //------------------------------ Deploy Contracts ------------------------------// - - // ErrorLibrary - errorLibrary = await new Error__factory(admin).deploy(); - - // MockToken - mockToken = await new MockToken__factory(admin).deploy(await tokenHolder.getAddress(), tokenSupply.toFixed(), "Payment Token", "PT"); - mockVerifier = await new MockVerifier__factory(admin).deploy(); - - // StakingManager - const StakingManager = await ethers.getContractFactory("StakingManager"); - const _stakingManager = await upgrades.deployProxy(StakingManager, [], { - kind: "uups", - initializer: false, - }); - stakingManager = StakingManager__factory.connect(await _stakingManager.getAddress(), admin); - - // NativeStaking - const NativeStaking = await ethers.getContractFactory("NativeStaking"); - const _nativeStaking = await upgrades.deployProxy(NativeStaking, [], { - kind: "uups", - initializer: false, - }); - nativeStaking = NativeStaking__factory.connect(await _nativeStaking.getAddress(), admin); - - // SymbioticStaking - const SymbioticStaking = await ethers.getContractFactory("SymbioticStaking"); - const _symbioticStaking = await upgrades.deployProxy(SymbioticStaking, [], { - kind: "uups", - initializer: false, - }); - symbioticStaking = SymbioticStaking__factory.connect(await _symbioticStaking.getAddress(), admin); - - // SymbioticStakingReward - const SymbioticStakingReward = await ethers.getContractFactory("SymbioticStakingReward"); - const _symbioticStakingReward = await upgrades.deployProxy(SymbioticStakingReward, [], { - kind: "uups", - initializer: false, - }); - symbioticStakingReward = SymbioticStakingReward__factory.connect(await _symbioticStakingReward.getAddress(), admin); - - - // EntityKeyRegistry - const mockAttestationVerifier = await new MockAttestationVerifier__factory(admin).deploy(); - const EntityKeyRegistryContract = await ethers.getContractFactory("EntityKeyRegistry"); - const _entityKeyRegistry = await upgrades.deployProxy(EntityKeyRegistryContract, [await admin.getAddress(), []], { - kind: "uups", - constructorArgs: [await mockAttestationVerifier.getAddress()], - }); - entityRegistry = EntityKeyRegistry__factory.connect(await _entityKeyRegistry.getAddress(), admin); - - // GeneratorRegistry - const GeneratorRegistryContract = await ethers.getContractFactory("GeneratorRegistry"); - const generatorProxy = await upgrades.deployProxy(GeneratorRegistryContract, [], { - kind: "uups", - constructorArgs: [await mockToken.getAddress(), await entityRegistry.getAddress()], - initializer: false, - }); - generatorRegistry = GeneratorRegistry__factory.connect(await generatorProxy.getAddress(), signers[0]); - - // ProofMarketplace - const ProofMarketplace = await ethers.getContractFactory("ProofMarketplace"); - const proxy = await upgrades.deployProxy(ProofMarketplace, [], { - kind: "uups", - constructorArgs: [ - await mockToken.getAddress(), - marketCreationCost.toString(), - await treasury.getAddress(), - await generatorRegistry.getAddress(), - await entityRegistry.getAddress(), - ], - initializer: false, - }); - - proofMarketplace = ProofMarketplace__factory.connect(await proxy.getAddress(), signers[0]); - - const dispute = await new Dispute__factory(admin).deploy(await entityRegistry.getAddress()); - - //------------------------------ Initialize Contracts ------------------------------// - - // StakingManager - await stakingManager.initialize( - await admin.getAddress(), - await proofMarketplace.getAddress(), - await symbioticStaking.getAddress(), - await mockToken.getAddress(), - ); - - // GENERATOR_REGISTRY_ROLE to GeneratorRegistry - await stakingManager.grantRole(await stakingManager.GENERATOR_REGISTRY_ROLE(), await generatorRegistry.getAddress()); - - // SymbioticStaking - await symbioticStaking.initialize( - await admin.getAddress(), - await proofMarketplace.getAddress(), - await stakingManager.getAddress(), - await symbioticStakingReward.getAddress(), - await mockToken.getAddress(), - ); - - // SymbioticStakingReward - await symbioticStakingReward.initialize( - await admin.getAddress(), - await proofMarketplace.getAddress(), - await symbioticStaking.getAddress(), - await mockToken.getAddress(), - ); - - // GeneratorRegistry - await generatorRegistry.initialize(await admin.getAddress(), await proofMarketplace.getAddress(), await stakingManager.getAddress()); - - // ProofMarketplace - await proofMarketplace.initialize(await admin.getAddress()); - - //-------------------------------------- Config --------------------------------------// - /* StakingManager */ - await stakingManager.addStakingPool(await nativeStaking.getAddress()); - await stakingManager.addStakingPool(await symbioticStaking.getAddress()); - - //-------------------------------------- Setup --------------------------------------// - - expect(ethers.isAddress(await proofMarketplace.getAddress())).is.true; - - // Transfer market creation cost to `marketCreator` () - await mockToken.connect(tokenHolder).transfer(await marketCreator.getAddress(), marketCreationCost.toFixed()); - - // KEY_REGISTER_ROLE to ProofMarketplace and GeneratorRegistry - await entityRegistry.connect(admin).grantRole(await entityRegistry.KEY_REGISTER_ROLE(), await proofMarketplace.getAddress()); - - // KEY_REGISTER_ROLE to GeneratorRegistry - await entityRegistry.connect(admin).grantRole(await entityRegistry.KEY_REGISTER_ROLE(), await generatorRegistry.getAddress()); - - // UPDATER_ROLE to admin - await proofMarketplace.connect(admin).grantRole(await proofMarketplace.UPDATER_ROLE(), await admin.getAddress()); - - // SYMBIOTIC_STAKING_ROLE to SymbioticStaking - await proofMarketplace.connect(admin).grantRole(await proofMarketplace.SYMBIOTIC_STAKING_ROLE(), await symbioticStaking.getAddress()); - - // SYMBIOTIC_STAKING_REWARD_ROLE to SymbioticStakingReward - await proofMarketplace - .connect(admin) - .grantRole(await proofMarketplace.SYMBIOTIC_STAKING_REWARD_ROLE(), await symbioticStakingReward.getAddress()); - }); - }); - - describe("Staking Manager: Public Market", () => { - let prover: Signer; - let reward = new BigNumber(10).pow(20).multipliedBy(3); - let marketId: string; - - let assignmentExpiry = 100; // in blocks - let timeTakenForProofGeneration = 1000; // in blocks - let maxTimeForProofGeneration = 10000; // in blocks - - beforeEach(async () => { - // Send reward to prover - prover = signers[5]; - await mockToken.connect(tokenHolder).transfer(await prover.getAddress(), reward.toFixed()); - - const marketBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 10)); // 10 MB - marketId = new BigNumber((await proofMarketplace.marketCounter()).toString()).toFixed(); - - // Approve marketplace for market creation cost - await mockToken.connect(marketCreator).approve(await proofMarketplace.getAddress(), marketCreationCost.toFixed()); - - // Create Marketplace - await proofMarketplace - .connect(marketCreator) - .createMarketplace( - marketBytes, - await mockVerifier.getAddress(), - penaltyForNotComputingProof, - new MockEnclave(MockGeneratorPCRS).getPcrRlp(), - ivsEnclave.getPcrRlp(), - ); - - // Skip market activation delay - let marketActivationDelay = await proofMarketplace.MARKET_ACTIVATION_DELAY(); - await skipBlocks(ethers, new BigNumber(marketActivationDelay.toString()).toNumber()); - - // Create Ask Request - const latestBlock = await ethers.provider.getBlockNumber(); - const askIdToBeGenerated = await proofMarketplace.askCounter(); - - const proverBytes = "0x" + bytesToHexString(await generateRandomBytes(1024 * 1)); // 1 MB - const askRequest = { - marketId, - proverData: proverBytes, - reward: reward.toFixed(), - expiry: assignmentExpiry + latestBlock, - timeTakenForProofGeneration, - deadline: latestBlock + maxTimeForProofGeneration, - refundAddress: await prover.getAddress(), - }; - - const secretInfo = "0x2345"; - const aclInfo = "0x21"; - - await proofMarketplace.connect(admin).updateCostPerBytes(1, 1000); - - const platformFee = await proofMarketplace.getPlatformFee(1, askRequest, secretInfo, aclInfo); - await mockToken.connect(tokenHolder).transfer(await prover.getAddress(), platformFee); - - await mockToken - .connect(prover) - .approve(await proofMarketplace.getAddress(), new BigNumber(platformFee.toString()).plus(reward).toFixed()); - - await expect(proofMarketplace.connect(prover).createAsk(askRequest, 1, secretInfo, aclInfo)) - .to.emit(proofMarketplace, "AskCreated") - .withArgs(askIdToBeGenerated, true, "0x2345", "0x21") - .to.emit(mockToken, "Transfer") - .withArgs(await prover.getAddress(), await proofMarketplace.getAddress(), new BigNumber(platformFee.toString()).plus(reward)); - - expect((await proofMarketplace.listOfAsk(askIdToBeGenerated)).state).to.equal(1); // 1 means create state - }); - - // it() - }); -}); diff --git a/test/UpgradabilityTest.ts b/test/UpgradabilityTest.ts deleted file mode 100644 index 29128b9..0000000 --- a/test/UpgradabilityTest.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { ethers, upgrades } from "hardhat"; -import { expect } from "chai"; - -describe("Upgrade test", () => { - it("upgrade: should fail", async () => { - const UC_Contract = await ethers.getContractFactory("UC"); - const _uc = await upgrades.deployProxy(UC_Contract, [], { kind: "uups", constructorArgs: [] }); - - // catching error using try catch, as expect not working here - try { - await upgrades.upgradeProxy(await _uc.getAddress(), await ethers.getContractFactory("UC_Rekt")); - throw new Error("Upgrade should fail"); - } catch (ex) { - // means expection was caught, which is right - } - }); - - it("upgrade: should Pass", async () => { - const UC_Contract = await ethers.getContractFactory("UC"); - const _uc = await upgrades.deployProxy(UC_Contract, [], { kind: "uups", constructorArgs: [] }); - - const oldImplementation = await upgrades.erc1967.getImplementationAddress(await _uc.getAddress()); - - await upgrades.upgradeProxy(await _uc.getAddress(), await ethers.getContractFactory("UC_with_rg")); - const newImplementation = await upgrades.erc1967.getImplementationAddress(await _uc.getAddress()); - - expect(newImplementation).not.eq(oldImplementation); - }); -}); diff --git a/test/foundry/TestSetup.t.sol b/test/foundry/TestSetup.t.sol deleted file mode 100644 index 483959f..0000000 --- a/test/foundry/TestSetup.t.sol +++ /dev/null @@ -1,377 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.26; - -import {Test, console} from "forge-std/Test.sol"; - -/* mocks */ -import {USDC} from "./mocks/USDC.sol"; -import {POND} from "./mocks/POND.sol"; -import {WETH} from "./mocks/WETH.sol"; - -/* contracts */ -import {JobManager} from "../../contracts/staking/l2_contracts/JobManager.sol"; -import {StakingManager} from "../../contracts/staking/l2_contracts/StakingManager.sol"; -import {NativeStaking} from "../../contracts/staking/l2_contracts/NativeStaking.sol"; -import {SymbioticStaking} from "../../contracts/staking/l2_contracts/SymbioticStaking.sol"; -import {SymbioticStakingReward} from "../../contracts/staking/l2_contracts/SymbioticStakingReward.sol"; - -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; - -/* interfaces */ -import {IJobManager} from "../../contracts/interfaces/staking/IJobManager.sol"; -import {IStakingManager} from "../../contracts/interfaces/staking/IStakingManager.sol"; -import {INativeStaking} from "../../contracts/interfaces/staking/INativeStaking.sol"; -import {ISymbioticStaking} from "../../contracts/interfaces/staking/ISymbioticStaking.sol"; -import {ISymbioticStakingReward} from "../../contracts/interfaces/staking/ISymbioticStakingReward.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - -/* libraries */ -import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; - -contract TestSetup is Test { - uint256 constant public FIFTEEN_PERCENT = 15; - uint256 constant public TWENTY_PERCENT = 20; - uint256 constant public THIRTY_PERCENT = 30; - uint256 constant public FORTY_PERCENT = 40; - uint256 constant public FIFTY_PERCENT = 50; - uint256 constant public SIXTY_PERCENT = 60; - uint256 constant public HUNDRED_PERCENT = 100; - - uint256 constant public FUND_FOR_GAS = 10 ether; // 10 ether - uint256 constant public FUND_FOR_FEE = 10_000 ether; // 10,000 USDC - uint256 constant public FUND_FOR_SELF_STAKE = 1000_000 ether; // 10,000 POND - uint256 constant public FUND_FOR_INFLATION_REWARD = 100_000 ether; // 100,000 POND - - // uint256 constant public INFLATION_REWARD_EPOCH_SIZE = 30 minutes; // 30 minutes - // uint256 constant public INFLATION_REWARD_PER_EPOCH = 100 ether; // 1,000 POND - - uint256 constant public SUBMISSION_COOLDOWN = 12 hours; - - uint256 constant public USDC_DECIMALS = 1e6; - - - /* contracts */ - address public jobManager; - address public inflationRewardManager; - - address public stakingManager; - address public nativeStaking; - address public symbioticStaking; - address public symbioticStakingReward; - - /* reward tokens */ - address public feeToken; - address public inflationRewardToken; - - /* stake tokens */ - address public usdc; - address public pond; - address public weth; - - /* admin */ - address public deployer; - address public admin; - address public inflationRewardVault; // holds inflation reward tokens - - /* operators */ - address public operatorA; - address public operatorB; - address public operatorC; - - /* symbiotic vaults */ - address public symbioticVaultA; - address public symbioticVaultB; - address public symbioticVaultC; - address public symbioticVaultD; - address public symbioticVaultE; - - /* transmitters */ - address public transmitterA; - address public transmitterB; - address public transmitterC; - - /* stakers */ - address public stakerA; - address public stakerB; - address public stakerC; - - /* slasher */ - address public slasher; - - /* job requesters */ - address public jobRequesterA; - address public jobRequesterB; - address public jobRequesterC; - - - function _setupAddr() internal { - /* set address */ - deployer = makeAddr("deployer"); - admin = makeAddr("admin"); - inflationRewardVault = makeAddr("inflationRewardVault"); - - slasher = makeAddr("slasher"); - - stakerA = makeAddr("stakerA"); - stakerB = makeAddr("stakerB"); - stakerC = makeAddr("stakerC"); - - operatorA = makeAddr("operatorA"); - operatorB = makeAddr("operatorB"); - operatorC = makeAddr("operatorC"); - - symbioticVaultA = makeAddr("symbioticVaultA"); - symbioticVaultB = makeAddr("symbioticVaultB"); - symbioticVaultC = makeAddr("symbioticVaultC"); - symbioticVaultD = makeAddr("symbioticVaultD"); - symbioticVaultE = makeAddr("symbioticVaultE"); - - transmitterA = makeAddr("transmitterA"); - transmitterB = makeAddr("transmitterB"); - transmitterC = makeAddr("transmitterC"); - - jobRequesterA = makeAddr("jobRequesterA"); - jobRequesterB = makeAddr("jobRequesterB"); - jobRequesterC = makeAddr("jobRequesterC"); - - /* fund gas */ - vm.deal(deployer, FUND_FOR_GAS); - vm.deal(admin, FUND_FOR_GAS); - vm.deal(inflationRewardVault, FUND_FOR_GAS); - - vm.deal(operatorA, FUND_FOR_GAS); - vm.deal(operatorB, FUND_FOR_GAS); - vm.deal(operatorC, FUND_FOR_GAS); - vm.deal(slasher, FUND_FOR_GAS); - - vm.deal(stakerA, FUND_FOR_GAS); - vm.deal(stakerB, FUND_FOR_GAS); - vm.deal(stakerC, FUND_FOR_GAS); - - vm.deal(transmitterA, FUND_FOR_GAS); - vm.deal(transmitterB, FUND_FOR_GAS); - vm.deal(transmitterC, FUND_FOR_GAS); - - vm.deal(jobRequesterA, FUND_FOR_GAS); - vm.deal(jobRequesterB, FUND_FOR_GAS); - vm.deal(jobRequesterC, FUND_FOR_GAS); - - /* label */ - vm.label(deployer, "deployer"); - vm.label(admin, "admin"); - vm.label(slasher, "slasher"); - - vm.label(operatorA, "operatorA"); - vm.label(operatorB, "operatorB"); - vm.label(operatorC, "operatorC"); - - vm.label(stakerA, "stakerA"); - vm.label(stakerB, "stakerB"); - vm.label(stakerC, "stakerC"); - - vm.label(symbioticVaultA, "symbioticVaultA"); - vm.label(symbioticVaultB, "symbioticVaultB"); - vm.label(symbioticVaultC, "symbioticVaultC"); - vm.label(symbioticVaultD, "symbioticVaultD"); - vm.label(symbioticVaultE, "symbioticVaultE"); - - vm.label(jobRequesterA, "jobRequesterA"); - vm.label(jobRequesterB, "jobRequesterB"); - vm.label(jobRequesterC, "jobRequesterC"); - - vm.label(transmitterA, "transmitterA"); - vm.label(transmitterB, "transmitterB"); - vm.label(transmitterC, "transmitterC"); - } - - /*======================================== internal ========================================*/ - - function _setupContracts() internal { - _deployContracts(); - _initializeContracts(); - } - - function _deployContracts() internal { - vm.startPrank(deployer); - - // FeeToken - usdc = address(new USDC(admin)); - feeToken = usdc; - - // InflationRewardToken - pond = address(new POND(admin)); - inflationRewardToken = pond; - - // stakeToken - weth = address(new WETH(admin)); - pond = inflationRewardToken; - - // contract implementations - address jobManagerImpl = address(new JobManager()); - address stakingManagerImpl = address(new StakingManager()); - address nativeStakingImpl = address(new NativeStaking()); - address symbioticStakingImpl = address(new SymbioticStaking()); - address symbioticStakingRewardImpl = address(new SymbioticStakingReward()); - - // deploy proxies - jobManager = address(new ERC1967Proxy(jobManagerImpl, "")); - stakingManager = address(new ERC1967Proxy(stakingManagerImpl, "")); - nativeStaking = address(new ERC1967Proxy(nativeStakingImpl, "")); - symbioticStaking = address(new ERC1967Proxy(symbioticStakingImpl, "")); - symbioticStakingReward = address(new ERC1967Proxy(symbioticStakingRewardImpl, "")); - // inflationRewardManager = address(new ERC1967Proxy(inflationRewardManagerImpl, "")); - vm.stopPrank(); - - /* label */ - vm.label(address(jobManager), "JobManager"); - vm.label(address(stakingManager), "StakingManager"); - vm.label(address(nativeStaking), "NativeStaking"); - vm.label(address(symbioticStaking), "SymbioticStaking"); - vm.label(address(symbioticStakingReward), "SymbioticStakingReward"); - // vm.label(address(inflationRewardManager), "InflationRewardManager"); - } - - function _initializeContracts() internal { - vm.startPrank(admin); - - // JobManager - JobManager(address(jobManager)).initialize( - admin, address(stakingManager), address(symbioticStaking), address(symbioticStakingReward), address(feeToken), 1 hours - ); - assertEq(JobManager(jobManager).hasRole(JobManager(jobManager).DEFAULT_ADMIN_ROLE(), admin), true); - - // StakingManager - StakingManager(address(stakingManager)).initialize( - admin, - address(jobManager), - address(symbioticStaking), - address(feeToken) - ); - assertEq(StakingManager(stakingManager).hasRole(StakingManager(stakingManager).DEFAULT_ADMIN_ROLE(), admin), true); - - // NativeStaking - NativeStaking(address(nativeStaking)).initialize( - admin, - address(stakingManager), - 2 days, // withdrawalDuration - address(feeToken) - ); - assertEq(NativeStaking(nativeStaking).hasRole(NativeStaking(nativeStaking).DEFAULT_ADMIN_ROLE(), admin), true); - - // SymbioticStaking - SymbioticStaking(address(symbioticStaking)).initialize( - admin, - jobManager, - stakingManager, - symbioticStakingReward, - feeToken - ); - assertEq(SymbioticStaking(symbioticStaking).hasRole(SymbioticStaking(symbioticStaking).DEFAULT_ADMIN_ROLE(), admin), true); - // SymbioticStakingReward - SymbioticStakingReward(address(symbioticStakingReward)).initialize( - admin, - jobManager, - symbioticStaking, - feeToken - ); - assertEq(SymbioticStakingReward(symbioticStakingReward).hasRole(SymbioticStakingReward(symbioticStakingReward).DEFAULT_ADMIN_ROLE(), admin), true); - - // InflationRewardManager - // InflationRewardManager(address(inflationRewardManager)).initialize( - // admin, - // block.timestamp, - // jobManager, - // stakingManager, - // symbioticStaking, - // symbioticStakingReward, - // inflationRewardToken, - // INFLATION_REWARD_EPOCH_SIZE, // inflationRewardEpochSize - // INFLATION_REWARD_PER_EPOCH // inflationRewardPerEpoch - // ); - // assertEq(InflationRewardManager(inflationRewardManager).hasRole(InflationRewardManager(inflationRewardManager).DEFAULT_ADMIN_ROLE(), admin), true); - vm.stopPrank(); - } - - function _setJobManagerConfig() internal { - vm.startPrank(admin); - // operatorA: 30% of the reward as comission - JobManager(jobManager).setOperatorRewardShare(operatorA, _calcShareAmount(THIRTY_PERCENT)); - // operatorB: 50% of the reward as comission - JobManager(jobManager).setOperatorRewardShare(operatorB, _calcShareAmount(FIFTY_PERCENT)); - // operatorB: 15% of the reward as comission - JobManager(jobManager).setOperatorRewardShare(operatorC, _calcShareAmount(FIFTEEN_PERCENT)); - vm.stopPrank(); - } - - function _setStakingManagerConfig() internal { - address[] memory pools = new address[](2); - pools[0] = nativeStaking; - pools[1] = symbioticStaking; - - uint256[] memory shares = new uint256[](2); - shares[0] = 0; - shares[1] = _calcShareAmount(HUNDRED_PERCENT); - - vm.startPrank(admin); - StakingManager(stakingManager).addStakingPool(nativeStaking); - StakingManager(stakingManager).addStakingPool(symbioticStaking); - - StakingManager(stakingManager).setPoolRewardShare(pools, shares); - - StakingManager(stakingManager).setEnabledPool(nativeStaking, true); - StakingManager(stakingManager).setEnabledPool(symbioticStaking, true); - vm.stopPrank(); - - assertEq(IStakingManager(stakingManager).getPoolConfig(nativeStaking).share, 0); - assertEq(IStakingManager(stakingManager).getPoolConfig(symbioticStaking).share, _calcShareAmount(HUNDRED_PERCENT)); - } - - function _setNativeStakingConfig() internal { - vm.startPrank(admin); - NativeStaking(nativeStaking).addStakeToken(pond, _calcShareAmount(HUNDRED_PERCENT)); - NativeStaking(nativeStaking).setAmountToLock(pond, 1 ether); - vm.stopPrank(); - } - - function _setSymbioticStakingConfig() internal { - vm.startPrank(admin); - - /* stake tokens and weights */ - SymbioticStaking(symbioticStaking).addStakeToken(pond, _calcShareAmount(SIXTY_PERCENT)); - SymbioticStaking(symbioticStaking).addStakeToken(weth, _calcShareAmount(FORTY_PERCENT)); - - /* base transmitter comission rate and submission cooldown */ - SymbioticStaking(symbioticStaking).setBaseTransmitterComissionRate(_calcShareAmount(TWENTY_PERCENT)); - SymbioticStaking(symbioticStaking).setSubmissionCooldown(12 hours); - - /* amount to lock */ - SymbioticStaking(symbioticStaking).setAmountToLock(pond, 0.2 ether); - SymbioticStaking(symbioticStaking).setAmountToLock(weth, 0.2 ether); - - vm.stopPrank(); - - assertEq(SymbioticStaking(symbioticStaking).baseTransmitterComissionRate(), _calcShareAmount(TWENTY_PERCENT)); - assertEq(SymbioticStaking(symbioticStaking).submissionCooldown(), SUBMISSION_COOLDOWN); - } - - function _fund_tokens() internal { - deal(pond, operatorA, FUND_FOR_SELF_STAKE); - deal(pond, operatorB, FUND_FOR_SELF_STAKE); - deal(pond, operatorC, FUND_FOR_SELF_STAKE); - - deal(usdc, jobRequesterA, FUND_FOR_FEE); - deal(usdc, jobRequesterB, FUND_FOR_FEE); - deal(usdc, jobRequesterC, FUND_FOR_FEE); - - deal(inflationRewardToken, inflationRewardManager, FUND_FOR_INFLATION_REWARD); - } - - - /*===================================== internal pure ======================================*/ - - /// @notice convert 100% -> 1e18 (i.e. 50 -> 50e17) - function _calcShareAmount(uint256 _shareIntPercentage) internal pure returns (uint256) { - return Math.mulDiv(_shareIntPercentage, 1e18, 100); - } -} diff --git a/test/foundry/e2e/KalypsoStaking.t.sol b/test/foundry/e2e/KalypsoStaking.t.sol deleted file mode 100644 index 0acb0d6..0000000 --- a/test/foundry/e2e/KalypsoStaking.t.sol +++ /dev/null @@ -1,904 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.20; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {TestSetup} from "../TestSetup.t.sol"; - -/* contracts */ -import {JobManager} from "../../../contracts/staking/l2_contracts/JobManager.sol"; -import {StakingManager} from "../../../contracts/staking/l2_contracts/StakingManager.sol"; -import {SymbioticStaking} from "../../../contracts/staking/l2_contracts/SymbioticStaking.sol"; -import {SymbioticStakingReward} from "../../../contracts/staking/l2_contracts/SymbioticStakingReward.sol"; - -/* interfaces */ -import {IJobManager} from "../../../contracts/interfaces/staking/IJobManager.sol"; -import {IStakingManager} from "../../../contracts/interfaces/staking/IStakingManager.sol"; -import {INativeStaking} from "../../../contracts/interfaces/staking/INativeStaking.sol"; -import {ISymbioticStaking} from "../../../contracts/interfaces/staking/ISymbioticStaking.sol"; -import {ISymbioticStakingReward} from "../../../contracts/interfaces/staking/ISymbioticStakingReward.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - -/* libraries */ -import {Struct} from "../../../contracts/lib/staking/Struct.sol"; -import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; - -contract KalypsoStakingTest is Test, TestSetup { - uint256 constant OPERATORA_SELF_STAKE_AMOUNT = 1000 ether; - uint256 constant OPERATORB_SELF_STAKE_AMOUNT = 2000 ether; - uint256 constant OPERATORC_SELF_STAKE_AMOUNT = 1500 ether; - - uint256 operatorAFeeReward; - uint256 operatorBFeeReward; - uint256 operatorCFeeReward; - - uint256 transmitterAFeeReward; - uint256 transmitterBFeeReward; - uint256 transmitterCFeeReward; - - function setUp() public { - _setupAddr(); - _setupContracts(); - _fund_tokens(); - - /*-------------------- Config --------------------*/ - /* JobManager */ - _setJobManagerConfig(); - - /* StakingManager */ - _setStakingManagerConfig(); - - /* NativeStaking */ - _setNativeStakingConfig(); - - /* SymbioticStaking */ - _setSymbioticStakingConfig(); - } - - /// @notice test full lifecycle of kalypso staking - function test_kalypso_staking() public { - /* current timestamp: 50_001 */ - vm.warp(block.timestamp + 50_000); - assertEq(block.timestamp, 50_001); - - // operators self stake - _operator_self_stake(); - - /*============================== Snapshot 1 ==============================*/ - // Snapshot 1 submitted - _symbiotic_staking_snapshot_submission_1(); - - /* jobId1 created (jobRequesterA -> OperatorA, 1 USDC) */ - _create_job_1(); - - // proof submitted - vm.warp(block.timestamp + 10 minutes); - _submit_proof_job_1(); - - // symbioticVaultA claims fee reward - _vault_claims_reward_from_job_1(); - - /* jobId2 created (jobRequesterB -> OperatorB, 0.5 USDC) */ - vm.warp(block.timestamp + SUBMISSION_COOLDOWN); // POND locked - _create_job_2(); - - // jobId2 completed - _submit_proof_job_2(); - - /*============================== Snapshot 2 ==============================*/ - // Snapshot 2 submitted - // here, the reward for jobId2 should be accrued for the symbioticVaultB (for staking 3000 POND to OperatorB) - vm.warp(block.timestamp + SUBMISSION_COOLDOWN); - _symbiotic_staking_snapshot_submission_2(); - - _create_job_3(); - - _submit_proof_job_3(); - - _vaultA_claims_reward_from_job_3(); - - /*============================== Snapshot 3 ==============================*/ - // Snapshot 3 submitted - vm.warp(block.timestamp + SUBMISSION_COOLDOWN); - _symbiotic_staking_snapshot_submission_3(); - - _create_job_4(); - - _submit_proof_job_4(); - - _vaultA_claims_reward_from_job_4(); - - _vaultC_claims_reward_from_job_4(); - - _vaultD_claims_reward_from_job_4(); - - _operators_and_transmitters_claim_fee_reward(); - } - - /*===================================================== internal ====================================================*/ - - function _operator_self_stake() internal { - // Operator A self stakes 1000 WETH and 1000 POND - vm.startPrank(operatorA); - { - IERC20(weth).approve(nativeStaking, type(uint256).max); - IERC20(pond).approve(nativeStaking, type(uint256).max); - - // weth is not supported in NativeStaking - vm.expectRevert("Token not supported"); - INativeStaking(nativeStaking).stake(weth, operatorA, OPERATORA_SELF_STAKE_AMOUNT); - - // only operator can stake - vm.expectRevert("Only operator can stake"); - INativeStaking(nativeStaking).stake(pond, operatorB, OPERATORA_SELF_STAKE_AMOUNT); - - // stake 1000 POND - INativeStaking(nativeStaking).stake(pond, operatorA, OPERATORA_SELF_STAKE_AMOUNT); - } - vm.stopPrank(); - assertEq( - INativeStaking(nativeStaking).getOperatorStakeAmount(pond, operatorA), - OPERATORA_SELF_STAKE_AMOUNT, - "_operator_self_stake: OperatorA stake amount mismatch" - ); - assertEq( - INativeStaking(nativeStaking).getOperatorActiveStakeAmount(pond, operatorA), - OPERATORA_SELF_STAKE_AMOUNT, - "_operator_self_stake: OperatorA active stake amount mismatch" - ); - - // OperatorB self stakes 2000 POND - vm.startPrank(operatorB); - { - IERC20(pond).approve(nativeStaking, type(uint256).max); - - INativeStaking(nativeStaking).stake(pond, operatorB, OPERATORB_SELF_STAKE_AMOUNT); - } - vm.stopPrank(); - assertEq( - INativeStaking(nativeStaking).getOperatorStakeAmount(pond, operatorB), - OPERATORB_SELF_STAKE_AMOUNT, - "_operator_self_stake: OperatorB stake amount mismatch" - ); - assertEq( - INativeStaking(nativeStaking).getOperatorActiveStakeAmount(pond, operatorB), - OPERATORB_SELF_STAKE_AMOUNT, - "_operator_self_stake: OperatorB active stake amount mismatch" - ); - - vm.startPrank(operatorC); - { - IERC20(pond).approve(nativeStaking, type(uint256).max); - INativeStaking(nativeStaking).stake(pond, operatorC, OPERATORC_SELF_STAKE_AMOUNT); - } - vm.stopPrank(); - } - - function _symbiotic_staking_snapshot_submission_1() internal { - /* - < TransmitterA Transmits > - OperatorA: opted-into symbioticVaultA (weth) - 1000 weth, - OperatorB: opted-into symbioticVaultA (weth) - 2000 weth, symbioticVaultB (pond) - 3000 pond - */ - - // Partial Tx 1 - Struct.VaultSnapshot[] memory _vaultSnapshots1 = new Struct.VaultSnapshot[](1); - /* Vault A */ - // VaultA(1000 WETH) -> OperatorA - _vaultSnapshots1[0].operator = operatorA; - _vaultSnapshots1[0].vault = symbioticVaultA; - _vaultSnapshots1[0].stakeToken = weth; - _vaultSnapshots1[0].stakeAmount = 1000 ether; - - // Partial Tx 2 - Struct.VaultSnapshot[] memory _vaultSnapshots2 = new Struct.VaultSnapshot[](2); - - /* Vault B */ - - // VaultA(2000 weth) -> OperatorB - _vaultSnapshots2[0].operator = operatorB; - _vaultSnapshots2[0].vault = symbioticVaultA; - _vaultSnapshots2[0].stakeToken = weth; - _vaultSnapshots2[0].stakeAmount = 2000 ether; - - // VaultB(3000 POND) -> OperatorB - _vaultSnapshots2[1].operator = operatorB; - _vaultSnapshots2[1].vault = symbioticVaultB; - _vaultSnapshots2[1].stakeToken = pond; - _vaultSnapshots2[1].stakeAmount = 3000 ether; - - /* Snapshot Submission */ - vm.startPrank(transmitterA); - { - vm.expectRevert("Invalid index"); - ISymbioticStaking(symbioticStaking).submitVaultSnapshot( - 3, 2, block.timestamp - 5, abi.encode(_vaultSnapshots1), "" - ); - - vm.expectRevert("Invalid index"); - ISymbioticStaking(symbioticStaking).submitVaultSnapshot( - 2, 2, block.timestamp - 5, abi.encode(_vaultSnapshots1), "" - ); - - vm.expectRevert("Invalid timestamp"); - ISymbioticStaking(symbioticStaking).submitVaultSnapshot( - 1, 2, block.timestamp + 1, abi.encode(_vaultSnapshots1), "" - ); - - ISymbioticStaking(symbioticStaking).submitVaultSnapshot( - 0, 2, block.timestamp - 5, abi.encode(_vaultSnapshots1), "" - ); - } - vm.stopPrank(); - (uint256 _idxToSubmit, uint256 _numOfTxs) = - ISymbioticStaking(symbioticStaking).txCountInfo(block.timestamp - 5, keccak256("STAKE_SNAPSHOT_TYPE")); - - assertEq(_idxToSubmit, 1, "_symbiotic_staking_snapshot_submission_1: Tx count info mismatch"); - assertEq(_numOfTxs, 2, "_symbiotic_staking_snapshot_submission_1: Tx count info mismatch"); - assertEq( - ISymbioticStaking(symbioticStaking).getSubmissionStatus(block.timestamp - 5, transmitterA), - 0x0, - "_symbiotic_staking_snapshot_submission_1: Submission status mismatch" - ); - - vm.startPrank(transmitterA); - { - ISymbioticStaking(symbioticStaking).submitVaultSnapshot( - 1, 2, block.timestamp - 5, abi.encode(_vaultSnapshots2), "" - ); - } - vm.stopPrank(); - - assertEq( - ISymbioticStaking(symbioticStaking).registeredTransmitters(block.timestamp - 5), - transmitterA, - "_symbiotic_staking_snapshot_submission_1: Registered transmitter mismatch" - ); - - (_idxToSubmit, _numOfTxs) = - ISymbioticStaking(symbioticStaking).txCountInfo(block.timestamp - 5, keccak256("STAKE_SNAPSHOT_TYPE")); - assertEq(_idxToSubmit, 2); - assertEq(_numOfTxs, 2); - assertEq( - ISymbioticStaking(symbioticStaking).getSubmissionStatus(block.timestamp - 5, transmitterA), - 0x0000000000000000000000000000000000000000000000000000000000000001, - "Submission status mismatch" - ); - - /* Slash Result Submission */ - vm.prank(transmitterA); - ISymbioticStaking(symbioticStaking).submitSlashResult(0, 1, block.timestamp - 5, abi.encode(""), ""); - } - - function _create_job_1() internal { - // requesterA creates a job - vm.startPrank(jobRequesterA); - { - IERC20(feeToken).approve(jobManager, type(uint256).max); - uint256 jobmanagerBalanceBefore = IERC20(feeToken).balanceOf(jobManager); - - vm.expectRevert("No stakeToken available to lock"); - IJobManager(jobManager).createJob(1, jobRequesterA, operatorC, 1 * USDC_DECIMALS); // should revert as operatorC didn't stake any token to NativeStaking - - // pay 1 usdc as fee - IJobManager(jobManager).createJob(1, jobRequesterA, operatorA, 1 * USDC_DECIMALS); - assertEq(IERC20(feeToken).balanceOf(jobManager) - jobmanagerBalanceBefore, 1 * USDC_DECIMALS); - } - vm.stopPrank(); - } - - function _submit_proof_job_1() internal { - // locked stake token for jobId 1 - uint256 jobId = 1; - (address lockedStakeToken,) = ISymbioticStaking(symbioticStaking).lockInfo(jobId); - assertEq(lockedStakeToken, weth, "_submit_proof_job_1: Locked stake token mismatch"); - - // OperatorA and TransmitterA fee reward before - uint256 operatorAFeeRewardBefore = IJobManager(jobManager).operatorFeeRewards(operatorA); - uint256 transmitterAFeeRewardBefore = IJobManager(jobManager).transmitterFeeRewards(transmitterA); - - // rewardPerTokenStored before for operatorA - uint256 rewardPerTokenStoredBefore = - ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenStored(lockedStakeToken, feeToken, operatorA); - assertEq(rewardPerTokenStoredBefore, 0, "_submit_proof_job_1: RewardPerTokenStored mismatch"); - - // staked weth amount for operatorA - uint256 stakedWethAmount = ISymbioticStaking(symbioticStaking).getOperatorStakeAmount(weth, operatorA); - assertEq(stakedWethAmount, 1000 ether, "_submit_proof_job_1: Staked weth amount mismatch"); - - // expected rewardPerTokenStored after job completion - uint256 rewardPerTokenIncreased = Math.mulDiv(1 * USDC_DECIMALS * 70 / 100 * 80 / 100, 1e18, stakedWethAmount); - - vm.startPrank(operatorA); - { - // reverts if submitted after deadline - vm.warp(block.timestamp + 12 hours); - vm.expectRevert("Job Expired"); - IJobManager(jobManager).submitProof(1, ""); - - vm.warp(block.timestamp - 12 hours); - IJobManager(jobManager).submitProof(1, ""); - } - vm.stopPrank(); - - /* - - fee paid: 1 usdc - - operator reward share: 30% - => 1 * 0.3 = 0.3 usdc - - transmitter comission rate: 20% - => 1 * 0.7 * 0.2 = 0.14 usdc - */ - - // OperatorA and TransmitterA fee reward after - uint256 operatorAFeeRewardAfter = IJobManager(jobManager).operatorFeeRewards(operatorA); - uint256 transmitterAFeeRewardAfter = IJobManager(jobManager).transmitterFeeRewards(transmitterA); - - assertEq(operatorAFeeRewardAfter - operatorAFeeRewardBefore, 3 * USDC_DECIMALS / 10, "OperatorA fee reward mismatch"); - operatorAFeeReward += operatorAFeeRewardAfter - operatorAFeeRewardBefore; - - assertEq(transmitterAFeeRewardAfter - transmitterAFeeRewardBefore, 14 * USDC_DECIMALS / 100, "TransmitterA fee reward mismatch"); - transmitterAFeeReward += transmitterAFeeRewardAfter - transmitterAFeeRewardBefore; - - // rewardPerTokenStored after for operatorA - uint256 rewardPerTokenStoredAfter = - ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenStored(lockedStakeToken, feeToken, operatorA); - assertEq( - rewardPerTokenStoredAfter, - rewardPerTokenStoredBefore + rewardPerTokenIncreased, - "_submit_proof_job_1: RewardPerTokenStored mismatch" - ); - } - - function _vault_claims_reward_from_job_1() internal { - /* - Vault A claim fee reward - */ - vm.startPrank(symbioticVaultA); - ISymbioticStakingReward(symbioticStakingReward).claimReward(operatorA); - vm.stopPrank(); - - /* - current status of staking: - operatorA: opted-into symbioticVaultA (weth) - 1000 weth, - operatorB: opted-into symbioticVaultA (weth) - 2000 weth, symbioticVaultB (pond) - 3000 pond - - operatorA has 100% reward share - - 1 USDC * 0.7(after operatorA commision 30%) * 0.8(after transmitter commision 20%) = 0.56 USDC - */ - - assertEq( - IERC20(feeToken).balanceOf(symbioticVaultA), 56 * USDC_DECIMALS / 100, "SymbioticVaultA fee reward mismatch" - ); - } - - // when multiple stakeTokens are staked to OperatorB - function _create_job_2() internal { - // requesterB creates a job - vm.startPrank(jobRequesterB); - { - // approve feeToken for jobManager - IERC20(feeToken).approve(jobManager, type(uint256).max); - uint256 jobmanagerBalanceBefore = IERC20(feeToken).balanceOf(jobManager); - - // requesterB pays 0.5 usdc as fee - IJobManager(jobManager).createJob(2, jobRequesterA, operatorB, 5 * USDC_DECIMALS / 10); - assertEq(IERC20(feeToken).balanceOf(jobManager) - jobmanagerBalanceBefore, 5 * USDC_DECIMALS / 10); - } - vm.stopPrank(); - } - - function _submit_proof_job_2() internal { - uint256 jobId = 2; - (address lockedStakeToken,) = ISymbioticStaking(symbioticStaking).lockInfo(jobId); - - // OperatorB and TransmitterA fee reward before - uint256 operatorBFeeRewardBefore = IJobManager(jobManager).operatorFeeRewards(operatorB); - uint256 transmitterAFeeRewardBefore = IJobManager(jobManager).transmitterFeeRewards(transmitterA); - - // rewardPerTokenStored before for operatorA - uint256 rewardPerTokenStoredBefore = - ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenStored(lockedStakeToken, feeToken, operatorB); - assertEq(rewardPerTokenStoredBefore, 0, "_submit_proof_job_2: RewardPerTokenStored mismatch"); - - // staked weth amount for operatorA - uint256 stakeTokenAmount = - ISymbioticStaking(symbioticStaking).getOperatorStakeAmount(lockedStakeToken, operatorB); - - // expected rewardPerTokenStored after job completion - uint256 rewardPerTokenToIncrease = - Math.mulDiv(1 * USDC_DECIMALS * (50 * 50 * 80) / (100 * 100 * 100), 1e18, stakeTokenAmount); - - vm.startPrank(operatorB); - { - IJobManager(jobManager).submitProof(2, ""); - } - vm.stopPrank(); - - // OperatorB and TransmitterA fee reward after - uint256 operatorBFeeRewardAfter = IJobManager(jobManager).operatorFeeRewards(operatorB); - uint256 transmitterAFeeRewardAfter = IJobManager(jobManager).transmitterFeeRewards(transmitterA); - - /* - - fee paid: 0.5 usdc - - operator reward share: 50% - => 0.5 * 0.5 = 0.25 usdc - - transmitter comission rate: 20% - => 0.5 * 0.5 * 0.2 = 0.05 usdc - - reward distributed - => 0.5 * 0.5 * 0.8 = 0.2 usdc - */ - - assertEq(operatorBFeeRewardAfter - operatorBFeeRewardBefore, 25 * USDC_DECIMALS / 100, "_submit_proof_job_2: OperatorB fee reward mismatch"); - operatorBFeeReward += operatorBFeeRewardAfter - operatorBFeeRewardBefore; - - assertEq(transmitterAFeeRewardAfter - transmitterAFeeRewardBefore, 5 * USDC_DECIMALS / 100, "_submit_proof_job_2: TransmitterA fee reward mismatch"); - transmitterAFeeReward += transmitterAFeeRewardAfter - transmitterAFeeRewardBefore; - - // rewardPerTokenStored after for operatorB - uint256 rewardPerTokenStoredAfter = - ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenStored(lockedStakeToken, feeToken, operatorB); - - assertEq( - rewardPerTokenStoredAfter, - rewardPerTokenStoredBefore + rewardPerTokenToIncrease, - "_submit_proof_job_2: RewardPerTokenStored mismatch" - ); - } - - // Reward from Job2 not claimed by vaultB - function _symbiotic_staking_snapshot_submission_2() internal { - uint256 vaultBRewardPerTokenPaidBefore = ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenPaid( - pond, feeToken, symbioticVaultB, operatorB - ); - - // same snapshot as in _symbiotic_staking_snapshot_submission_1 - Struct.VaultSnapshot[] memory originalSnapshotData = new Struct.VaultSnapshot[](3); - // VaultA -> OperatorA (1000 weth) - originalSnapshotData[0].operator = operatorA; - originalSnapshotData[0].vault = symbioticVaultA; - originalSnapshotData[0].stakeToken = weth; - originalSnapshotData[0].stakeAmount = 1000 ether; - - // VaultA -> OperatorB (2000 weth) - originalSnapshotData[1].operator = operatorB; - originalSnapshotData[1].vault = symbioticVaultA; - originalSnapshotData[1].stakeToken = weth; - originalSnapshotData[1].stakeAmount = 2000 ether; - - // VaultB -> OperatorB (3000 pond) - originalSnapshotData[2].operator = operatorB; - originalSnapshotData[2].vault = symbioticVaultB; - originalSnapshotData[2].stakeToken = pond; - originalSnapshotData[2].stakeAmount = 3000 ether; - - Struct.VaultSnapshot[] memory newSnapshotData = new Struct.VaultSnapshot[](5); - - // VaultE -> OperatorB (1500 POND) - newSnapshotData[0].operator = operatorB; - newSnapshotData[0].vault = symbioticVaultE; - newSnapshotData[0].stakeToken = pond; - newSnapshotData[0].stakeAmount = 1500 ether; - - // VaultA -> OperatorC (1500 WETH) - newSnapshotData[1].operator = operatorC; - newSnapshotData[1].vault = symbioticVaultA; - newSnapshotData[1].stakeToken = weth; - newSnapshotData[1].stakeAmount = 1500 ether; - - // VaultC -> OperatorC (2300 WETH) - newSnapshotData[2].operator = operatorC; - newSnapshotData[2].vault = symbioticVaultC; - newSnapshotData[2].stakeToken = weth; - newSnapshotData[2].stakeAmount = 2300 ether; - - // VaultD -> OperatorC (3000 WETH) - newSnapshotData[3].operator = operatorC; - newSnapshotData[3].vault = symbioticVaultD; - newSnapshotData[3].stakeToken = weth; - newSnapshotData[3].stakeAmount = 3000 ether; - - // VaultE -> OperatorC (4000 POND) - newSnapshotData[4].operator = operatorC; - newSnapshotData[4].vault = symbioticVaultE; - newSnapshotData[4].stakeToken = pond; - newSnapshotData[4].stakeAmount = 4000 ether; - - vm.startPrank(transmitterB); - { - ISymbioticStaking(symbioticStaking).submitVaultSnapshot( - 0, 2, block.timestamp - 5, abi.encode(originalSnapshotData), "" - ); - ISymbioticStaking(symbioticStaking).submitVaultSnapshot( - 1, 2, block.timestamp - 5, abi.encode(newSnapshotData), "" - ); - ISymbioticStaking(symbioticStaking).submitSlashResult(0, 1, block.timestamp - 5, abi.encode(""), ""); - } - vm.stopPrank(); - - assertEq(ISymbioticStaking(symbioticStaking).confirmedTimestampInfo(1).transmitter, transmitterB, "_symbiotic_staking_snapshot_submission_2: transmitter mismatch"); - - // check if reward distributed for JobId2 is reflected to symbioticVaultB during snapshot submission - { - // rewardPerTokenPaid for symbioticVaultB should be updated - // VaultB staked 3000 POND to OperatorB, and 0.2 USDC was distributed to OperatorB - uint256 vaultBStake = 3000 ether; - uint256 rewardPerTokenIncreased = Math.mulDiv(1 * USDC_DECIMALS * 20 / 100, 1e18, vaultBStake); - uint256 rewardPerTokenPaidAfter = ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenPaid( - pond, feeToken, symbioticVaultB, operatorB - ); - - assertEq( - rewardPerTokenPaidAfter - vaultBRewardPerTokenPaidBefore, - rewardPerTokenIncreased, - "_symbiotic_staking_snapshot_submission_2: RewardPerTokenPaid mismatch" - ); - uint256 rewardAccruedForVaultB = - ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultB); - assertEq( - rewardAccruedForVaultB, - Math.mulDiv(rewardPerTokenIncreased, vaultBStake, 1e18), - "_symbiotic_staking_snapshot_submission_2: RewardAccrued mismatch" - ); - } - } - - - // when multiple stakeTokens are staked to OperatorB - function _create_job_3() internal { - // requesterB creates a job - vm.startPrank(jobRequesterB); - { - // approve feeToken for jobManager - IERC20(feeToken).approve(jobManager, type(uint256).max); - uint256 jobmanagerBalanceBefore = IERC20(feeToken).balanceOf(jobManager); - - // requesterB pays 0.7 usdc as fee - IJobManager(jobManager).createJob(3, jobRequesterA, operatorC, 7 * USDC_DECIMALS / 10); - assertEq(IERC20(feeToken).balanceOf(jobManager) - jobmanagerBalanceBefore, 7 * USDC_DECIMALS / 10); - } - vm.stopPrank(); - } - - function _submit_proof_job_3() internal { - (address lockedStakeToken,) = ISymbioticStaking(symbioticStaking).lockInfo(3); - - // OperatorC and TransmitterB fee reward before - uint256 operatorCFeeRewardBefore = IJobManager(jobManager).operatorFeeRewards(operatorC); - uint256 transmitterBFeeRewardBefore = IJobManager(jobManager).transmitterFeeRewards(transmitterB); - - uint256 rewardPerTokenStoredBefore = ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenStored( - lockedStakeToken, feeToken, operatorC - ); - - /* - < expected fee reward > - fee paid: 0.7 usdc - - OperatorC has 15% reward share - => 0.7 * 0.15 = 0.105 usdc - - Transmitter comission rate: 20% - => 0.7 * 0.85 * 0.2 = 0.119 usdc - - reward distributed - => 0.7 * 0.85 * 0.8 = 0.476 usdc - */ - - // TransmitterA submits proof for JobId3 - vm.startPrank(transmitterA); - { - IJobManager(jobManager).submitProof(3, ""); - } - vm.stopPrank(); - - // OperatorC and TransmitterB fee reward after - uint256 operatorCFeeRewardAfter = IJobManager(jobManager).operatorFeeRewards(operatorC); - uint256 transmitterBFeeRewardAfter = IJobManager(jobManager).transmitterFeeRewards(transmitterB); - - assertEq(operatorCFeeRewardAfter - operatorCFeeRewardBefore, 105 * USDC_DECIMALS / 1000, "_submit_proof_job_3: OperatorC fee reward mismatch"); - operatorCFeeReward += operatorCFeeRewardAfter - operatorCFeeRewardBefore; - - assertEq(transmitterBFeeRewardAfter - transmitterBFeeRewardBefore, 119 * USDC_DECIMALS / 1000, "_submit_proof_job_3: TransmitterB fee reward mismatch"); - transmitterBFeeReward += transmitterBFeeRewardAfter - transmitterBFeeRewardBefore; - - // rewardPerTokenStored for operatorC after - uint256 rewardPerTokenStoredAfter = ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenStored( - lockedStakeToken, feeToken, operatorC - ); - // WETH locked, 0.476 usdc distributed, 6800 WETH staked to OperatorC - assertEq(rewardPerTokenStoredAfter - rewardPerTokenStoredBefore, Math.mulDiv(476 * USDC_DECIMALS / 1000, 1e18, 6800e18), "_submit_proof_job_3: RewardPerTokenStored mismatch"); - } - - function _vaultA_claims_reward_from_job_3() internal { - // 0.476 usdc distributed to OperatorC - uint256 rewardDistributed = 476 * USDC_DECIMALS / 1000; - // out of 6800 WETH staked to OperatorC, 1500 WETH is staked by SymbioticVaultA - uint256 rewardForVaultAExpected = Math.mulDiv(rewardDistributed, 1500e18, 6800e18); - - uint256 vaultAUSDCBalanceBefore = IERC20(feeToken).balanceOf(symbioticVaultA); - - vm.startPrank(symbioticVaultA); - { - ISymbioticStakingReward(symbioticStakingReward).claimReward(operatorC); - } - vm.stopPrank(); - - uint256 vaultAUSDCBalanceAfter = IERC20(feeToken).balanceOf(symbioticVaultA); - assertEq(vaultAUSDCBalanceAfter - vaultAUSDCBalanceBefore, rewardForVaultAExpected, "_vaultA_claims_reward_from_job_3: VaultA fee reward mismatch"); - } - - function _symbiotic_staking_snapshot_submission_3() internal { - // Vaults that staked to OperatorC during JobId3 - uint256 job3RewardDistributed = 476 * USDC_DECIMALS / 1000; - - uint256 vaultARewardAccruedBefore = ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultA); - uint256 vaultARewardExpected = 0; - - // VaultC staked 2300 WETH to OperatorC - uint256 vaultCRewardAccruedBefore = ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultC); - uint256 vaultCRewardExpected = Math.mulDiv(job3RewardDistributed, 2300e18, 6800e18); - - // VaultD staked 3000 WETH to OperatorC - uint256 vaultDRewardAccruedBefore = ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultD); - uint256 vaultDRewardExpected = Math.mulDiv(job3RewardDistributed, 3000e18, 6800e18); - - // VaultE staked 1500 POND to OperatorC, WETH was selected so no reward accrued - uint256 vaultERewardAccruedBefore = ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultE); - uint256 vaultERewardExpected = 0; - - // everything else is same as Snapshot2, except that VaultC and VaultE unstaked from OperatorC - - // same snapshot as in _symbiotic_staking_snapshot_submission_1 - Struct.VaultSnapshot[] memory snapshotData = new Struct.VaultSnapshot[](6); - // VaultA -> OperatorA (1000 weth) - snapshotData[0].operator = operatorA; - snapshotData[0].vault = symbioticVaultA; - snapshotData[0].stakeToken = weth; - snapshotData[0].stakeAmount = 1000 ether; - - // VaultA -> OperatorB (2000 weth) - snapshotData[1].operator = operatorB; - snapshotData[1].vault = symbioticVaultA; - snapshotData[1].stakeToken = weth; - snapshotData[1].stakeAmount = 2000 ether; - - // VaultB -> OperatorB (3000 pond) - snapshotData[2].operator = operatorB; - snapshotData[2].vault = symbioticVaultB; - snapshotData[2].stakeToken = pond; - snapshotData[2].stakeAmount = 3000 ether; - - // VaultE -> OperatorB (1500 POND) - snapshotData[3].operator = operatorB; - snapshotData[3].vault = symbioticVaultE; - snapshotData[3].stakeToken = pond; - snapshotData[3].stakeAmount = 1500 ether; - - // VaultA -> OperatorC (1500 WETH) - snapshotData[4].operator = operatorC; - snapshotData[4].vault = symbioticVaultA; - snapshotData[4].stakeToken = weth; - snapshotData[4].stakeAmount = 1500 ether; - - // VaultD -> OperatorC (3000 WETH) - snapshotData[5].operator = operatorC; - snapshotData[5].vault = symbioticVaultD; - snapshotData[5].stakeToken = weth; - snapshotData[5].stakeAmount = 3000 ether; - - Struct.VaultSnapshot[] memory unstakedSnapshotData = new Struct.VaultSnapshot[](5); - - // VaultC -> OperatorC (0 WETH) [Unstaked] - unstakedSnapshotData[0].operator = operatorC; - unstakedSnapshotData[0].vault = symbioticVaultC; - unstakedSnapshotData[0].stakeToken = weth; - unstakedSnapshotData[0].stakeAmount = 0 ether; - - // VaultE -> OperatorC (0 POND) [Unstaked] - unstakedSnapshotData[1].operator = operatorC; - unstakedSnapshotData[1].vault = symbioticVaultE; - unstakedSnapshotData[1].stakeToken = pond; - unstakedSnapshotData[1].stakeAmount = 0 ether; - - vm.startPrank(transmitterC); - { - ISymbioticStaking(symbioticStaking).submitVaultSnapshot(0, 2, block.timestamp - 5, abi.encode(snapshotData), ""); - ISymbioticStaking(symbioticStaking).submitVaultSnapshot(1, 2, block.timestamp - 5, abi.encode(unstakedSnapshotData), ""); - ISymbioticStaking(symbioticStaking).submitSlashResult(0, 1, block.timestamp - 5, abi.encode(""), ""); - } - vm.stopPrank(); - assertEq(ISymbioticStaking(symbioticStaking).latestConfirmedTimestampInfo().transmitter, transmitterC, "_symbiotic_staking_snapshot_submission_3: transmitter mismatch"); - - // check if reward accrued for Vaults are updated - uint256 vaultARewardAccruedAfter = ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultA); - uint256 vaultCRewardAccruedAfter = ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultC); - uint256 vaultDRewardAccruedAfter = ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultD); - uint256 vaultERewardAccruedAfter = ISymbioticStakingReward(symbioticStakingReward).rewardAccrued(feeToken, symbioticVaultE); - - assertEq(vaultARewardAccruedAfter - vaultARewardAccruedBefore, vaultARewardExpected, "_symbiotic_staking_snapshot_submission_3: VaultA reward accrued mismatch"); - assertEq(vaultCRewardAccruedAfter - vaultCRewardAccruedBefore, vaultCRewardExpected, "_symbiotic_staking_snapshot_submission_3: VaultC reward accrued mismatch"); - assertEq(vaultDRewardAccruedAfter - vaultDRewardAccruedBefore, vaultDRewardExpected, "_symbiotic_staking_snapshot_submission_3: VaultD reward accrued mismatch"); - assertEq(vaultERewardAccruedAfter - vaultERewardAccruedBefore, vaultERewardExpected, "_symbiotic_staking_snapshot_submission_3: VaultE reward accrued mismatch"); - } - - function _create_job_4() internal { - // requesterB creates a job - vm.startPrank(jobRequesterB); - { - IERC20(feeToken).approve(jobManager, type(uint256).max); - IJobManager(jobManager).createJob(4, jobRequesterA, operatorC, 97 * USDC_DECIMALS / 100); - } - vm.stopPrank(); - } - - /* - < expected fee reward > - - OperatorC has 15% reward share - => 0.97 * 0.15 = 0.1455 usdc - - Transmitter comission rate: 20% - => 0.97 * 0.85 * 0.2 = 0.1649 usdc - - reward distributed - => 0.97 * 0.85 * 0.8 = 0.6596 usdc - - */ - function _submit_proof_job_4() internal { - (address lockedStakeToken,) = ISymbioticStaking(symbioticStaking).lockInfo(4); - - // OperatorC and TransmitterB fee reward before - uint256 operatorCFeeRewardBefore = IJobManager(jobManager).operatorFeeRewards(operatorC); - uint256 transmitterCFeeRewardBefore = IJobManager(jobManager).transmitterFeeRewards(transmitterC); - - // RewardDistrobutor - uint256 rewardPerTokenStoredBefore = ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenStored( - lockedStakeToken, feeToken, operatorC - ); - uint256 rewardPertokenToIncrease = Math.mulDiv(6596 * USDC_DECIMALS / 10000, 1e18, 4500e18); // 4500 WETH staked to OperatorC - - // TransmitterC submits proof for JobId4 - vm.startPrank(transmitterC); - { - IJobManager(jobManager).submitProof(4, ""); - } - vm.stopPrank(); - - // OperatorC and TransmitterB fee reward after - uint256 operatorCFeeRewardAfter = IJobManager(jobManager).operatorFeeRewards(operatorC); - uint256 transmitterCFeeRewardAfter = IJobManager(jobManager).transmitterFeeRewards(transmitterC); - - assertEq(operatorCFeeRewardAfter - operatorCFeeRewardBefore, 1455 * USDC_DECIMALS / 10000, "_submit_proof_job_4: OperatorC fee reward mismatch"); - operatorCFeeReward += operatorCFeeRewardAfter - operatorCFeeRewardBefore; - - assertEq(transmitterCFeeRewardAfter - transmitterCFeeRewardBefore, 1649 * USDC_DECIMALS / 10000, "_submit_proof_job_4: TransmitterC fee reward mismatch"); - transmitterCFeeReward += transmitterCFeeRewardAfter - transmitterCFeeRewardBefore; - - // check if reward distributed for JobId4 is reflected to symbioticVaultA during snapshot submission - uint256 rewardPerTokenStoredAfter = ISymbioticStakingReward(symbioticStakingReward).rewardPerTokenStored( - lockedStakeToken, feeToken, operatorC - ); - assertEq(rewardPerTokenStoredAfter - rewardPerTokenStoredBefore, rewardPertokenToIncrease, "_submit_proof_job_4: RewardPerTokenStored mismatch"); - } - - function _vaultA_claims_reward_from_job_4() internal { - // 0.6596 usdc distributed to OperatorC for JobId4 - uint256 rewardDistributed = 6596 * USDC_DECIMALS / 10000; - uint256 operatorCStake = 4500e18; - uint256 rewardPerTokenAdded = Math.mulDiv(rewardDistributed, 1e18, operatorCStake); - - // out of 4500 WETH staked to OperatorC, 1500 WETH is staked by SymbioticVaultA - uint256 vaultARewardExpected = Math.mulDiv(rewardPerTokenAdded, 1500e18, 1e18); - - uint256 vaultAUSDCBalanceBefore = IERC20(feeToken).balanceOf(symbioticVaultA); - - vm.startPrank(symbioticVaultA); - { - ISymbioticStakingReward(symbioticStakingReward).claimReward(operatorC); - } - vm.stopPrank(); - - uint256 vaultAUSDCBalanceAfter = IERC20(feeToken).balanceOf(symbioticVaultA); - assertEq(vaultAUSDCBalanceAfter - vaultAUSDCBalanceBefore, vaultARewardExpected, "_vaultA_claims_reward_from_job_4: VaultA fee reward mismatch"); - } - - // VaultC unstaked after Job3, and hasn't claimed the reward accrued - function _vaultC_claims_reward_from_job_4() internal { - // 0.476 usdc distributed to OperatorC for JobId3 - uint256 job3RewardDistributed = 476 * USDC_DECIMALS / 1000; - uint256 job3OperatorCStake = 6800e18; - uint256 job3RewardPerTokenAdded = Math.mulDiv(job3RewardDistributed, 1e18, job3OperatorCStake); - uint256 vaultCRewardExpected = Math.mulDiv(job3RewardPerTokenAdded, 2300e18, 1e18); - - uint256 vaultCUSDCBalanceBefore = IERC20(feeToken).balanceOf(symbioticVaultC); - - vm.startPrank(symbioticVaultC); - { - ISymbioticStakingReward(symbioticStakingReward).claimReward(operatorC); - } - vm.stopPrank(); - - uint256 vaultCUSDCBalanceAfter = IERC20(feeToken).balanceOf(symbioticVaultC); - assertEq(vaultCUSDCBalanceAfter - vaultCUSDCBalanceBefore, vaultCRewardExpected, "_vaultC_claims_reward_from_job_4: VaultC fee reward mismatch"); - } - - function _vaultD_claims_reward_from_job_4() internal { - uint256 vaultDRewardExpected; - - // 0.476 usdc distributed to OperatorC for JobId3 - uint256 job3RewardDistributed = 476 * USDC_DECIMALS / 1000; - uint256 job3OperatorCStake = 6800e18; - uint256 job3RewardPerTokenAdded = Math.mulDiv(job3RewardDistributed, 1e18, job3OperatorCStake); - vaultDRewardExpected += Math.mulDiv(job3RewardPerTokenAdded, 3000e18, 1e18); - - // 0.6596 usdc distributed to OperatorC for JobId4 - uint256 job4RewardDistributed = 6596 * USDC_DECIMALS / 10000; - uint256 job4OperatorCStake = 4500e18; - uint256 job4RewardPerTokenAdded = Math.mulDiv(job4RewardDistributed, 1e18, job4OperatorCStake); - vaultDRewardExpected += Math.mulDiv(job4RewardPerTokenAdded, 3000e18, 1e18); - - uint256 vaultDUSDCBalanceBefore = IERC20(feeToken).balanceOf(symbioticVaultD); - - vm.startPrank(symbioticVaultD); - { - ISymbioticStakingReward(symbioticStakingReward).claimReward(operatorC); - } - vm.stopPrank(); - - uint256 vaultDUSDCBalanceAfter = IERC20(feeToken).balanceOf(symbioticVaultD); - assertEq(vaultDUSDCBalanceAfter - vaultDUSDCBalanceBefore, vaultDRewardExpected, "_vaultD_claims_reward_from_job_4: VaultD fee reward mismatch"); - } - - function _operators_and_transmitters_claim_fee_reward() internal { - uint256 operatorAFeeTokenBalanceBefore = IERC20(feeToken).balanceOf(operatorA); - uint256 operatorBFeeTokenBalanceBefore = IERC20(feeToken).balanceOf(operatorB); - uint256 operatorCFeeTokenBalanceBefore = IERC20(feeToken).balanceOf(operatorC); - - uint256 transmitterAFeeTokenBalanceBefore = IERC20(feeToken).balanceOf(transmitterA); - uint256 transmitterBFeeTokenBalanceBefore = IERC20(feeToken).balanceOf(transmitterB); - uint256 transmitterCFeeTokenBalanceBefore = IERC20(feeToken).balanceOf(transmitterC); - - vm.prank(operatorA); - - IJobManager(jobManager).claimOperatorFeeReward(); - - vm.prank(operatorB); - IJobManager(jobManager).claimOperatorFeeReward(); - - vm.prank(operatorC); - IJobManager(jobManager).claimOperatorFeeReward(); - - vm.prank(transmitterA); - IJobManager(jobManager).claimTransmitterFeeReward(); - - vm.prank(transmitterB); - IJobManager(jobManager).claimTransmitterFeeReward(); - - vm.prank(transmitterC); - IJobManager(jobManager).claimTransmitterFeeReward(); - - uint256 operatorAFeeTokenBalanceAfter = IERC20(feeToken).balanceOf(operatorA); - uint256 operatorBFeeTokenBalanceAfter = IERC20(feeToken).balanceOf(operatorB); - uint256 operatorCFeeTokenBalanceAfter = IERC20(feeToken).balanceOf(operatorC); - - uint256 transmitterAFeeTokenBalanceAfter = IERC20(feeToken).balanceOf(transmitterA); - uint256 transmitterBFeeTokenBalanceAfter = IERC20(feeToken).balanceOf(transmitterB); - uint256 transmitterCFeeTokenBalanceAfter = IERC20(feeToken).balanceOf(transmitterC); - - assertEq(operatorAFeeTokenBalanceAfter - operatorAFeeTokenBalanceBefore, operatorAFeeReward, "_operators_and_transmitters_claim_fee_reward: OperatorA fee token balance mismatch"); - assertEq(operatorBFeeTokenBalanceAfter - operatorBFeeTokenBalanceBefore, operatorBFeeReward, "_operators_and_transmitters_claim_fee_reward: OperatorB fee token balance mismatch"); - assertEq(operatorCFeeTokenBalanceAfter - operatorCFeeTokenBalanceBefore, operatorCFeeReward, "_operators_and_transmitters_claim_fee_reward: OperatorC fee token balance mismatch"); - - assertEq(transmitterAFeeTokenBalanceAfter - transmitterAFeeTokenBalanceBefore, transmitterAFeeReward, "_operators_and_transmitters_claim_fee_reward: TransmitterA fee token balance mismatch"); - assertEq(transmitterBFeeTokenBalanceAfter - transmitterBFeeTokenBalanceBefore, transmitterBFeeReward, "_operators_and_transmitters_claim_fee_reward: TransmitterB fee token balance mismatch"); - assertEq(transmitterCFeeTokenBalanceAfter - transmitterCFeeTokenBalanceBefore, transmitterCFeeReward, "_operators_and_transmitters_claim_fee_reward: TransmitterC fee token balance mismatch"); - } -} diff --git a/test/foundry/mocks/POND.sol b/test/foundry/mocks/POND.sol deleted file mode 100644 index 5b48bf1..0000000 --- a/test/foundry/mocks/POND.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.26; - -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract POND is ERC20 { - - uint256 constant INITIAL_SUPPLY = 100_000_000 ether; - - constructor(address admin) ERC20("POND", "POND") { - _mint(admin, INITIAL_SUPPLY); - } - - function mint(address to, uint256 amount) external { - _mint(to, amount); - } -} diff --git a/test/foundry/mocks/USDC.sol b/test/foundry/mocks/USDC.sol deleted file mode 100644 index fd32ee1..0000000 --- a/test/foundry/mocks/USDC.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.26; - -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract USDC is ERC20 { - - uint256 constant INITIAL_SUPPLY = 100_000_000 ether; - - constructor(address admin) ERC20("USDC", "USDC") { - _mint(admin, INITIAL_SUPPLY); - } -} diff --git a/test/foundry/mocks/WETH.sol b/test/foundry/mocks/WETH.sol deleted file mode 100644 index c3d70c5..0000000 --- a/test/foundry/mocks/WETH.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.26; - -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract WETH is ERC20 { - - uint256 constant INITIAL_SUPPLY = 100_000_000 ether; - - constructor(address admin) ERC20("WETH", "WETH") { - _mint(admin, INITIAL_SUPPLY); - } -} From 5f34f999f064855d11f08b78d9abf6ad42094886 Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 1 Nov 2024 11:54:51 +0000 Subject: [PATCH 2/2] add getOperatorStakeAmountAt to pass compilation --- contracts/GeneratorRegistry.sol | 2 +- contracts/binding_generator.sol | 1 - contracts/interfaces/IGeneratorCallbacks.sol | 2 +- contracts/interfaces/IGeneratorRegistry.sol | 4 ++-- contracts/staking/l2_contracts/SymbioticStaking.sol | 5 +++++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/contracts/GeneratorRegistry.sol b/contracts/GeneratorRegistry.sol index 0df259e..3b39328 100644 --- a/contracts/GeneratorRegistry.sol +++ b/contracts/GeneratorRegistry.sol @@ -628,7 +628,7 @@ contract GeneratorRegistry is revert Error.InvalidContractAddress(); } - emit IntendToReduceStake(generatorAddress, token, amount); + emit RequestStakeDecrease(generatorAddress, token, amount); } function removeStakeCallback(address generatorAddress, address token, uint256 amount) external override { diff --git a/contracts/binding_generator.sol b/contracts/binding_generator.sol index 2532157..1be80d3 100644 --- a/contracts/binding_generator.sol +++ b/contracts/binding_generator.sol @@ -6,7 +6,6 @@ import "./EntityKeyRegistry.sol"; import "./GeneratorRegistry.sol"; import "./ProofMarketplace.sol"; import "./staking/l2_contracts/NativeStaking.sol"; -import "./staking/l2_contracts/StakingManager.sol"; import "./staking/l2_contracts/SymbioticStaking.sol"; contract binding_generator { diff --git a/contracts/interfaces/IGeneratorCallbacks.sol b/contracts/interfaces/IGeneratorCallbacks.sol index c11ab50..8cd6bf8 100644 --- a/contracts/interfaces/IGeneratorCallbacks.sol +++ b/contracts/interfaces/IGeneratorCallbacks.sol @@ -5,7 +5,7 @@ interface IGeneratorCallbacks { event AddedStake(address indexed generatorAddress, address indexed token, uint256 amount); function addStakeCallback(address generatorAddress, address token, uint256 amount) external; - event IntendToReduceStake(address indexed generatorAddress, address indexed token, uint256 amount); + event RequestStakeDecrease(address indexed generatorAddress, address indexed token, uint256 amount); function intendToReduceStakeCallback(address generatorAddress, address token, uint256 amount) external; event RemovedStake(address indexed generatorAddress, address indexed token, uint256 amount); diff --git a/contracts/interfaces/IGeneratorRegistry.sol b/contracts/interfaces/IGeneratorRegistry.sol index 70bec75..7648531 100644 --- a/contracts/interfaces/IGeneratorRegistry.sol +++ b/contracts/interfaces/IGeneratorRegistry.sol @@ -20,9 +20,9 @@ contract IGeneratorRegistry { event RequestComputeDecrease(address indexed generator, uint256 intendedUtilization); event DecreaseCompute(address indexed generator, uint256 compute); - event ComputeLockImposed(address indexed generator, uint256 stake); + event ComputeLockImposed(address indexed generator, uint256 compute); - event ComputeLockReleased(address indexed generator, uint256 stake); + event ComputeLockReleased(address indexed generator, uint256 compute); //-------------------------------- Events end --------------------------------// } diff --git a/contracts/staking/l2_contracts/SymbioticStaking.sol b/contracts/staking/l2_contracts/SymbioticStaking.sol index 678aba8..e4d4091 100644 --- a/contracts/staking/l2_contracts/SymbioticStaking.sol +++ b/contracts/staking/l2_contracts/SymbioticStaking.sol @@ -394,6 +394,11 @@ contract SymbioticStaking is return operatorStakeAmounts[latestConfirmedTimestamp()][_stakeToken][_operator]; } + function getOperatorStakeAmountAt(uint256 _captureTimestamp, address _stakeToken, address _operator) public view returns (uint256) { + return operatorStakeAmounts[_captureTimestamp][_stakeToken][_operator]; + } + + function getOperatorActiveStakeAmount(address _stakeToken, address _operator) public view returns (uint256) { uint256 operatorStakeAmount = getOperatorStakeAmount(_stakeToken, _operator); uint256 operatorLockedAmount = operatorLockedAmounts[_stakeToken][_operator];